Documentation ¶
Index ¶
- func NewReply(rID uint64, replyCode protocol.NotificationReplyCode, data string) *protocol.NotificationReply
- type Client
- func (c *Client) Ask(con *conman.Connection) (*rule.Rule, bool)
- func (c *Client) Close()
- func (c *Client) Connected() bool
- func (c *Client) DefaultAction() rule.Action
- func (c *Client) DefaultDuration() rule.Duration
- func (c *Client) InterceptUnknown() bool
- func (c *Client) ProcMonitorMethod() string
- func (c *Client) Subscribe()
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReply ¶
func NewReply(rID uint64, replyCode protocol.NotificationReplyCode, data string) *protocol.NotificationReply
NewReply constructs a new protocol notification reply
Types ¶
type Client ¶
Client holds the connection information of a client.
func NewClient ¶
func NewClient(socketPath string, stats *statistics.Statistics, rules *rule.Loader) *Client
NewClient creates and configures a new client.
func (*Client) Ask ¶
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) ProcMonitorMethod ¶
ProcMonitorMethod returns the monitor method configured. If it's not present in the config file, it'll return an emptry string.
type Config ¶
type Config struct { sync.RWMutex Server serverConfig `json:"Server"` DefaultAction string `json:"DefaultAction"` DefaultDuration string `json:"DefaultDuration"` InterceptUnknown bool `json:"InterceptUnknown"` ProcMonitorMethod string `json:"ProcMonitorMethod"` LogLevel *uint32 `json:"LogLevel"` }
Config holds the values loaded from configFile