db

package
v0.0.0-...-4814aa9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Started
	Success
	Failed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConnect

type DBConnect struct {
	// contains filtered or unexported fields
}

func NewDBConnect

func NewDBConnect(dsn string) (*DBConnect, error)

NewDBConnect is a factory method that returns a new db connection

func (*DBConnect) Close

func (d *DBConnect) Close() bool

Close closes the connection(s) to the DB.

func (*DBConnect) QueryDeployByName

func (d *DBConnect) QueryDeployByName(domain string, environment string, name string) (*DeployStatus, error)

QueryDeploy returns the status of a deploy request.

func (*DBConnect) StartDeploy

func (d *DBConnect) StartDeploy(domain string, environment string, name string, version string) bool

StartDeploy inserts or updates the deploy tracker for versions.

func (*DBConnect) UpdateDeployByName

func (d *DBConnect) UpdateDeployByName(domain string, environment string, name string,
	deployID string, status int) bool

UpdateDeploy updates the deploy row with information from the run.

func (*DBConnect) ValidAuth

func (d *DBConnect) ValidAuth(key string) bool

ValidAuth returns true if the API Key is valid for a request.

type DeployStatus

type DeployStatus struct {
	DeployID    string `json:"deployID"`    // The deploy UUID.
	Domain      string `json:"domain"`      // The domain name serviced.
	Environment string `json:"environment"` // The environment serviced (development, qa etc.)
	Name        string `json:"name"`        // The application name of the service ex: video-mobile.
	Version     string `json:"version"`     // The version of the application ex; 1.0.0-32
	Status      int    `json:"status"`      // The status ID of the result.
	UpdatedAt   string `json:"updatedAt"`   // The create date and time of the deploy.
	CreatedAt   string `json:"createdAt"`   // The last update to this record.
}

DeployStatus is used to return deploy status information from the database to the requester.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL