daemon

package
v0.0.0-...-b9f6a0d Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Ui         cli.Ui
	ShutdownCh <-chan struct{}
	// contains filtered or unexported fields
}

Command ...

func (*Command) Help

func (c *Command) Help() string

Help ... @TODO update

func (*Command) Run

func (c *Command) Run(args []string) int

Run ...

func (*Command) Synopsis

func (c *Command) Synopsis() string

Synopsis ...

type Core

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

Core ...

func Create

func Create(conf *config.Config, coreConf *core.Config, logOutput io.Writer) (*Core, error)

Create ...

func (*Core) DeregisterEventHandler

func (a *Core) DeregisterEventHandler(eh EventHandler)

DeregisterEventHandler removes an EventHandler and prevents more invocations

func (*Core) EstimateCost

func (a *Core) EstimateCost() func()

EstimateCost ...

func (*Core) ID

func (a *Core) ID() string

ID returns the first 6 characters of base64 encoded public key to be used as agent ID

func (*Core) RegisterEventHandler

func (a *Core) RegisterEventHandler(eh EventHandler)

RegisterEventHandler adds an event handler to receive event notifications

func (*Core) Shutdown

func (a *Core) Shutdown() error

Shutdown ...

func (*Core) ShutdownCh

func (a *Core) ShutdownCh() <-chan struct{}

ShutdownCh ...

func (*Core) Start

func (a *Core) Start() error

Start makes the gossip agent listening to incomming connection and establish connection with bootstrap nodes in case it is not in dev mode it also starts background event handler and scheduler.

type EventFilter

type EventFilter struct {
	Event string
	Name  string
}

EventFilter ...

func ParseEventFilter

func ParseEventFilter(v string) []EventFilter

ParseEventFilter a string with the event type filters and parses it into a series of EventFilters if it can.

func (*EventFilter) Invoke

func (s *EventFilter) Invoke(e core.Event) bool

Invoke ...

func (*EventFilter) Valid

func (s *EventFilter) Valid() bool

Valid checks if this is a valid agent event script.

type EventHandler

type EventHandler interface {
	HandleEvent(core.Event)
}

EventHandler is a handler that does things when events happen.

Jump to

Keyboard shortcuts

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