Documentation ¶
Index ¶
- type Node
- func (n *Node) AddTaskRequest(message string) (string, error)
- func (n *Node) DelistRequest() (string, error)
- func (n *Node) KeepAliveRequest() (string, error)
- func (n *Node) LoadConfig(cfg *config.Config) error
- func (n *Node) Marshal() ([]byte, error)
- func (n *Node) RegisterRequest() (string, error)
- func (n *Node) RegisterResponse() (string, error)
- func (n *Node) RunHTTPServer()
- func (n *Node) RunTCPServer(masterCh chan Requset) error
- func (n *Node) SendRequest(requestType string, requestMessage string) error
- func (n *Node) String() string
- func (n *Node) UpdateRequest() (string, error)
- func (n *Node) UpdateTaskRequest(message string) (string, error)
- type Requset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { ID string `json:"id"` Name string `json:"name"` Role string `json:"role"` Debug bool `json:"debug"` Master serverConfig `json:"master"` Server serverConfig `json:"server"` Token tokenConfig `json:"token"` }
Node represents a genernal node info
func (*Node) DelistRequest ¶
func (*Node) KeepAliveRequest ¶
func (*Node) LoadConfig ¶
LoadConfig load node config to an existed node.
func (*Node) RegisterRequest ¶
func (*Node) RegisterResponse ¶
func (*Node) RunHTTPServer ¶
func (n *Node) RunHTTPServer()
func (*Node) RunTCPServer ¶
RunTCPServer runs a server to listen tcp request
func (*Node) SendRequest ¶
func (*Node) UpdateRequest ¶
Click to show internal directories.
Click to hide internal directories.