Documentation ¶
Index ¶
- func NewAlert(atype protocol.Alert_Type, what protocol.Alert_What, ...) *protocol.Alert
- func NewErrorAlert(what protocol.Alert_What, data interface{}) *protocol.Alert
- func NewReply(rID uint64, replyCode protocol.NotificationReplyCode, data string) *protocol.NotificationReply
- func NewWarningAlert(what protocol.Alert_What, data interface{}) *protocol.Alert
- type Client
- func (c *Client) Ask(con *conman.Connection) *rule.Rule
- func (c *Client) Close()
- func (c *Client) Connect()
- func (c *Client) Connected() bool
- func (c *Client) DefaultAction() rule.Action
- func (c *Client) DefaultDuration() rule.Duration
- func (c *Client) GetFirewallType() string
- func (c *Client) GetIsAsking() bool
- func (c *Client) InterceptUnknown() bool
- func (c *Client) PostAlert(atype protocol.Alert_Type, awhat protocol.Alert_What, ...)
- func (c *Client) ProcMonitorMethod() string
- func (c *Client) SendErrorAlert(data interface{})
- func (c *Client) SendInfoAlert(data interface{})
- func (c *Client) SendWarningAlert(data interface{})
- func (c *Client) SetIsAsking(flag bool)
- func (c *Client) Subscribe()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAlert ¶
func NewAlert(atype protocol.Alert_Type, what protocol.Alert_What, action protocol.Alert_Action, prio protocol.Alert_Priority, data interface{}) *protocol.Alert
NewAlert builts a new generic alert
func NewErrorAlert ¶
func NewErrorAlert(what protocol.Alert_What, data interface{}) *protocol.Alert
NewErrorAlert builts a new error alert
func NewReply ¶
func NewReply(rID uint64, replyCode protocol.NotificationReplyCode, data string) *protocol.NotificationReply
NewReply constructs a new protocol notification reply
func NewWarningAlert ¶
func NewWarningAlert(what protocol.Alert_What, data interface{}) *protocol.Alert
NewWarningAlert builts a new warning alert
Types ¶
type Client ¶
Client holds the connection information of a client.
func NewClient ¶
func NewClient(socketPath, localConfigFile string, stats *statistics.Statistics, rules *rule.Loader, loggers *loggers.LoggerManager) *Client
NewClient creates and configures a new client.
func (*Client) Ask ¶
func (c *Client) Ask(con *conman.Connection) *rule.Rule
Ask sends a request to the server, with the values of a connection to be allowed or denied.
func (*Client) Close ¶
func (c *Client) Close()
Close cancels the running tasks: pinging the server and (re)connection poller.
func (*Client) Connected ¶
Connected checks if the client has established a connection with the server.
func (*Client) DefaultAction ¶
DefaultAction returns the default configured action for
func (*Client) DefaultDuration ¶
DefaultDuration returns the default duration configured for a rule. For example it can be: once, always, "until restart".
func (*Client) GetFirewallType ¶
GetFirewallType returns the firewall to use
func (*Client) GetIsAsking ¶
GetIsAsking returns the isAsking flag
func (*Client) PostAlert ¶
func (c *Client) PostAlert(atype protocol.Alert_Type, awhat protocol.Alert_What, action protocol.Alert_Action, prio protocol.Alert_Priority, data interface{})
PostAlert queues a new message to be delivered to the server
func (*Client) ProcMonitorMethod ¶
ProcMonitorMethod returns the monitor method configured. If it's not present in the config file, it'll return an empty string.
func (*Client) SendErrorAlert ¶
func (c *Client) SendErrorAlert(data interface{})
SendErrorAlert sends an error alert
func (*Client) SendInfoAlert ¶
func (c *Client) SendInfoAlert(data interface{})
SendInfoAlert sends an info alert
func (*Client) SendWarningAlert ¶
func (c *Client) SendWarningAlert(data interface{})
SendWarningAlert sends an warning alert
func (*Client) SetIsAsking ¶
SetIsAsking sets the isAsking flag