modules

package
v0.0.0-...-891f3ce Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package modules defines commonly used modules for bgpmon. It also defines some example modules that developers could build off of.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDaemon

type BaseDaemon struct {
	*BaseTask
	// contains filtered or unexported fields
}

BaseDaemon is an example daemon module which can be usefully composed in other modules.

func NewBaseDaemon

func NewBaseDaemon(server core.BgpmondServer, logger util.Logger, name string) *BaseDaemon

NewBaseDaemon creates a base daemon with the server, logger and name.

func (*BaseDaemon) GetType

func (b *BaseDaemon) GetType() int

GetType satisfies the module interface.

func (*BaseDaemon) Run

func (b *BaseDaemon) Run(launchOpts map[string]string)

Run satisfies the module interface, and prints waits for the module to be closed.

func (*BaseDaemon) Stop

func (b *BaseDaemon) Stop() error

Stop satisfies the module interface. For a daemon module, this means cancelling the context and waiting for the Run function to complete.

type BaseTask

type BaseTask struct {
	core.Module
	// contains filtered or unexported fields
}

BaseTask is an example task module which can be usefully composed in other modules.

func NewBaseTask

func NewBaseTask(server core.BgpmondServer, logger util.Logger, name string) *BaseTask

NewBaseTask creates a base task with the server, logger and name.

func (*BaseTask) GetInfo

func (b *BaseTask) GetInfo() core.OpenModuleInfo

GetInfo satisfies the module interface.

func (*BaseTask) GetName

func (b *BaseTask) GetName() string

GetName satisfies the module interface.

func (*BaseTask) GetType

func (b *BaseTask) GetType() int

GetType satisfies the module interface.

func (*BaseTask) Run

func (b *BaseTask) Run(launchOpts map[string]string)

Run satisfies the module interface.

func (*BaseTask) Stop

func (b *BaseTask) Stop() error

Stop satisfies the module interface. A task is not stoppable.

Jump to

Keyboard shortcuts

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