monitors

package
v5.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIPSettings = IPSettings{
	IPv4: true,
	IPv6: true,
	Mode: PingAny,
}
View Source
var Registry = newRegistrar()

Functions

func ActivePlugin

func ActivePlugin(name string, b ActiveBuilder) map[string][]interface{}

func MakePingAllIPFactory

func MakePingAllIPFactory(
	fields common.MapStr,
	f func(*net.IPAddr) []func() (common.MapStr, error),
) func(*net.IPAddr) TaskRunner

func MakePingAllIPPortFactory

func MakePingAllIPPortFactory(
	fields common.MapStr,
	ports []uint16,
	f func(*net.IPAddr, uint16) (common.MapStr, error),
) func(*net.IPAddr) TaskRunner

func MakePingIPFactory

func MakePingIPFactory(
	fields common.MapStr,
	f func(*net.IPAddr) (common.MapStr, error),
) func(*net.IPAddr) TaskRunner

func RegisterActive

func RegisterActive(name string, builder ActiveBuilder)

Types

type ActiveBuilder

type ActiveBuilder func(Info, *common.Config) ([]Job, error)

type Factory

type Factory func(*common.Config) ([]Job, error)

type IPSettings

type IPSettings struct {
	IPv4 bool     `config:"ipv4"`
	IPv6 bool     `config:"ipv6"`
	Mode PingMode `config:"mode"`
}

func (IPSettings) Network

func (s IPSettings) Network() string

type Info

type Info struct {
	Name string
	Type Type
}

type Job

type Job interface {
	Name() string
	TaskRunner
}

func MakeByHostJob

func MakeByHostJob(
	name, typ string,
	host string,
	settings IPSettings,
	pingFactory func(ip *net.IPAddr) TaskRunner,
) (Job, error)

func MakeByIPJob

func MakeByIPJob(
	name, typ string,
	ip net.IP,
	pingFactory func(ip *net.IPAddr) TaskRunner,
) (Job, error)

func MakeJob

func MakeJob(name, typ string, f func() (common.MapStr, []TaskRunner, error)) Job

func MakeSimpleJob

func MakeSimpleJob(name, typ string, f func() (common.MapStr, error)) Job

type PingMode

type PingMode uint8
const (
	PingModeUndefined PingMode = iota
	PingAny
	PingAll
)

func (*PingMode) Unpack

func (p *PingMode) Unpack(s string) error

type Registrar

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

func (*Registrar) AddActive

func (r *Registrar) AddActive(name string, builder ActiveBuilder) error

func (*Registrar) GetFactory

func (r *Registrar) GetFactory(name string) Factory

func (*Registrar) Query

func (r *Registrar) Query(name string) (Info, bool)

func (*Registrar) Register

func (r *Registrar) Register(name string, t Type, builder ActiveBuilder) error

func (*Registrar) String

func (r *Registrar) String() string

type TaskRunner

type TaskRunner interface {
	Run() (common.MapStr, []TaskRunner, error)
}

func MakeCont

func MakeCont(f func() (common.MapStr, []TaskRunner, error)) TaskRunner

func MakeSimpleCont

func MakeSimpleCont(f func() (common.MapStr, error)) TaskRunner

func WithDuration

func WithDuration(name string, r TaskRunner) TaskRunner

func WithFields

func WithFields(fields common.MapStr, r TaskRunner) TaskRunner

type Type

type Type uint8
const (
	ActiveMonitor Type = iota + 1
	PassiveMonitor
)

func (Type) String

func (t Type) String() string

Directories

Path Synopsis
active

Jump to

Keyboard shortcuts

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