Documentation
¶
Index ¶
- Variables
- func InitModels() error
- type Cluster
- func (m Cluster) Add(name, tags, note string) (*Cluster, error)
- func (m Cluster) Delete(id int) error
- func (m Cluster) GetAll() ([]*Cluster, error)
- func (m Cluster) GetOne(id int) (*Cluster, error)
- func (m Cluster) TableName() string
- func (m Cluster) TableUnique() [][]string
- func (m Cluster) Update(id int, name, tags, note string) (*Cluster, error)
- type ClusterNode
- type Deploy
- type DeployHistory
- func (m DeployHistory) Add(did int, ip string) (*DeployHistory, error)
- func (m DeployHistory) GetAll(did int) ([]*DeployHistory, error)
- func (m DeployHistory) GetOne(id int) (*DeployHistory, error)
- func (m DeployHistory) TableIndex() [][]string
- func (m DeployHistory) TableName() string
- func (m DeployHistory) Update(id, status int, note string) error
- type Node
- func (m Node) Add(ip, port, note string) (*Node, error)
- func (m Node) Del(id int) error
- func (m Node) GetAll() ([]*Node, error)
- func (m Node) GetOne(id int) (*Node, error)
- func (m Node) GetOneByIp(ip string) (*Node, error)
- func (m Node) TableName() string
- func (m Node) TableUnique() [][]string
- func (m Node) Update(id int, ip, port, note string, status int, lastReport time.Time) (*Node, error)
- type Project
- func (m Project) Add(name, path, pushpath, tags, note string) (*Project, error)
- func (m Project) Del(id int) error
- func (m Project) GetAll() ([]*Project, error)
- func (m Project) GetOne(id int) (*Project, error)
- func (m Project) TableName() string
- func (m Project) TableUnique() [][]string
- func (m Project) Update(id int, name, path, pushpath, tags, note string) (*Project, error)
- type ProjectCluster
- func (m ProjectCluster) Add(pid, cid int, customNode, bshell, eshell, note string) (*ProjectCluster, error)
- func (m ProjectCluster) Del(id int) error
- func (m ProjectCluster) DelProject(pid int) error
- func (m ProjectCluster) GetAll(pid int) ([]*ProjectCluster, error)
- func (m ProjectCluster) TableName() string
- func (m ProjectCluster) TableUnique() [][]string
- func (m ProjectCluster) Update(id, pid, cid int, customNode, bshell, eshell, note string) (*ProjectCluster, error)
- type User
- func (m User) Add(username, name, password string, administrator int) (*User, error)
- func (m User) CheckCreateAdministor() error
- func (m User) CheckPassword(username, password string) (*User, error)
- func (m User) Del(id int) error
- func (m User) GetAll() ([]*User, error)
- func (m User) GetOne(id int) (*User, error)
- func (m User) GetViaUsername(username string) (*User, error)
- func (m User) TableName() string
- func (m User) TableUnique() [][]string
- func (m User) Update(id int, username, name string, administrator int) (*User, error)
- func (m User) UpdateLastLogin(id int, ip string) error
- func (m User) UpdatePassword(id int, password string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ClusterModel = &Cluster{}
)
View Source
var (
ClusterNodeModel = &ClusterNode{}
)
View Source
var (
DB orm.Ormer
)
View Source
var (
DeployHistoryModel = &DeployHistory{}
)
View Source
var (
DeployModel = &Deploy{}
)
View Source
var (
NodeModel = &Node{}
)
View Source
var (
ProjectClusterModel = &ProjectCluster{}
)
View Source
var (
ProjectModel = &Project{}
)
View Source
var (
UserModel = &User{}
)
Functions ¶
func InitModels ¶
func InitModels() error
Types ¶
type Cluster ¶
type Cluster struct { Id int `json:"id"` Name string `json:"name"` Tags string `json:"tags"` Note string `json:"note"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` Nodes []*Node `orm:"-" json:"nodes"` }
func (Cluster) TableUnique ¶
type ClusterNode ¶
type ClusterNode struct { Id int `json:"id"` Cid int `json:"cid"` Mid int `json:"mid"` Created time.Time `json:"created"` }
func (ClusterNode) Add ¶
func (m ClusterNode) Add(cid, mid int) error
func (ClusterNode) Delete ¶
func (m ClusterNode) Delete(cid int) error
func (ClusterNode) TableName ¶
func (m ClusterNode) TableName() string
func (ClusterNode) TableUnique ¶
func (m ClusterNode) TableUnique() [][]string
type Deploy ¶
type Deploy struct { Id int `json:"id"` Pid int `json:"pid"` Commit string `json:"commit"` Diff string `json:"diff"` Status int `json:"status"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` DeployHistory []*DeployHistory `orm:"-" json:"deployHistory"` }
status - 0 未开始 - 1 发布中 - 2 发布完成 - 3 发布失败 - 4 发布失败(部分机器)
func (Deploy) TableIndex ¶
func (Deploy) UpdateStatus ¶
type DeployHistory ¶
type DeployHistory struct { Id int `json:"id"` Did int `json:"did"` Ip string `json:"ip"` Status int `json:"status"` Note string `json:"note"` Created time.Time `json:"created"` }
status - 0 未开始 - 1 发布中 - 2 发布完成 - 3 发布失败
func (DeployHistory) Add ¶
func (m DeployHistory) Add(did int, ip string) (*DeployHistory, error)
func (DeployHistory) GetAll ¶
func (m DeployHistory) GetAll(did int) ([]*DeployHistory, error)
func (DeployHistory) GetOne ¶
func (m DeployHistory) GetOne(id int) (*DeployHistory, error)
func (DeployHistory) TableIndex ¶
func (m DeployHistory) TableIndex() [][]string
func (DeployHistory) TableName ¶
func (m DeployHistory) TableName() string
type Node ¶
type Node struct { Id int `json:"id"` Ip string `json:"ip"` Port string `json:"port"` Note string `json:"note"` Status int `json:"status"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` LastReport time.Time `json:"lastReport"` }
status 0-未启用 1-正常 -1-停用
func (Node) TableUnique ¶
type Project ¶
type Project struct { Id int `json:"id"` Name string `json:"name"` Path string `json:"path"` PushPath string `json:"pushPath"` Tags string `json:"tags"` Note string `json:"note"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` ProjectClusters []*ProjectCluster `orm:"-" json:"projectClusters"` }
func (Project) TableUnique ¶
type ProjectCluster ¶
type ProjectCluster struct { Id int `json:"id"` Pid int `json:"pid"` Cid int `json:"cid"` CustomNode string `json:"customNode"` Bshell string `json:"bshell"` Eshell string `json:"eshell"` Note string `json:"note"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` Cluster *Cluster `orm:"-" json:"cluster"` }
func (ProjectCluster) Add ¶
func (m ProjectCluster) Add(pid, cid int, customNode, bshell, eshell, note string) (*ProjectCluster, error)
func (ProjectCluster) Del ¶
func (m ProjectCluster) Del(id int) error
func (ProjectCluster) DelProject ¶
func (m ProjectCluster) DelProject(pid int) error
func (ProjectCluster) GetAll ¶
func (m ProjectCluster) GetAll(pid int) ([]*ProjectCluster, error)
func (ProjectCluster) TableName ¶
func (m ProjectCluster) TableName() string
func (ProjectCluster) TableUnique ¶
func (m ProjectCluster) TableUnique() [][]string
func (ProjectCluster) Update ¶
func (m ProjectCluster) Update(id, pid, cid int, customNode, bshell, eshell, note string) (*ProjectCluster, error)
type User ¶
type User struct { Id int `json:"id"` Username string `json:"username"` Password string `json:"-"` Name string `json:"name"` Administrator int `json:"administrator"` Created time.Time `json:"created"` LastLogin time.Time `json:"last_login"` LastLoginIp string `json:"last_login_ip"` }
func (User) CheckCreateAdministor ¶
func (User) TableUnique ¶
Click to show internal directories.
Click to hide internal directories.