Documentation ¶
Overview ¶
Package executors provides objects that gathers resource data from a host.
Index ¶
- func Register(name string, constructor func() IExecutor)
- type AgentLogPayload
- type AgentLoglinePayload
- type Base
- func (b *Base) GetPath() string
- func (b *Base) HighThresholdExceeded() bool
- func (b *Base) IsConditionMet() bool
- func (b *Base) LowThresholdExceeded() bool
- func (b *Base) NewHttpRequest(dataJson []byte) (*http.Request, error)
- func (b *Base) SetCounterDB(db *libmap.TSafeMapCounter)
- func (b *Base) SetHostData(hostData *host.Host)
- func (b *Base) SetInterval(interval string)
- func (b *Base) SetPath(path string)
- func (b *Base) SetQueryParser(readersJsonBytes map[string][]byte)
- func (b *Base) SetReadersDataInBytes(readersJsonBytes map[string][]byte)
- func (b *Base) SetResourcedMasterAccessToken(resourcedMasterAccessToken string)
- func (b *Base) SetResourcedMasterURL(resourcedMasterURL string)
- func (b *Base) SetTags(tags map[string]string)
- type DiskCleaner
- type HipChat
- type IExecutor
- type PagerDuty
- type Shell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentLogPayload ¶
type AgentLogPayload struct { Host struct { Name string Tags map[string]string } Data struct { Loglines []AgentLoglinePayload Filename string } }
type AgentLoglinePayload ¶
type Base ¶
type Base struct { // Command: Shell command to execute. Command string // Path: ResourceD URL path. Example: // /uptime -> http://localhost:55555/x/uptime Path string Interval string // LowThreshold: minimum count of valid conditions LowThreshold int64 // HighThreshold: maximum count of valid conditions HighThreshold int64 // Conditions for when executor should run. Conditions string // Host data Host *host.Host ResourcedMasterURL string ResourcedMasterAccessToken string ReadersDataBytes map[string][]byte // contains filtered or unexported fields }
func (*Base) HighThresholdExceeded ¶
func (*Base) IsConditionMet ¶
func (*Base) LowThresholdExceeded ¶
func (*Base) NewHttpRequest ¶
NewHttpRequest builds and returns http.Request struct.
func (*Base) SetCounterDB ¶
func (b *Base) SetCounterDB(db *libmap.TSafeMapCounter)
func (*Base) SetHostData ¶
func (*Base) SetInterval ¶
func (*Base) SetQueryParser ¶
func (*Base) SetReadersDataInBytes ¶
SetReadersDataInBytes pulls readers data and store them on ReadersData field.
func (*Base) SetResourcedMasterAccessToken ¶
func (*Base) SetResourcedMasterURL ¶
type DiskCleaner ¶
func (*DiskCleaner) Run ¶
func (dc *DiskCleaner) Run() error
Run shells out external program and store the output on c.Data.
func (*DiskCleaner) ToJson ¶
func (dc *DiskCleaner) ToJson() ([]byte, error)
ToJson serialize Data field to JSON. If there are no meaningful results, ToJson returns nil.
type HipChat ¶
type HipChat struct { Base Data map[string]interface{} AuthToken string RoomName string Message string }
type IExecutor ¶
type IExecutor interface { SetPath(string) GetPath() string SetInterval(string) SetResourcedMasterURL(string) SetResourcedMasterAccessToken(string) SetHostData(*host.Host) SetCounterDB(*libmap.TSafeMapCounter) Run() error ToJson() ([]byte, error) SetQueryParser(map[string][]byte) SetReadersDataInBytes(map[string][]byte) SetTags(map[string]string) IsConditionMet() bool LowThresholdExceeded() bool HighThresholdExceeded() bool }
IExecutor is generic interface for all executors.
func NewDiskCleaner ¶
func NewDiskCleaner() IExecutor
func NewGoStruct ¶
NewGoStruct instantiates IExecutor
func NewGoStructByConfig ¶
func NewGoStructByConfig(config resourced_config.Config) (IExecutor, error)
NewGoStructByConfig instantiates IExecutor given Config struct
func NewHipChat ¶
func NewHipChat() IExecutor
func NewPagerDuty ¶
func NewPagerDuty() IExecutor
type PagerDuty ¶
type PagerDuty struct { Base Data map[string]interface{} ServiceKey string Description string IncidentKey string }
Click to show internal directories.
Click to hide internal directories.