ui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

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

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

Client holds the connection information of a client.

func NewClient

func NewClient(path string, stats *statistics.Statistics, rules *rule.Loader) *Client

NewClient creates and configures a new client.

func (*Client) Ask

func (c *Client) Ask(con *conman.Connection) (*rule.Rule, bool)

Ask sends a request to the server, with the values of a connection to be allowed or denied.

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

func (c *Client) InterceptUnknown() bool

InterceptUnknown returns

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 emptry string.

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.

type Config

type Config struct {
	sync.RWMutex
	DefaultAction     string
	DefaultDuration   string
	InterceptUnknown  bool
	ProcMonitorMethod string
	LogLevel          *uint32
}

Config holds the values loaded from configFile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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