data

package
v0.0.0-...-7aa43f1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildStatusWaiting   BuildStatus = "waiting"
	BuildStatusRunning               = "running"
	BuildStatusFailed                = "failed"
	BuildStatusSucceeded             = "succeeded"
)
View Source
const (
	DeploymentKindRegular  DeploymentKind = "regular"
	DeploymentKindHotfix                  = "hotfix"
	DeploymentKindRollback                = "rollback"
)
View Source
const (
	DeploymentStatusRunning   DeploymentStatus = "running"
	DeploymentStatusFailing                    = "failing"
	DeploymentStatusFailed                     = "failed"
	DeploymentStatusSucceeded                  = "succeeded"
)
View Source
const (
	HostStatusActive   HostStatus = "active"
	HostStatusInactive            = "inactive"
	HostStatusMissing             = "missing"
	HostStatusDeleted             = "deleted"
)

Variables

View Source
var DeploymentNotFound = &Deployment{}
View Source
var UserNotFound = &User{}

Functions

func BuildsCreate

func BuildsCreate(entity *Build) error

func DbClose

func DbClose()

func DbGet

func DbGet() *sqlx.DB

func DbInit

func DbInit(connectionString string) (err error)

func EnvironmentsCreate

func EnvironmentsCreate(entity *Environment) error

func EnvironmentsUpdate

func EnvironmentsUpdate(entity *Environment) error

func ProjectsCreate

func ProjectsCreate(entity *Project) error

func ProjectsDestroy

func ProjectsDestroy(id string) error

func ProjectsUpdate

func ProjectsUpdate(entity *Project) error

func UsersCreate

func UsersCreate(entity *User) error

func UsersDestroy

func UsersDestroy(id string) error

func UsersUpdate

func UsersUpdate(entity *User) error

Types

type Build

type Build struct {
	Id         string      `json:"id" db:"id"`
	Version    string      `json:"version" db:"version"`
	ProjectId  string      `json:"project_id" db:"project_id"`
	Status     BuildStatus `json:"status" db:"status"`
	RepoUrl    string      `json:"repo_url" db:"repo_url"`
	RepoName   string      `json:"repo_name" db:"repo_name"`
	RepoBranch string      `json:"repo_branch" db:"repo_branch"`
	RepoCommit string      `json:"repo_commit" db:"repo_commit"`
	Publisher  string      `json:"publisher" db:"publisher"`
	Created    time.Time   `json:"created" db:"created"`
}

type BuildStatus

type BuildStatus string

func (*BuildStatus) Scan

func (s *BuildStatus) Scan(value interface{}) error

func (BuildStatus) Value

func (s BuildStatus) Value() (driver.Value, error)

type Builds

type Builds []Build

func BuildsFetchList

func BuildsFetchList(order string, limit int, wheres map[string]interface{}) (*Builds, error)

type Deployment

type Deployment struct {
	Id            string           `json:"id" db:"id"`
	BuildId       string           `json:"build_id" db:"build_id"`
	ProjectId     string           `json:"project_id" db:"project_id"`
	EnvironmentId string           `json:"environment_id" db:"environment_id"`
	Kind          DeploymentKind   `json:"kind" db:"kind"`
	Status        DeploymentStatus `json:"status" db:"status"`
	Created       time.Time        `json:"created" db:"created"`
	Updated       time.Time        `json:"updated" db:"updated"`
}

type DeploymentKind

type DeploymentKind string

type DeploymentStatus

type DeploymentStatus string

type Deployments

type Deployments []Deployment

type Environment

type Environment struct {
	Id           string      `json:"id" db:"id"`
	ProjectId    string      `json:"project_id" db:"project_id"`
	Title        string      `json:"title" db:"title"`
	Priority     string      `json:"priority" db:"priority"`
	ScriptEnv    string      `json:"script_env" db:"script_env"`
	ScriptDeploy string      `json:"script_deploy" db:"script_deploy"`
	Hosts        StringSlice `json:"hosts" db:"hosts"`
	Groups       StringSlice `json:"groups" db:"groups"`
}

func EnvironmentsFetchOne

func EnvironmentsFetchOne(id string) (*Environment, error)

type Environments

type Environments []Environment

func EnvironmentsFetchListByProject

func EnvironmentsFetchListByProject(projectId string) (*Environments, error)

type Host

type Host struct {
	Id       string     `json:"id" db:"id"`
	Hostname string     `json:"hostname" db:"hostname"`
	Groups   []string   `json:"groups" db:"groups"`
	Ip       string     `json:"ip" db:"ip"`
	Status   HostStatus `json:"status" db:"status"`
	Created  time.Time  `json:"created" db:"created"`
	Updated  time.Time  `json:"updated" db:"updated"`
}

type HostStatus

type HostStatus string

type Hosts

type Hosts []Host

type Project

type Project struct {
	Id           string    `json:"id" db:"id"`
	Title        string    `json:"title" db:"title"`
	ScriptEnv    string    `json:"script_env" db:"script_env"`
	ScriptBuild  string    `json:"script_build" db:"script_build"`
	ScriptDeploy string    `json:"script_deploy" db:"script_deploy"`
	Created      time.Time `json:"created" db:"created"`
	Updated      time.Time `json:"updated" db:"updated"`
}

func ProjectsFetchOne

func ProjectsFetchOne(id string) (*Project, error)

func ProjectsFetchOneByTitle

func ProjectsFetchOneByTitle(title string) (*Project, error)

type Projects

type Projects []Project

func ProjectsFetchList

func ProjectsFetchList() (*Projects, error)

type StringSlice

type StringSlice []string

func (*StringSlice) Scan

func (s *StringSlice) Scan(src interface{}) error

Implements sql.Scanner for the String slice type Scanners take the database value (in this case as a byte slice) and sets the value of the type. Here we cast to a string and do a regexp based parse

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

type User

type User struct {
	Id       string    `json:"id" db:"id"`
	Email    string    `json:"email" db:"email"`
	Password string    `json:"password" db:"password"`
	ApiToken string    `json:"api_token" db:"api_token"`
	Deleted  bool      `json:"deleted" db:"deleted"`
	Created  time.Time `json:"created" db:"created"`
}

func UsersFetchOne

func UsersFetchOne(id string) (*User, error)

func UsersFetchOneByApiToken

func UsersFetchOneByApiToken(apiToken string) (*User, error)

func UsersFetchOneByEmail

func UsersFetchOneByEmail(email string) (*User, error)

type Users

type Users []User

func UsersFetchList

func UsersFetchList() (*Users, error)

Jump to

Keyboard shortcuts

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