Documentation ¶
Index ¶
- type Command
- type Config
- type Connection
- func (c *Connection) GetAgentDetail() map[string]interface{}
- func (c *Connection) GetPluginDetail(name string) map[string]interface{}
- func (c *Connection) GetPluginsList() []map[string]interface{}
- func (c *Connection) SetAgentDetail(detail map[string]interface{})
- func (c *Connection) SetPluginDetail(name string, detail map[string]interface{})
- type GRPCPool
- func (g *GRPCPool) Add(agentID string, conn *Connection) error
- func (g *GRPCPool) Close(agentID string) (err error)
- func (g *GRPCPool) Delete(agentID string)
- func (g *GRPCPool) GetByID(agentID string) (*Connection, error)
- func (g *GRPCPool) GetCount() int
- func (g *GRPCPool) GetExtraInfoByID(agentID string) *client.AgentExtraInfo
- func (g *GRPCPool) GetList() []*Connection
- func (g *GRPCPool) LoadToken() bool
- func (g *GRPCPool) PostCommand(agentID string, command *pb.Command) (err error)
- func (g *GRPCPool) PostLatestConfig(agentID string) error
- func (g *GRPCPool) PushTask2Manager(task map[string]string) error
- func (g *GRPCPool) ReleaseToken()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Connection ¶
type Connection struct { Ctx context.Context `json:"-"` CancelFuc context.CancelFunc `json:"-"` //use to post commands to the agent, if the *Command is nil, close the connection. //otherwise, send the command to the agent. CommandChan chan *Command `json:"-"` AgentID string `json:"agent_id"` SourceAddr string `json:"addr"` CreateAt int64 `json:"create_at"` // contains filtered or unexported fields }
Connection Info
func (*Connection) GetAgentDetail ¶
func (c *Connection) GetAgentDetail() map[string]interface{}
func (*Connection) GetPluginDetail ¶
func (c *Connection) GetPluginDetail(name string) map[string]interface{}
func (*Connection) GetPluginsList ¶
func (c *Connection) GetPluginsList() []map[string]interface{}
func (*Connection) SetAgentDetail ¶
func (c *Connection) SetAgentDetail(detail map[string]interface{})
func (*Connection) SetPluginDetail ¶
func (c *Connection) SetPluginDetail(name string, detail map[string]interface{})
type GRPCPool ¶
type GRPCPool struct {
// contains filtered or unexported fields
}
func NewGRPCPool ¶
NewGRPCPool create a new GRPCPool. -- maxConnTokenCount: Maximum number of concurrent connections
func (*GRPCPool) Add ¶
func (g *GRPCPool) Add(agentID string, conn *Connection) error
return error if AgentID conflict.
func (*GRPCPool) GetByID ¶
func (g *GRPCPool) GetByID(agentID string) (*Connection, error)
GetByAgentID
func (*GRPCPool) GetExtraInfoByID ¶
func (g *GRPCPool) GetExtraInfoByID(agentID string) *client.AgentExtraInfo
func (*GRPCPool) LoadToken ¶
LoadToken
Returns true when the current total number of connection < the length of the pool.
func (*GRPCPool) PostCommand ¶
PostCommand Post command to agent
func (*GRPCPool) PostLatestConfig ¶
Post the latest configuration to agent
func (*GRPCPool) PushTask2Manager ¶
PushTask2Manager push task to the remote end for reconciliation asynchronously.
func (*GRPCPool) ReleaseToken ¶
func (g *GRPCPool) ReleaseToken()
ReleaseToken release the connection token to the pool; must be called after the conn is closed.
Click to show internal directories.
Click to hide internal directories.