Documentation ¶
Index ¶
- Constants
- func Exec(suffix []string) (out string, err error)
- func GetHostName() (string, error)
- type Client
- type Hub
- type Node
- type NodeStatus
- type Return
- type Server
- func (s *Server) CompleteTask(ctx context.Context, req *proto.CompleteTaskRequest) (*proto.CompleteTaskReply, error)
- func (s *Server) CrontabUpdate()
- func (s *Server) NewTask(commands []string)
- func (s *Server) PullTask(ctx context.Context, req *proto.PullTaskRequest) (*proto.PullTaskReply, error)
- func (s *Server) Register(ctx context.Context, req *proto.RegisterRequest) (*proto.RegisterReply, error)
- type Task
Constants ¶
View Source
const ( ErrHostnameEmpty = "error: node's hostname is empty" ErrTaskIdNoExisted = "error: task_id was not existed" )
View Source
const CommandTimeout = 15
View Source
const CommandTimeoutEnv = "DATE_AGENT_CMD_TIMEOUT"
View Source
const DefaultEtcdUri = "127.0.0.1:2379"
Variables ¶
This section is empty.
Functions ¶
func GetHostName ¶
GetHostName : get the hostname of host machine
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DoneSignal ¶
func (c *Client) DoneSignal() <-chan struct{}
type Node ¶
type Node struct { Hostname string `json:"hostname"` Status NodeStatus `json:"status"` Time time.Time `json:"time"` }
type NodeStatus ¶
type NodeStatus int32
const ( NodeOnline NodeStatus = iota NodeOffline NodeStatus = 1 NodeRemoved NodeStatus = 2 )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CompleteTask ¶
func (s *Server) CompleteTask(ctx context.Context, req *proto.CompleteTaskRequest) (*proto.CompleteTaskReply, error)
func (*Server) CrontabUpdate ¶
func (s *Server) CrontabUpdate()
func (*Server) PullTask ¶
func (s *Server) PullTask(ctx context.Context, req *proto.PullTaskRequest) (*proto.PullTaskReply, error)
func (*Server) Register ¶
func (s *Server) Register(ctx context.Context, req *proto.RegisterRequest) (*proto.RegisterReply, error)
Click to show internal directories.
Click to hide internal directories.