Documentation
¶
Index ¶
- Constants
- Variables
- func Automigrate()
- func Dbinit() (*gorm.DB, error)
- type RedisDB
- func (db *RedisDB) Bool(command string, args ...interface{}) (bool, error)
- func (db *RedisDB) Do(command string, args ...interface{}) (interface{}, error)
- func (db *RedisDB) InitPool()
- func (db *RedisDB) Int(command string, args ...interface{}) (int, error)
- func (db *RedisDB) Ints(command string, args ...interface{}) ([]int, error)
- func (db *RedisDB) String(command string, args ...interface{}) (string, error)
- func (db *RedisDB) StringMap(command string, args ...interface{}) (map[string]string, error)
- func (db *RedisDB) Strings(command string, args ...interface{}) ([]string, error)
- type TaskResult
- type VCron
- type VLog
- type VUser
- type Vuserlog
Constants ¶
View Source
const ( EmailNotify int = 1 ForceKill int = 2 HealthCheck int = 3 BothRun int = 4 )
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func Automigrate ¶
func Automigrate()
Types ¶
type RedisDB ¶
var Redis *RedisDB
type TaskResult ¶
type VCron ¶
type VCron struct { Id uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` Jobid int64 `gorm:"type:int(50);comment:'作业ID';not null;index:IX_jobid" json:"jobid"` JobName string `gorm:"type:varchar(550);comment:'作业名字';not null" json:"job_name"` Cmd string `gorm:"type:varchar(200);comment:'执行命令';not null" json:"cmd"` Rule string `gorm:"type:varchar(100);comment:'cron规则';" json:"rule"` Runyear string `gorm:"type:int(2);comment:'执行年份 : 1每年,2今年';" json:"runyear"` Querytype string `gorm:"type:varchar(50);comment:'命令类型:wget,curl,phpget,other';not null" json:"querytype"` State string `gorm:"type:int(50);comment:'作业状态';not null" json:"state"` Author string `gorm:"type:varchar(50);comment:'作业属主';" json:"author"` AdminMobile string `gorm:"type:varchar(10);comment:'属主电话';" json:"admin_mobile"` AdminEmail string `gorm:"type:varchar(100);comment:'属主邮箱';" json:"admin_email"` Remark string `gorm:"type:varchar(500);comment:'备注';" json:"remark"` Createtime time.Time `gorm:"type:datetime;comment:'创建时间';" json:"create_time"` Runat string `gorm:"type:varchar(50);comment:'执行机器'" json:"runat"` Overflow int `` /* 173-byte string literal not displayed */ Taskid int64 `gorm:"-"` TaskStatus int64 `gorm:"-"` }
作业表
type VLog ¶
type VLog struct { Id uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` Jobid int64 `gorm:"type:int(50);comment:'作业ID';not null;index:IX_jobid" json:"jobid"` JobName string `gorm:"type:varchar(550);comment:'作业名字';not null" json:"job_name"` Status int64 `` /* 168-byte string literal not displayed */ Starttime time.Time `gorm:"type:datetime;comment:'开始时间';" json:"starttime"` Endtime time.Time `gorm:"type:datetime;default null;comment:'结束时间';" json:"endtime"` Cmd string `gorm:"type:varchar(200);comment:'执行命令';not null" json:"cmd"` Error string `gorm:"type:varchar(500);comment:'错误信息'" json:"error"` Runat string `gorm:"type:varchar(50);comment:'执行机器'" json:"runat"` Jobdata string `gorm:"type:varchar(1000);comment:'Job data'" json:"jobdata"` Createtime time.Time `gorm:"type:datetime;comment:'创建时间';" json:"createtime"` Updatetime time.Time `gorm:"type:datetime;comment:'修改时间';" json:"updatetime"` }
CRON日志表
func (*VLog) UpdateTaskLog ¶
func (task *VLog) UpdateTaskLog(taskLogId int64, taskResult TaskResult) (int64, error)
更新任务日志
type VUser ¶
type VUser struct { Id uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` Userid int `gorm:"type:int(50);comment:'用户ID';not null;index:IX_user_id" json:"user_id"` Username string `gorm:"type:varchar(550);comment:'用户名字';not null" json:"user_name"` Email string `gorm:"type:varchar(200);comment:'邮箱';not null" json:"email"` Password string `gorm:"type:varchar(100);comment:'密码';" json:"password"` Isactive string `gorm:"type:varchar(50);comment:'是否激活 0:未激活,1:激活';not null" json:"is_active"` Createtime time.Time `gorm:"type:datetime;comment:'创建时间';" json:"create_time"` LastLogin time.Time `gorm:"type:datetime;comment:'上次登录时间';" json:"last_login"` }
用户表
type Vuserlog ¶
type Vuserlog struct { Id uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` Jobid int `gorm:"type:int(50);comment:'作业ID';not null;index:IX_jobid" json:"jobid"` JobName string `gorm:"type:varchar(550);comment:'作业名字';not null" json:"job_name"` Userid int `gorm:"type:int(50);comment:'用户ID';not null;index:IX_user_id" json:"user_id"` Modifycontent string `gorm:"type:varchar(1000);comment:'Job data'" json:"modify_content"` Mtype int `gorm:"type:int(50);comment:'修改类型(creat,modify)';not null;" json:"mtype"` Createtime time.Time `gorm:"type:datetime;comment:'创建时间';" json:"createtime"` }
cron用户日志表
Click to show internal directories.
Click to hide internal directories.