plugins

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandCollector

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

func (*CommandCollector) ExecuteTest

func (c *CommandCollector) ExecuteTest() (DataPointInterface, error)

func (*CommandCollector) GetName

func (c *CommandCollector) GetName() string

func (*CommandCollector) New

func (*CommandCollector) SetConfig

func (c *CommandCollector) SetConfig(m map[string]string) error

func (*CommandCollector) SetTimeout

func (c *CommandCollector) SetTimeout(duration time.Duration)

type DNSCollector

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

DNSCollector represents a single DNS Server that should be checked

func (*DNSCollector) ExecuteTest

func (d *DNSCollector) ExecuteTest() (DataPointInterface, error)

func (*DNSCollector) GetName

func (d *DNSCollector) GetName() string

func (*DNSCollector) New

func (d *DNSCollector) New() PluginInterface

func (*DNSCollector) SetConfig

func (d *DNSCollector) SetConfig(config map[string]string) error

SetConfig is used to set a config for this TestPlugin The config is a map of key/value pairs

func (*DNSCollector) SetTimeout

func (d *DNSCollector) SetTimeout(timeout time.Duration)

type DataPoint

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

DataPoint represents a single data point

func (DataPoint) GetDelay

func (p DataPoint) GetDelay() time.Duration

GetDelay returns the delay until the result was ready, return value undefined if result was false

func (DataPoint) GetResult

func (p DataPoint) GetResult() bool

GetResult returns the result of the test

type DataPointInterface

type DataPointInterface interface {
	GetDelay() time.Duration
	GetResult() bool
}

type PingCollector

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

PingCollector represents a single Server that should be checked

func (*PingCollector) ExecuteTest

func (p *PingCollector) ExecuteTest() (DataPointInterface, error)

func (*PingCollector) GetName

func (p *PingCollector) GetName() string

GetName returns the name of the collector

func (*PingCollector) New

func (p *PingCollector) New() PluginInterface

func (*PingCollector) SetConfig

func (p *PingCollector) SetConfig(config map[string]string) error

func (*PingCollector) SetTimeout

func (p *PingCollector) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout for the pinger

type PluginConfig

type PluginConfig map[string]string

type PluginInterface

type PluginInterface interface {
	SetConfig(map[string]string) error        // SetConfig is used to set a config for this TestPlugin
	GetName() string                          // Return a name for the thing that is tested by this TestPlugin
	ExecuteTest() (DataPointInterface, error) // Method is regularly called to collect a new DataPoint
	New() PluginInterface                     // Return a new instance of this TestPlugin
	SetTimeout(time.Duration)                 // SetTimeout is used to set/update a timeout for this TestPlugin on the run
}

PluginInterface provides an interface for a single data source (e.g. server) which should be regularly be tested

Jump to

Keyboard shortcuts

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