Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FILE_UUID = "/etc/.mole.uuid"
)
View Source
var (
HEADER = []byte("MOLE")
)
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) NewListener ¶
func (*Agent) ServeProtocol ¶
type AgentListener ¶
type AgentListener struct { sync.RWMutex // protect flag closed // contains filtered or unexported fields }
func (*AgentListener) Accept ¶
func (l *AgentListener) Accept() (net.Conn, error)
implement net.Listener interface the caller could process the cached worker connection in the pool via `AgentListener`
func (*AgentListener) Addr ¶
func (l *AgentListener) Addr() net.Addr
func (*AgentListener) Close ¶
func (l *AgentListener) Close() error
func (*AgentListener) HandleWorkerConn ¶
func (l *AgentListener) HandleWorkerConn(conn net.Conn) error
implement ConnHandler interface put the worker connection to the pool
type ClusterAgent ¶
type ClusterAgent struct {
// contains filtered or unexported fields
}
ClusterAgent is a runtime agent object within master lifttime
func (*ClusterAgent) Client ¶
func (ca *ClusterAgent) Client() *http.Client
Client obtain a http client for an agent with customized dialer
func (*ClusterAgent) Dial ¶
func (ca *ClusterAgent) Dial(network, addr string) (net.Conn, error)
Dial specifies the dial function for creating unencrypted TCP connections within the http.Client
func (*ClusterAgent) ID ¶
func (ca *ClusterAgent) ID() string
type ConnHandler ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
NewDecoder returns a new protocol decoder that reads from r.
type Master ¶
func (*Master) Agent ¶
func (m *Master) Agent(id string) *ClusterAgent
the caller should check the returned ClusterAgent is not nil otherwise the agent hasn't connected to the cluster
func (*Master) Agents ¶
func (m *Master) Agents() map[string]*ClusterAgent
func (*Master) CloseAgent ¶
func (*Master) CloseAllAgents ¶
func (m *Master) CloseAllAgents()
func (*Master) FreshAgent ¶
Click to show internal directories.
Click to hide internal directories.