Documentation
¶
Index ¶
- Variables
- func JoinNamespace(ns []string) string
- type AvailablePlugin
- type CatalogedMetric
- type CatalogedPlugin
- type Label
- type Metric
- type Plugin
- type PluginCatalog
- type PluginType
- type RequestedMetric
- type RequestedPlugin
- func (p *RequestedPlugin) CheckSum() [sha256.Size]byte
- func (p *RequestedPlugin) Path() string
- func (p *RequestedPlugin) ReadSignatureFile(file string) error
- func (p *RequestedPlugin) SetPath(path string)
- func (p *RequestedPlugin) SetSignature(data []byte)
- func (p *RequestedPlugin) Signature() []byte
- type SubscribedPlugin
- type Task
- type TaskErrors
- type TaskOption
- type TaskState
- type TaskWatcherCloser
- type TaskWatcherHandler
- type Workflow
- type WorkflowState
Constants ¶
This section is empty.
Variables ¶
var ( TaskStateLookup = map[TaskState]string{ TaskDisabled: "Disabled", TaskStopped: "Stopped", TaskSpinning: "Running", TaskFiring: "Running", TaskEnded: "Ended", TaskStopping: "Stopping", } )
Functions ¶
func JoinNamespace ¶
Types ¶
type AvailablePlugin ¶
type CatalogedMetric ¶
type CatalogedMetric interface {
RequestedMetric
LastAdvertisedTime() time.Time
Policy() *cpolicy.ConfigPolicyNode
}
type CatalogedPlugin ¶
type CatalogedPlugin interface {
Plugin
IsSigned() bool
Status() string
PluginPath() string
LoadedTimestamp() *time.Time
}
the public interface for a plugin this should be the contract for how mgmt modules know a plugin
type Metric ¶
type Metric interface {
RequestedMetric
Config() *cdata.ConfigDataNode
LastAdvertisedTime() time.Time
Data() interface{}
Source() string
Labels() []Label
Tags() map[string]string
Timestamp() time.Time
}
Metric represents a snap metric collected or to be collected
type PluginCatalog ¶
type PluginCatalog []CatalogedPlugin
the collection of cataloged plugins used by mgmt modules
type PluginType ¶
type PluginType int
const ( // List of plugin type CollectorPluginType PluginType = iota ProcessorPluginType PublisherPluginType )
func ToPluginType ¶
func ToPluginType(name string) (PluginType, error)
func (PluginType) String ¶
func (pt PluginType) String() string
type RequestedMetric ¶
RequestedMetric is a metric requested for collection
type RequestedPlugin ¶
type RequestedPlugin struct {
// contains filtered or unexported fields
}
func NewRequestedPlugin ¶
func NewRequestedPlugin(path string) (*RequestedPlugin, error)
func (*RequestedPlugin) Path ¶
func (p *RequestedPlugin) Path() string
func (*RequestedPlugin) ReadSignatureFile ¶
func (p *RequestedPlugin) ReadSignatureFile(file string) error
func (*RequestedPlugin) SetPath ¶
func (p *RequestedPlugin) SetPath(path string)
func (*RequestedPlugin) SetSignature ¶
func (p *RequestedPlugin) SetSignature(data []byte)
func (*RequestedPlugin) Signature ¶
func (p *RequestedPlugin) Signature() []byte
type SubscribedPlugin ¶
type SubscribedPlugin interface {
Plugin
Config() *cdata.ConfigDataNode
}
type Task ¶
type Task interface {
ID() string
// Status() WorkflowState TODO, switch to string
State() TaskState
HitCount() uint
GetName() string
SetName(string)
SetID(string)
MissedCount() uint
FailedCount() uint
LastFailureMessage() string
LastRunTime() *time.Time
CreationTime() *time.Time
DeadlineDuration() time.Duration
SetDeadlineDuration(time.Duration)
SetTaskID(id string)
SetStopOnFailure(uint)
GetStopOnFailure() uint
Option(...TaskOption) TaskOption
WMap() *wmap.WorkflowMap
Schedule() schedule.Schedule
}
type TaskErrors ¶
type TaskOption ¶
type TaskOption func(Task) TaskOption
func OptionStopOnFailure ¶
func OptionStopOnFailure(v uint) TaskOption
TaskStopOnFailure sets the tasks stopOnFailure The stopOnFailure is the number of consecutive task failures that will trigger disabling the task
func SetTaskID ¶
func SetTaskID(id string) TaskOption
func SetTaskName ¶
func SetTaskName(name string) TaskOption
SetTaskName sets the name of the task. This is optional. If task name is not set, the task name is then defaulted to "Task-<task-id>"
func TaskDeadlineDuration ¶
func TaskDeadlineDuration(v time.Duration) TaskOption
TaskDeadlineDuration sets the tasks deadline. The deadline is the amount of time that can pass before a worker begins processing the tasks collect job.
type TaskWatcherCloser ¶
type TaskWatcherCloser interface {
Close() error
}
type TaskWatcherHandler ¶
type Workflow ¶
type Workflow interface {
Marshal() ([]byte, error)
Unmarshal([]byte) error
State() WorkflowState
}
type WorkflowState ¶
type WorkflowState int
const ( WorkflowStopped WorkflowState = iota WorkflowStarted )