Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) AddNewNode(ctx context.Context, nodeConf *protocol.ClientConfig)
- func (c *Client) AddNewRule(rule *protocol.Rule)
- func (c *Client) AskRule(con *protocol.Connection) chan *protocol.Rule
- func (c *Client) GetLastStats() *protocol.Statistics
- func (c *Client) OpenChannelWithNode(notificationsStream protocol.UI_NotificationsServer)
- func (c *Client) UpdateStats(ctx context.Context, stats *protocol.Statistics)
- func (c *Client) WaitForNodes()
- func (c *Client) WaitForRules() chan *protocol.Connection
Constants ¶
const ( ActionAllow = "allow" ActionDeny = "deny" RuleSimple = "simple" RuleList = "list" RuleRegexp = "regexp" RuleOnce = "once" Rule15s = "15s" Rule30s = "30s" Rule5m = "5m" Rule1h = "1h" RuleRestart = "until restart" RuleAlways = "always" FilterByPath = "process.path" FilterByCommand = "process.command" FilterByUserID = "user.id" FilterByDstIP = "dest.ip" FilterByDstPort = "dest.port" FilterByDstHost = "dest.host" )
rules related constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client struct groups the API functionality to communicate with the nodes
func (*Client) AddNewNode ¶
func (c *Client) AddNewNode(ctx context.Context, nodeConf *protocol.ClientConfig)
AddNewNode adds a new node to the list of connected nodes.
func (*Client) AddNewRule ¶
AddNewRule sends a new rule to the node.
func (*Client) AskRule ¶
func (c *Client) AskRule(con *protocol.Connection) chan *protocol.Rule
AskRule sends the connection details through a channel. A client must consume data on that channel, and send the response via the rulesOutChan channel.
func (*Client) GetLastStats ¶
func (c *Client) GetLastStats() *protocol.Statistics
GetLastStats returns latest stasts from a node.
func (*Client) OpenChannelWithNode ¶
func (c *Client) OpenChannelWithNode(notificationsStream protocol.UI_NotificationsServer)
OpenChannelWithNode updates the node with the streaming channel. This channel is used to send notifications to the nodes (change debug level, stop/start interception, etc).
func (*Client) UpdateStats ¶
func (c *Client) UpdateStats(ctx context.Context, stats *protocol.Statistics)
UpdateStats save latest stats received from a node.
func (*Client) WaitForNodes ¶
func (c *Client) WaitForNodes()
FIXME: remove when nodes implementation is done
func (*Client) WaitForRules ¶
func (c *Client) WaitForRules() chan *protocol.Connection
WaitForRules returns the channel where we listen for new outgoing connections.