ui

package
v0.0.0-...-2ec37ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

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

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) Connect

func (c *Client) Connect()

Connect starts the connection poller

func (*Client) Connected

func (c *Client) Connected() bool

Connected checks if the client has established a connection with the server.

func (*Client) DefaultAction

func (c *Client) DefaultAction() rule.Action

DefaultAction returns the default configured action for

func (*Client) DefaultDuration

func (c *Client) DefaultDuration() rule.Duration

DefaultDuration returns the default duration configured for a rule. For example it can be: once, always, "until restart".

func (*Client) GetFirewallType

func (c *Client) GetFirewallType() string

GetFirewallType returns the firewall to use

func (*Client) GetIsAsking

func (c *Client) GetIsAsking() bool

GetIsAsking returns the isAsking flag

func (*Client) InterceptUnknown

func (c *Client) InterceptUnknown() bool

InterceptUnknown returns

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

func (c *Client) ProcMonitorMethod() string

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

func (c *Client) SetIsAsking(flag bool)

SetIsAsking sets the isAsking flag

func (*Client) Subscribe

func (c *Client) Subscribe()

Subscribe opens a connection with the server (UI), to start receiving notifications. It firstly sends the daemon status and configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL