Documentation
¶
Index ¶
- Constants
- Variables
- func BuildsCreate(entity *Build) error
- func DbClose()
- func DbGet() *sqlx.DB
- func DbInit(connectionString string) (err error)
- func EnvironmentsCreate(entity *Environment) error
- func EnvironmentsUpdate(entity *Environment) error
- func ProjectsCreate(entity *Project) error
- func ProjectsDestroy(id string) error
- func ProjectsUpdate(entity *Project) error
- func UsersCreate(entity *User) error
- func UsersDestroy(id string) error
- func UsersUpdate(entity *User) error
- type Build
- type BuildStatus
- type Builds
- type Deployment
- type DeploymentKind
- type DeploymentStatus
- type Deployments
- type Environment
- type Environments
- type Host
- type HostStatus
- type Hosts
- type Project
- type Projects
- type StringSlice
- type User
- type Users
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 EnvironmentsCreate ¶
func EnvironmentsCreate(entity *Environment) error
func EnvironmentsUpdate ¶
func EnvironmentsUpdate(entity *Environment) error
func ProjectsCreate ¶
func ProjectsDestroy ¶
func ProjectsUpdate ¶
func UsersCreate ¶
func UsersDestroy ¶
func UsersUpdate ¶
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
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 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 ProjectsFetchOneByTitle ¶
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
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 UsersFetchOneByApiToken ¶
func UsersFetchOneByEmail ¶
Click to show internal directories.
Click to hide internal directories.