Documentation ¶
Index ¶
- Constants
- Variables
- func Cabinets() *table.Table[Cabinet]
- func Commands() *table.Table[Command]
- func ConfigFiles() *table.Table[ConfigFile]
- func Deployments() *table.Table[Deployment]
- func Groups() *table.Table[Group]
- func Keys() *table.Table[Key]
- func ProjectEnvironments() *table.Table[ProjectEnvironment]
- func Projects() *table.Table[Project]
- func ShareFiles() *table.Table[ShareFile]
- func UserGroups() *table.Table[UserGroup]
- func UserProjects() *table.Table[UserProject]
- func Users() *table.Table[User]
- type Cabinet
- type Callback
- type Command
- type CommandOutput
- type CommandResult
- type ConfigFile
- type Deployment
- type EnvironmentSettings
- type Group
- type Key
- type Project
- type ProjectDetail
- type ProjectEnvVar
- type ProjectEnvironment
- type ProjectSettings
- type Server
- type ShareFile
- type User
- type UserGroup
- type UserProject
Constants ¶
View Source
const ( BeforeClone = "before_clone" AfterClone = "after_clone" BeforePrepare = "before_prepare" AfterPrepare = "after_prepare" BeforeRelease = "before_release" AfterRelease = "after_release" Init = "init" // 创建目录 Clone = "clone" // 克隆代码 Prepare = "prepare" // 准备配置文件、共享文件等 Release = "release" // 切换版本 StatusWaiting = "waiting" StatusRunning = "running" StatusFailed = "failed" StatusFinished = "finished" )
View Source
const ( UserRoleAdmin = "admin" UserRoleUser = "user" )
View Source
const ( InviteStatusWaiting = "inviting" InviteStatusJoined = "joined" InviteStatusRejected = "rejected" )
Variables ¶
View Source
var CabinetClass = class.Make[Cabinet]()
View Source
var CommandClass = class.Make[Command]()
View Source
var ConfigFileClass = class.Make[ConfigFile]()
View Source
var DeploymentClass = class.Make[Deployment]()
View Source
var GroupClass = class.Make[Group]()
View Source
var KeyClass = class.Make[Key]()
View Source
var ProjectClass = class.Make[Project]()
View Source
var ProjectEnvironmentClass = class.Make[ProjectEnvironment]()
View Source
var UserClass = class.Make[User]()
View Source
var UserGroupClass = class.Make[UserGroup]()
View Source
var UserProjectClass = class.Make[UserProject]()
Functions ¶
func ConfigFiles ¶
func ConfigFiles() *table.Table[ConfigFile]
func Deployments ¶
func Deployments() *table.Table[Deployment]
func ProjectEnvironments ¶
func ProjectEnvironments() *table.Table[ProjectEnvironment]
func ShareFiles ¶
func UserGroups ¶
func UserProjects ¶
func UserProjects() *table.Table[UserProject]
Types ¶
type Command ¶
type Command struct { table.Model[Command] `json:"-"` Id int `json:"id"` Name string `json:"name"` // 名称 ProjectId int `json:"project_id"` // 项目ID Step string `json:"step"` // 步骤 Sort int `json:"sort"` // 排序 User string `json:"user"` // 运行用户 Script string `json:"script"` // shell 脚本 Environments []int `json:"environments"` // 环境 Optional bool `json:"optional"` // 是否可选 DefaultSelected bool `json:"default_selected"` // 是否默认选中 CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type CommandOutput ¶
type CommandResult ¶
type ConfigFile ¶
type ConfigFile struct { table.Model[ConfigFile] `json:"-"` Id string `json:"id"` ProjectId int `json:"project_id"` // 项目ID Name string `json:"name"` // 名称 Path string `json:"path"` // 文件路径 Content string `json:"content"` // 内容 Environments []int `json:"environments"` // 关联环境 CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type Deployment ¶
type Deployment struct { table.Model[Deployment] `json:"-"` Id string `json:"id"` ProjectId int `json:"project_id"` // 项目ID Version string `json:"version"` // 部署版本 Comment string `json:"comment"` // 说明 Commit string `json:"commit"` // 提交 hash Status string `json:"status"` // 状态 Params map[string]bool `json:"params"` // {step: bool} Results []CommandResult `json:"results"` Environments []int `json:"environments"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type EnvironmentSettings ¶
type Project ¶
type Project struct { table.Model[Project] `json:"-"` Id int `json:"id"` Uuid string `json:"uuid"` Settings ProjectSettings `json:"settings"` Name string `json:"name"` CreatorId int `json:"creator_id"` GroupId int `json:"group_id"` KeyId int `json:"key_id"` RepoAddress string `json:"repo_address"` ProjectPath string `json:"project_path"` DefaultBranch string `json:"default_branch"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type ProjectDetail ¶
type ProjectEnvVar ¶
type ProjectEnvironment ¶
type ProjectEnvironment struct { table.Model[ProjectEnvironment] `json:"-"` Id int `json:"id"` ProjectId int `json:"project_id"` Name string `json:"name"` Settings EnvironmentSettings `json:"settings"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type ProjectSettings ¶
type ProjectSettings struct { EnvVars []ProjectEnvVar `json:"vars"` Branches []string `json:"branches"` Tags []string `json:"tags"` Callbacks []Callback `json:"callbacks"` }
type User ¶
type User struct { table.Model[User] `json:"-"` Id string `json:"id"` Username string `json:"username"` Nickname string `json:"nickname"` Avatar string `json:"avatar"` Role string `json:"role"` Password string `json:"password,omitempty"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type UserProject ¶
Click to show internal directories.
Click to hide internal directories.