Documentation ¶
Index ¶
- Variables
- func BuildBlackList(param ...string) (bl map[string]struct{})
- func Close()
- func Hash(v []byte) (h string)
- func Init(path string)
- func WrapCtxSend(ctx context.Context, evtChan chan<- []byte, event []byte) (ok bool)
- type Blacklist
- type Collector
- type Context
- func (c *Context) Context() context.Context
- func (c *Context) CurrentRunTime() time.Time
- func (c *Context) Delete(key []byte) (err error)
- func (c *Context) DeleteTree(prefix []byte) (err error)
- func (c *Context) Get(key []byte) (value []byte, err error)
- func (c *Context) GetTree(prefix []byte) (entries []storage.Entry, err error)
- func (c *Context) LastRunTime() time.Time
- func (c *Context) LogDebug(message string, keysAndValues ...interface{})
- func (c *Context) LogError(message string, keysAndValues ...interface{})
- func (c *Context) LogInfo(message string, keysAndValues ...interface{})
- func (c *Context) LogWarn(message string, keysAndValues ...interface{})
- func (c *Context) Name() string
- func (c *Context) Node() *Node
- func (c *Context) Set(key, value []byte) (err error)
- func (c *Context) SetWithTTL(key, value []byte, ttl time.Duration) (err error)
- func (c *Context) Timeout() time.Duration
- type DeltaOps
- type EventOps
- type GetDataFn
- type Join
- type Node
- type PostEventOpsFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Registry default collector registry Registry *registry // Store default persistence store Store storage.Store )
Functions ¶
func BuildBlackList ¶
BuildBlackList function
Types ¶
type Collector ¶
type Collector struct { Name string GetData GetDataFn EventOps *EventOps Joins []*Join PostOps PostEventOpsFn }
Collector implements the base collector and main routines
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context for running collectors and childrens wraps a context.Context for cancelation
func NewContext ¶
func NewContext(ctx context.Context, name string, node *Node, store storage.Store, ttl time.Duration) (c *Context, err error)
NewContext creates a new session
func (*Context) CurrentRunTime ¶
CurrentRunTime returns the last time this session successfully ran
func (*Context) DeleteTree ¶
DeleteTree for the given prefix
func (*Context) LastRunTime ¶
LastRunTime returns the last time this session successfully ran
func (*Context) SetWithTTL ¶
SetWithTTL value for the given key
type DeltaOps ¶
type DeltaOps struct { KeyField string // Field to use as unique key Rate bool // Wetheter or not to do rate calculations over time delta TTL time.Duration // TTL of cached data Blacklist Blacklist // Fields to ignore in delta, can be nil RateBlacklist Blacklist // Fields to exclude from rate calculations, can be nil }
DeltaOps type
type EventOps ¶
type EventOps struct { Round int // The precision for float fields FieldTypes []*rexon.Value // The Fields:Type for conversion FieldRenames map[string]string // The Fields:Name for renaming Delta *DeltaOps }
EventOps type
type Join ¶
type Join struct { Name string // Collector name eg. `/aix/config/lvm` TTL time.Duration // TTL when using cache JoinFields []string // Field names for possible matches to join, it will successfully return on first match JoinOnFields []string // Field name from the events of called Collector to join on IncludeFields []string // Fields to include from the events of called collector }
Join type
type Node ¶
type Node struct { HostName string `json:"hostname,omitempty"` NetAddr string `json:"netaddr,omitempty"` Type string `json:"type,omitempty"` SSHPort string `json:"ssh_port,omitempty"` SSHUser string `json:"ssh_user,omitempty"` SSHPassword string `json:"ssh_password,omitempty"` SSHKey []byte `json:"ssh_key,omitempty"` APIURL string `json:"api_url,omitempty"` APIUser string `json:"api_user,omitempty"` APIPassword string `json:"api_password,omitempty"` DBUser string `json:"db_user,omitempty"` DBPassword string `json:"db_password,omitempty"` DBPort string `json:"db_port,omitempty"` LogFiles map[string]string `json:"files,omitempty"` }
Node holds configuration for the given session
type PostEventOpsFn ¶
PostEventOpsFn to post process events
Source Files ¶
Click to show internal directories.
Click to hide internal directories.