Documentation ¶
Index ¶
- Constants
- func GenerateSerialNo() string
- func GetLocalIpAddress() (ip string)
- func ParkGroupConf(groupConf *GroupConf) (value []byte, err error)
- func ParkJobConf(jobConf *JobConf) (value []byte, err error)
- func ParkJobExecuteSnapshot(snapshot *JobExecuteSnapshot) (value []byte, err error)
- func ParkJobSnapshot(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 Client
- type Etcd
- func (etcd *Etcd) Delete(key string) (err error)
- func (etcd *Etcd) DeleteWithPrefixKey(prefixKey string) (err error)
- func (etcd *Etcd) Get(key string) (value []byte, err error)
- func (etcd *Etcd) GetWithPrefixKey(prefixKey string) (keys [][]byte, values [][]byte, err error)
- func (etcd *Etcd) GetWithPrefixKeyLimit(prefixKey string, limit int64) (keys [][]byte, values [][]byte, err error)
- func (etcd *Etcd) Put(key, value string) (err error)
- func (etcd *Etcd) PutNotExist(key, value string) (success bool, oldValue []byte, err error)
- func (etcd *Etcd) TxKeepaliveWithTTL(key, value string, ttl int64) (txResponse *TxResponse, err error)
- func (etcd *Etcd) TxWithTTL(key, value string, ttl int64) (txResponse *TxResponse, err error)
- func (etcd *Etcd) Update(key, value, oldValue string) (success bool, err error)
- func (etcd *Etcd) Watch(key string) (keyChangeEventResponse *WatchKeyChangeResponse)
- func (etcd *Etcd) WatchWithPrefixKey(prefixKey string) (keyChangeEventResponse *WatchKeyChangeResponse)
- type Group
- type GroupConf
- 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 KeyChangeEvent
- type ManualExecuteJobParam
- type Node
- type NodeStateChangeListener
- type PageResult
- type QueryClientParam
- type QueryExecuteSnapshotParam
- type QuerySnapshotParam
- type Result
- type SchedulePlan
- type TxResponse
- type WatchKeyChangeResponse
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 ( KeyCreateChangeEvent = iota KeyUpdateChangeEvent KeyDeleteChangeEvent )
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 ParkGroupConf ¶
func ParkJobConf ¶
func ParkJobExecuteSnapshot ¶
func ParkJobExecuteSnapshot(snapshot *JobExecuteSnapshot) (value []byte, err error)
func ParkJobSnapshot ¶
func ParkJobSnapshot(snapshot *JobSnapshot) (value []byte, err error)
func TimeSubDays ¶
func ToDateString ¶
Types ¶
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
func (*Etcd) DeleteWithPrefixKey ¶
delete the keys with prefix key
func (*Etcd) GetWithPrefixKey ¶
get values from prefixKey
func (*Etcd) GetWithPrefixKeyLimit ¶
func (etcd *Etcd) GetWithPrefixKeyLimit(prefixKey string, limit int64) (keys [][]byte, values [][]byte, err error)
get values from prefixKey limit
func (*Etcd) PutNotExist ¶
put a key not exist
func (*Etcd) TxKeepaliveWithTTL ¶
func (etcd *Etcd) TxKeepaliveWithTTL(key, value string, ttl int64) (txResponse *TxResponse, err error)
func (*Etcd) TxWithTTL ¶
func (etcd *Etcd) TxWithTTL(key, value string, ttl int64) (txResponse *TxResponse, err error)
func (*Etcd) Watch ¶
func (etcd *Etcd) Watch(key string) (keyChangeEventResponse *WatchKeyChangeResponse)
watch a key
func (*Etcd) WatchWithPrefixKey ¶
func (etcd *Etcd) WatchWithPrefixKey(prefixKey string) (keyChangeEventResponse *WatchKeyChangeResponse)
watch with prefix key
type GroupConf ¶
func UParkGroupConf ¶
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"` }
job
func UParkJobConf ¶
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 UParkJobExecuteSnapshot ¶
func UParkJobExecuteSnapshot(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)
add job conf
type JobNode ¶
type JobNode struct {
// contains filtered or unexported fields
}
job node
func NewJobNode ¶
type JobScheduler ¶
type JobScheduler struct {
// contains filtered or unexported fields
}
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 UParkJobSnapshot ¶
func UParkJobSnapshot(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"` }
manual execute job
type NodeStateChangeListener ¶
type NodeStateChangeListener interface {
// contains filtered or unexported methods
}
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 }
type TxResponse ¶
type WatchKeyChangeResponse ¶
type WatchKeyChangeResponse struct { Event chan *KeyChangeEvent CancelFunc context.CancelFunc Watcher clientv3.Watcher }
监听key 变化响应
Source Files ¶
Click to show internal directories.
Click to hide internal directories.