data

package
v0.0.0-...-8c01f08 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//    ------------- Key formats ----------------
	DeployBucketDbKey        = "deployments"
	DeployCounterKeyFmt      = "%s:counter"
	DeployObjectDbKeyFmt     = "%s:data:%d"
	DeployObjectListDbKeyFmt = "%s:data:"
	// This key will contain the deployment json body
	// examples:
	//	- {NAMESPACE}:data:{INCREMENTAL DEPLOY ID}
	//  - slok/daton:data:1
	//  - slok/daton:data:98
	//	- docker/docker:data:4
	DeployQueryDbKeyFmt = "%s:query:%s"
)

Deloyment database keys

View Source
const (
	// Deploy status constants
	StatusPending = "pending"
	StatusSuccess = "success"
	StatusError   = "error"
	StatusFailure = "failure"
)

Variables

This section is empty.

Functions

func ListDeploymentsAsJson

func ListDeploymentsAsJson(namespace string) ([][]byte, error)

Types

type BoltDb

type BoltDb struct {
	Conn *bolt.DB
	Path string
}

Bolt database will be the storage for the data

func GetBoltDb

func GetBoltDb() (*BoltDb, error)

Returns a boltdb connection (if doesn't exists it creates)

func (*BoltDb) Disconnect

func (b *BoltDb) Disconnect() error

type Deployment

type Deployment struct {
	Url           string      `json:"url"`
	Id            int64       `json:"id"`
	Sha           string      `json:"sha"`
	Ref           string      `json:"ref"` // Required always
	Task          string      `json:"task"`
	Payload       interface{} `json:"payload"`
	Environment   string      `json:"environment"`
	Description   string      `json:"description"`
	Creator       User        `json:"creator"`
	CreatedAt     time.Time   `json:"created_at"`
	UpdatedAt     time.Time   `json:"updated_at"`
	StatusesUrl   string      `json:"statuses_url"`
	RepositoryUrl string      `json:"repository_url"`
	StatusId      int         `json:"status_id"`
	Namespace     string      `json:"-"`
}

Deploy represents a deployment

func ListDeployments

func ListDeployments(namespace string) ([]Deployment, error)

func (*Deployment) Save

func (d *Deployment) Save() error

type Status

type Status struct {
	Url           string    `json:"url"`
	Id            int       `json:"id"`
	State         string    `json:"state"` // Required always
	Creator       User      `json:"creator"`
	Description   string    `json:"description"`
	TargetUrl     string    `json:"target_url"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	DeploymentUrl string    `json:"deployment_url"`
	RepositoryUrl string    `json:"repository_url"`
	DeploymentId  int       `json:"deploy_id"`
	Namespace     string    `json:"-"`
}

Status represents the current status of a deployment

type User

type User struct {
	Login string `json:"login"`
	Id    int    `json:"id"`
}

Jump to

Keyboard shortcuts

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