policy

package
v0.0.0-...-6865f78 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2015 License: BSD-3-Clause Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler(policyType string, handlerFunc HandlerFunc) error

Types

type Config

type Config []Policy

Config is a slice of monitoring policies

type Event

type Event struct {
	Time       time.Time
	PolicyName string      `bson:"policy_name"`
	AgentUID   string      `bson:"agent_uid"`
	Data       interface{} // Data may include status, stats, etc.
}

Event data that will be sent by policy handlers

type HandlerFunc

type HandlerFunc func(context.Context, Policy) (<-chan Event, error)

HandlerFunc is the type of a policy handler function. Any policy handler function must be of this type.

type Policy

type Policy struct {
	Name     string            // Name of the monitoring policy
	AgentUID string            // Agent UID
	Type     string            // Type denotes the monitoring policy type. e.g. "tcp"
	M        map[string]string // M is the map containing the rules of a particular monitoring policy.
}

Policy represents a monitoring policy

func (Policy) Execute

func (p Policy) Execute(ctx context.Context) (<-chan Event, error)

func (Policy) Valid

func (p Policy) Valid() error

Valid checks whether the policy is valid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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