db

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MIT Imports: 3 Imported by: 1

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) QueryDeploy

func (d *DBConnect) QueryDeploy(deployID string) (*DeployStatus, error)

QueryDeploy returns the status of a deploy request.

func (*DBConnect) StartDeploy

func (d *DBConnect) StartDeploy(deployID string, domain string, environment string, serviceName string,
	version string, numInstances int, serviceTemplate string, etcd2Keys map[string]string,
	suffix string) bool

StartDeploy inserts a fresh row into the log for a deployment run.

func (*DBConnect) UpdateDeploy

func (d *DBConnect) UpdateDeploy(deployID string, status int, message string, log string) 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.)
	ServiceName  string `json:"serviceName"`  // The application name of the service ex: video-mobile.
	Version      string `json:"version"`      // The version of teh application ex; 1.0.0
	Suffix       string `json:"suffix"`       // The suffix added to the service name.
	NumInstances int    `json:"numInstances"` // The number of instances deployed.
	Status       int    `json:"status"`       // The status ID of the result.
	Message      string `json:"message"`      // A user friendly message of what occurred.
	Log          string `json:"log"`          // The log of all steps run during the deploy.
	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