Versions in this module Expand all Collapse all v0 v0.7.9 Feb 21, 2024 v0.7.8 Feb 21, 2024 v0.7.7 Nov 29, 2023 v0.7.6 Apr 14, 2023 v0.7.5 Mar 10, 2023 Changes in this version + const DBDriverMysql + const DBDriverPostgres + const DBDriverSqlite + const GroupHostMode + const GroupOtherMode + const InstanceStatusDone + const InstanceStatusRunning + func ClearInstance(sinceBefore time.Time, jobId int) (err error) + func DeleteCommandHistoryById(id int) error + func DeleteGroupById(id int) error + func DeleteJobById(id int) error + func DeletePlayBookById(id int) error + func DeletePrivateKeyById(id int) error + func DeleteQuicklyCommandById(id int) error + func DeleteTagById(id int) error + func DeleteTunnelById(id int) error + func ExistedGroup(name string) bool + func ExistedHost(name string, addr string) bool + func ExistedPlayBook(name string, steps string) bool + func ExistedPrivateKey(keyFile string) bool + func ExistedTag(name string) bool + func ExistedTunnel(id int) bool + func GetPaginateQuery(instance T, pageSize, page int, params map[string]interface{}, preload bool) (int64, error) + func InitModels(dsn, dbName, user, pass, driver, _dataPath string) error + func InsertOrUpdateCommandHistory(cmd string) error + func RefreshJob(job *Job) error + func RefreshTunnel(tunnel *Tunnel) error + func UpdateHostStatus(host *Host) error + func UpdateTaskInstanceLogTrace(instance *TaskInstance, logPath string) error + type CommandHistory struct + Cmd string + Id int + Times uint32 + func SearchCommandHistory(keyword string, limit int) ([]*CommandHistory, error) + type DataBase struct + func (d *DataBase) Lock() + func (d *DataBase) Unlock() + type Group struct + Host []Host + Id int + Mode int + Name string + Params string + func GetAllGroup() ([]*Group, error) + func GetGroupById(id int) (*Group, error) + func GetGroupByName(name string) (*Group, error) + func InsertGroup(name string, params string, mode int) (*Group, error) + func UpdateGroup(id int, name string, params string, mode int) (*Group, error) + type Host struct + Addr string + Group Group + GroupId int + Id int + Name string + PassWord string + Port int + PrivateKey PrivateKey + PrivateKeyID int + Status bool + Tags []Tag + Tunnels []Tunnel + User string + VNCPort int + func DeleteHostById(id int) (*Host, error) + func GetAllHost() ([]*Host, error) + func GetAllHostWithOutPreload() ([]*Host, error) + func GetHostByAddr(addr string) ([]*Host, error) + func GetHostByGlob(glob string) ([]*Host, error) + func GetHostById(id int) (*Host, error) + func GetHostByIdWithPreload(id int) (*Host, error) + func GetHostByReg(regStr string) ([]*Host, error) + func GetHostsByGroup(group *Group) ([]*Host, error) + func GetHostsByTag(tag *Tag) ([]*Host, error) + func InsertHost(hostname string, user string, addr string, port int, password string, ...) (*Host, error) + func ParseHostList(pType string, id int) ([]*Host, error) + func UpdateHost(id int, hostname string, user string, addr string, port int, password string, ...) (*Host, error) + type HostExport struct + Addr string + Group string + GroupParams string + KeyFile string + KeyName string + KeyPhrase string + Name string + PassWord string + Port int + Tags []string + User string + VNCPort int + type Job struct + Cmd string + CmdId int + CmdType string + ExecuteID int + ExecuteType string + Id int + Instances []TaskInstance + Name string + Spec string + Status string + Type string + func GetAllJob() ([]*Job, error) + func GetJobById(id int) (*Job, error) + func InsertJob(name, t, spec, cmd string, executeID, cmdId int, executeType, cmdType string) (*Job, error) + func UpdateJob(id int, name, t, spec, cmd, cmdType string, cmdId, executeId int, ...) (*Job, error) + func UpdateJobStatus(id int, status string) (*Job, error) + type PlayBook struct + Id int + Name string + Steps string + StepsObj []*Step + func GetAllPlayBook() ([]*PlayBook, error) + func GetPlayBookById(id int) (*PlayBook, error) + func InsertPlayBook(name, steps string) (*PlayBook, error) + func UpdatePlayBook(id int, name string, steps string) (*PlayBook, error) + func (p *PlayBook) GetStepsObj() error + type PrivateKey struct + Id int + KeyFile string + Name string + Passphrase string + func GetAllPrivateKey() ([]*PrivateKey, error) + func GetPrivateKeyById(id int) (*PrivateKey, error) + func GetPrivateKeyByName(name string) (*PrivateKey, error) + func InsertPrivateKey(name, keyFile, passphrase string) (*PrivateKey, error) + func UpdatePrivateKey(id int, name, keyFile, passphrase string) (*PrivateKey, error) + type QuicklyCommand struct + AppendCR bool + Cmd string + Id int + Name string + func GetAllQuicklyCommand() ([]*QuicklyCommand, error) + func GetQuicklyCommandById(id int) (*QuicklyCommand, error) + func InsertQuicklyCommand(name, cmd string, appendCR bool) (*QuicklyCommand, error) + func UpdateQuicklyCommand(id int, name, cmd string, appendCR bool) (*QuicklyCommand, error) + type Step struct + Caches string + Name string + Params string + Seq int + Type string + func (s *Step) GetCaches() []string + type StepSlice []Step + func (s StepSlice) Len() int + func (s StepSlice) Less(i, j int) bool + func (s StepSlice) Swap(i, j int) + type Tag struct + Hosts []Host + Id int + Name string + func GetAllTag() ([]*Tag, error) + func GetTagById(id int) (*Tag, error) + func GetTagByName(name string) (*Tag, error) + func InsertTag(name string) (*Tag, error) + func UpdateTag(id int, name string) (*Tag, error) + type TaskInstance struct + EndTime time.Time + Id int + Job Job + JobId int + LogData string + LogPath string + StartTime time.Time + Status string + Uid string + func GetTaskInstanceById(id int) (*TaskInstance, error) + func InsertTaskInstance(jobId int, start time.Time) (*TaskInstance, error) + func (ti *TaskInstance) Done() error + func (ti *TaskInstance) GenerateLogPath(tmpPath string) string + func (ti *TaskInstance) UpdateStatus(status string) error + type Tunnel struct + Destination string + ErrorMsg string + Host Host + HostId int + Id int + Mode string + Source string + Status int + func GetAllTunnel() ([]*Tunnel, error) + func GetTunnelById(id int) (*Tunnel, error) + func GetTunnelsByHostId(id int) ([]*Tunnel, error) + func InsertTunnel(mode, src, dest string, host *Host) (*Tunnel, error) + func UpdateTunnel(id int, mode, src, dest string) (*Tunnel, error) + func UpdateTunnelStatus(id int, status bool, msg string) (*Tunnel, error)