core

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core represents our core data structure through which the ui can interact with the backend

func CreateNewAppCore added in v1.0.0

func CreateNewAppCore(networkInfo network.Network) (*Core, error)

CreateNewAppCore creates and returns a new instance of *core.Core

func New

func New(
	networkInfo network.Network,
	conf *config.Config,
	configService config.Service,
	discovery discovery.Service,
	discoveryEvtChan chan *event.Event,
) *Core

New returns new core module for given configuration

func (*Core) Conf

func (c *Core) Conf() config.Config

Conf return the currently loaded configuration

func (*Core) CreateConfig

func (c *Core) CreateConfig(conf config.Config) error

CreateConfig creates a new config

func (*Core) DeleteConfig

func (c *Core) DeleteConfig(id string) error

DeleteConfig deletes a configuration

func (*Core) GetConfigs

func (c *Core) GetConfigs() ([]*config.Config, error)

GetConfigs returns all stored configs

func (*Core) Monitor

func (c *Core) Monitor() error

Monitor starts the processes for monitoring and tracking devices on the configured network

func (*Core) NetworkInfo added in v1.0.0

func (c *Core) NetworkInfo() network.Network

func (*Core) RegisterEventListener

func (c *Core) RegisterEventListener(channel chan *event.Event) int

RegisterEventListener registers a channel as a listener for events

func (*Core) RemoveEventListener

func (c *Core) RemoveEventListener(id int)

RemoveEventListener removes and closes a channel previously registered as a listener

func (*Core) SetConfig

func (c *Core) SetConfig(id string) error

SetConfig sets the current active configuration

func (*Core) StartDaemon

func (c *Core) StartDaemon(errorReporter chan error)

StartDaemon starts the network monitoring processes in a goroutine

func (*Core) Stop

func (c *Core) Stop() error

Stop stops all processes managed by Core The core will be useless after calling stop, a new one must be instantiated to continue.

func (*Core) UpdateConfig

func (c *Core) UpdateConfig(conf config.Config) error

UpdateConfig updates an existing config

type EventListener

type EventListener struct {
	// contains filtered or unexported fields
}

EventListener represents a registered listener for events

Jump to

Keyboard shortcuts

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