Documentation
¶
Index ¶
- Constants
- func GenerateSerialNo() string
- func GetLocalIpAddress() (ip string)
- func PackGroupConf(groupConf *GroupConf) (value []byte, err error)
- func PackJobConf(jobConf *JobConf) (value []byte, err error)
- func PackJobExecuteSnapshot(snapshot *JobExecuteSnapshot) (value []byte, err error)
- func PackJobSnapshot(snapshot *JobSnapshot) (value []byte, err error)
- func ParseInLocation(value string) (dateTime time.Time, err error)
- func TimeSubDays(t1, t2 time.Time) int
- func ToDateString(date time.Time) string
- type ApiAuth
- type Client
- type Group
- type GroupConf
- type InputLogin
- type JobAPI
- type JobChangeEvent
- type JobClient
- type JobClientDeleteEvent
- type JobCollection
- type JobConf
- type JobExecuteSnapshot
- type JobExecutor
- type JobGroupManager
- type JobManager
- type JobNode
- type JobScheduler
- type JobSnapshot
- type JobSnapshotFailOver
- type ManualExecuteJobParam
- type Node
- type NodeStateChangeListener
- type PageResult
- type QueryClientParam
- type QueryExecuteSnapshotParam
- type QuerySnapshotParam
- type Result
- type SchedulePlan
Constants ¶
View Source
const ( JobSnapshotPath = "/forest/client/snapshot/" JobSnapshotGroupPath = "/forest/client/snapshot/%s/" JobClientSnapshotPath = "/forest/client/snapshot/%s/%s/" )
View Source
const ( GroupConfPath = "/forest/server/group/" ClientPath = "/forest/client/%s/clients/" )
View Source
const ( JobNodePath = "/forest/server/node/" JobNodeElectPath = "/forest/server/elect/leader" TTL = 5 )
View Source
const ( JobCreateChangeEvent = iota JobUpdateChangeEvent JobDeleteChangeEvent )
View Source
const ( JobRunningStatus = iota + 1 JobStopStatus )
View Source
const ( NodeFollowerState = iota NodeLeaderState )
View Source
const ( JobExecuteSnapshotDoingStatus = 1 JobExecuteSnapshotSuccessStatus = 2 JobExecuteSnapshotUnkonwStatus = 3 JobExecuteSnapshotErrorStatus = -1 )
View Source
const (
JobConfPath = "/forest/server/conf/"
)
View Source
const (
JobExecuteStatusCollectionPath = "/forest/client/execute/snapshot/"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateSerialNo ¶
func GenerateSerialNo() string
func GetLocalIpAddress ¶
func GetLocalIpAddress() (ip string)
func PackGroupConf ¶
func PackJobConf ¶
func PackJobExecuteSnapshot ¶
func PackJobExecuteSnapshot(snapshot *JobExecuteSnapshot) (value []byte, err error)
func PackJobSnapshot ¶
func PackJobSnapshot(snapshot *JobSnapshot) (value []byte, err error)
func TimeSubDays ¶
func ToDateString ¶
Types ¶
type ApiAuth ¶
type ApiAuth struct {
Auth func(*InputLogin) error
JWTKey string
}
type GroupConf ¶
func UnpackGroupConf ¶
type InputLogin ¶
type JobChangeEvent ¶
type JobClientDeleteEvent ¶
type JobCollection ¶
type JobCollection struct {
// contains filtered or unexported fields
}
func NewJobCollection ¶
func NewJobCollection(node *JobNode) (c *JobCollection)
type JobConf ¶
type JobConf struct {
Id string `json:"id"`
Name string `json:"name"`
Group string `json:"group"`
Cron string `json:"cron"`
Status int `json:"status"`
Target string `json:"target"`
Params string `json:"params"`
Mobile string `json:"mobile"`
Remark string `json:"remark"`
Version int `json:"version"`
}
JobConf job
func UnpackJobConf ¶
type JobExecuteSnapshot ¶
type JobExecuteSnapshot struct {
Id string `json:"id" xorm:"pk"`
JobId string `json:"jobId" xorm:"job_id"`
Name string `json:"name" xorm:"name"`
Ip string `json:"ip" xorm:"ip"`
Group string `json:"group" xorm:"group"`
Cron string `json:"cron" xorm:"cron"`
Target string `json:"target" xorm:"target"`
Params string `json:"params" xorm:"params"`
Mobile string `json:"mobile" xorm:"mobile"`
Remark string `json:"remark" xorm:"remark"`
CreateTime string `json:"createTime" xorm:"create_time"`
StartTime string `json:"startTime" xorm:"start_time"`
FinishTime string `json:"finishTime" xorm:"finish_time"`
Times int `json:"times" xorm:"times"`
Status int `json:"status" xorm:"status"`
Result string `json:"result" xorm:"result"`
}
func UnpackJobExecuteSnapshot ¶
func UnpackJobExecuteSnapshot(value []byte) (snapshot *JobExecuteSnapshot, err error)
type JobExecutor ¶
type JobExecutor struct {
// contains filtered or unexported fields
}
func NewJobExecutor ¶
func NewJobExecutor(node *JobNode) (exec *JobExecutor)
type JobGroupManager ¶
type JobGroupManager struct {
// contains filtered or unexported fields
}
func NewJobGroupManager ¶
func NewJobGroupManager(node *JobNode) (mgr *JobGroupManager)
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
func NewJobManager ¶
func NewJobManager(node *JobNode) (manager *JobManager)
func (*JobManager) AddJob ¶
func (manager *JobManager) AddJob(jobConf *JobConf) (err error)
AddJob add job conf
type JobNode ¶
type JobNode struct {
// contains filtered or unexported fields
}
JobNode job node
func NewJobNode ¶
func (*JobNode) StartAPIServer ¶ added in v0.1.9
func (node *JobNode) StartAPIServer(auth *ApiAuth, address string, opts ...engine.ConfigSetter)
StartAPIServer create a job http api and start service
type JobScheduler ¶
type JobScheduler struct {
// contains filtered or unexported fields
}
JobScheduler job scheduler
func NewJobScheduler ¶
func NewJobScheduler(node *JobNode) (sch *JobScheduler)
type JobSnapshot ¶
type JobSnapshot struct {
Id string `json:"id"`
JobId string `json:"jobId"`
Name string `json:"name"`
Ip string `json:"ip"`
Group string `json:"group"`
Cron string `json:"cron"`
Target string `json:"target"`
Params string `json:"params"`
Mobile string `json:"mobile"`
Remark string `json:"remark"`
CreateTime string `json:"createTime"`
}
func UnpackJobSnapshot ¶
func UnpackJobSnapshot(value []byte) (snapshot *JobSnapshot, err error)
type JobSnapshotFailOver ¶
type JobSnapshotFailOver struct {
// contains filtered or unexported fields
}
func NewJobSnapshotFailOver ¶
func NewJobSnapshotFailOver(node *JobNode) (f *JobSnapshotFailOver)
new job snapshot fail over
type ManualExecuteJobParam ¶
type ManualExecuteJobParam struct {
Id string `json:"id"`
Name string `json:"name"`
Group string `json:"group"`
}
ManualExecuteJobParam manual execute job
type NodeStateChangeListener ¶
type NodeStateChangeListener interface {
// contains filtered or unexported methods
}
NodeStateChangeListener node state change listener
type PageResult ¶
type QueryClientParam ¶
type QueryClientParam struct {
Group string `json:"group"`
}
type QuerySnapshotParam ¶
type SchedulePlan ¶
type SchedulePlan struct {
Id string `json:"id"`
Name string `json:"name"`
Group string `json:"group"`
Cron string `json:"cron"`
Status int `json:"status"`
Target string `json:"target"`
Params string `json:"params"`
Mobile string `json:"mobile"`
Remark string `json:"remark"`
NextTime time.Time `json:"nextTime"`
BeforeTime time.Time `json:"beforeTime"`
Version int `json:"version"`
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.









