Documentation ¶
Index ¶
- func MasterForLoop(m *Master)
- func RegisterToCluster(m *Master)
- func SlaveForLoop(m *Master)
- type Master
- func (m *Master) AddNodeToCluster(n *node.Node) error
- func (m *Master) AddTaskToNode(t *PlanConfig) error
- func (m *Master) Marshal() ([]byte, error)
- func (m *Master) RemoveNodeFromCluster(n *node.Node) error
- func (m *Master) Run() error
- func (m *Master) RunAsMaster() error
- func (m *Master) RunAsMasterSlave(masterCh chan node.Requset) error
- func (m *Master) RunAsMasterStandby() error
- func (m *Master) RunAsSlaveMaster() error
- func (m *Master) String() string
- func (m *Master) UpdateTaskInfo(n *node.Node, t *slave.Task) error
- type PlanConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MasterForLoop ¶
func MasterForLoop(m *Master)
func RegisterToCluster ¶
func RegisterToCluster(m *Master)
func SlaveForLoop ¶
func SlaveForLoop(m *Master)
Types ¶
type Master ¶
type Master struct { Node *node.Node `json:"node"` Cluster []node.Node `json:"cluster"` Schedule []PlanConfig `json:"schedule"` Tasks []slave.Task `json:"tasks"` }
func (*Master) AddTaskToNode ¶
func (m *Master) AddTaskToNode(t *PlanConfig) error
func (*Master) RunAsMaster ¶
func (*Master) RunAsMasterSlave ¶
func (*Master) RunAsMasterStandby ¶
func (*Master) RunAsSlaveMaster ¶
type PlanConfig ¶
type PlanConfig struct { ID string `json:"id"` Name string `json:"name"` NodeID string `json:"node_id"` Interval int `json:"interval"` CreateAt time.Time `json:"create_at"` UpdateAt time.Time `json:"update_at"` Task slave.Task `json:"task"` Status string `json:"status"` }
func LoadPlanConfig ¶
func LoadPlanConfig(cfg *config.Config) ([]PlanConfig, error)
LoadPlanConfig load node config to an existed node.
func (*PlanConfig) Marshal ¶
func (p *PlanConfig) Marshal() ([]byte, error)
Marshal returns the JSON encoding of a node info.
func (*PlanConfig) String ¶
func (p *PlanConfig) String() string
Click to show internal directories.
Click to hide internal directories.