Documentation ¶
Overview ¶
********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-16 15:42:43 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:48:17 **********************************************
********************************************* ** @Des: 权限因子 ** @Author: haodaquan ** @Date: 2017-09-09 20:50:36 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 21:42:08 **********************************************
*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-10 19:51 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-10 19:51 ************************************************************
*********************************************************** ** @Description: models ** @Author: Bee ** @Date: 2019-02-15 20:21 ** @Last Modified by: Bee ** @Last Modified time: 2019-02-15 20:21 ************************************************************
********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-14 15:24:51 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:48:52 **********************************************
********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-15 11:44:13 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:49:13 **********************************************
*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-09 16:11 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-09 16:11 ************************************************************
*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-08 21:49 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-08 21:49 ************************************************************
*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-11 21:26 ** @Last Modified by: Bee ** @Last Modified time: 2019-02-15 21:32 ************************************************************
Index ¶
- Constants
- Variables
- func AdminAdd(a *Admin) (int64, error)
- func AuthAdd(auth *Auth) (int64, error)
- func BanAdd(obj *Ban) (int64, error)
- func BanDelById(id int) error
- func GetLogNum(status int) (int64, error)
- func GroupAdd(obj *Group) (int64, error)
- func GroupDelById(id int) error
- func Init(startTime int64)
- func NotifyTplAdd(obj *NotifyTpl) (int64, error)
- func NotifyTplDelById(id int) error
- func RoleAdd(role *Role) (int64, error)
- func RoleAuthAdd(ra *RoleAuth) (int64, error)
- func RoleAuthBatchAdd(ras *[]RoleAuth) (int64, error)
- func RoleAuthDelete(id int) (int64, error)
- func RoleAuthGetByIds(RoleIds string) (Authids string, err error)
- func RoleAuthMultiAdd(ras []*RoleAuth) (n int, err error)
- func ServerGroupAdd(obj *ServerGroup) (int64, error)
- func ServerGroupDelById(id int) error
- func SumByDays(limit int, status string) orm.Params
- func TableName(name string) string
- func TaskAdd(task *Task) (int64, error)
- func TaskDel(id int) (int64, error)
- func TaskLogAdd(t *TaskLog) (int64, error)
- func TaskLogDelById(id int) error
- func TaskLogDelByTaskId(taskId int) (int64, error)
- func TaskResetGroupId(groupId int) (int64, error)
- func TaskServerAdd(obj *TaskServer) (int64, error)
- func TaskServerDelById(id int) error
- func TaskServerForActuator(serverIp string, port int) int
- func TaskTotalRunNum() (int64, error)
- type Admin
- type Auth
- type Ban
- type Group
- type NotifyTpl
- type Role
- type RoleAuth
- type ServerGroup
- type SumDays
- type Task
- type TaskLog
- type TaskServer
Constants ¶
const ( NotifyTplTypeSystem = "system" NotifyTplTypeDefault = "default" )
const ( TASK_SUCCESS = 0 // 任务执行成功 TASK_ERROR = -1 // 任务执行出错 TASK_TIMEOUT = -2 // 任务执行超时 )
Variables ¶
var RunNumCache, _ = cache.NewCache("memory", `{"interval":60}`)
var StartTime int64
Functions ¶
func BanDelById ¶
func GroupDelById ¶
func NotifyTplAdd ¶
func NotifyTplDelById ¶
func RoleAuthAdd ¶
func RoleAuthBatchAdd ¶
func RoleAuthDelete ¶
func RoleAuthMultiAdd ¶
func ServerGroupAdd ¶
func ServerGroupAdd(obj *ServerGroup) (int64, error)
func ServerGroupDelById ¶
func TaskLogAdd ¶
func TaskLogDelById ¶
func TaskLogDelByTaskId ¶
func TaskResetGroupId ¶
func TaskServerAdd ¶
func TaskServerAdd(obj *TaskServer) (int64, error)
func TaskServerDelById ¶
func TaskServerForActuator ¶
Types ¶
type Admin ¶
type Admin struct { Id int LoginName string RealName string Password string RoleIds string Phone string Email string Dingtalk string Wechat string Salt string LastLogin int64 LastIp string Status int CreateId int UpdateId int CreateTime int64 UpdateTime int64 }
func AdminGetById ¶
func AdminGetByName ¶
func AdminGetList ¶
type Auth ¶
type Auth struct { Id int AuthName string AuthUrl string UserId int Pid int Sort int Icon string IsShow int Status int CreateId int UpdateId int CreateTime int64 UpdateTime int64 }
func AuthGetById ¶
func AuthGetList ¶
type Group ¶
type Group struct { Id int CreateId int UpdateId int GroupName string Description string CreateTime int64 UpdateTime int64 Status int }
func GroupGetById ¶
func GroupGetList ¶
type NotifyTpl ¶
type NotifyTpl struct { Id int Type string TplName string TplType int Title string Content string Status int CreateId int UpdateId int CreateTime int64 UpdateTime int64 }
func NotifyTplGetById ¶
func NotifyTplGetByTplType ¶
func NotifyTplGetList ¶
type Role ¶
type Role struct { Id int RoleName string Detail string ServerGroupIds string TaskGroupIds string Status int CreateId int UpdateId int CreateTime int64 UpdateTime int64 }
func RoleGetById ¶
func RoleGetList ¶
type RoleAuth ¶
func RoleAuthGetById ¶
type ServerGroup ¶
type ServerGroup struct { Id int CreateId int UpdateId int GroupName string Description string CreateTime int64 UpdateTime int64 Status int }
func ServerGroupGetList ¶
func ServerGroupGetList(page, pageSize int, filters ...interface{}) ([]*ServerGroup, int64)
func TaskGroupGetById ¶
func TaskGroupGetById(id int) (*ServerGroup, error)
func (*ServerGroup) TableName ¶
func (t *ServerGroup) TableName() string
func (*ServerGroup) Update ¶
func (t *ServerGroup) Update(fields ...string) error
type Task ¶
type Task struct { Id int GroupId int ServerIds string ServerType int TaskName string Description string CronSpec string Concurrent int Command string Timeout int ExecuteTimes int PrevTime int64 Status int IsNotify int NotifyType int NotifyTplId int NotifyUserIds string CreateId int UpdateId int CreateTime int64 UpdateTime int64 }
func TaskGetById ¶
func TaskGetList ¶
type TaskLog ¶
type TaskLog struct { Id int TaskId int ServerId int ServerName string Output string Error string Status int ProcessTime int CreateTime int64 }
func TaskLogGetById ¶
func TaskLogGetList ¶
type TaskServer ¶
type TaskServer struct { Id int GroupId int ConnectionType int ServerName string ServerAccount string ServerOuterIp string ServerIp string Port int Password string PrivateKeySrc string PublicKeySrc string Type int Detail string CreateTime int64 UpdateTime int64 Status int }
func TaskServerGetById ¶
func TaskServerGetById(id int) (*TaskServer, error)
func TaskServerGetByIds ¶
func TaskServerGetByIds(ids string) ([]*TaskServer, int64)
func TaskServerGetList ¶
func TaskServerGetList(page, pageSize int, filters ...interface{}) ([]*TaskServer, int64)
func (*TaskServer) TableName ¶
func (t *TaskServer) TableName() string
func (*TaskServer) Update ¶
func (t *TaskServer) Update(fields ...string) error