db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2016 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Queued
	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) AuthDeployEnv

func (d *DBConnect) AuthDeployEnv(key string, env string) bool

AuthDeployEnv returns true if the API Key is valid to deploy to a given environment for a request.

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

func (d *DBConnect) QueueDeploy(deployID string, environment string, imageName string, imageTag string) bool

QueueDeploy 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"`    // UUID of teh deploy.
	Environment string `json:"environment"` // Environment serviced (development, qa etc.)
	ImageName   string `json:"imageName"`   // Docker image name.
	ImageTag    string `json:"imageTag"`    // Version tag of the image.
	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