Documentation ¶
Overview ¶
Package writers provides objects that can send colected resource data to external place.
Index ¶
- func Register(name string, constructor func() IWriter)
- type AgentResourcePayload
- type Base
- func (b *Base) GenerateData() error
- func (b *Base) GetData() interface{}
- func (b *Base) GetJsonProcessor() string
- func (b *Base) GetReadersData() map[string]interface{}
- func (b *Base) Run() error
- func (b *Base) SetConfigs(configs *resourced_config.Configs)
- func (b *Base) SetData(data interface{})
- func (b *Base) SetReadersData(readersData map[string]interface{})
- func (b *Base) SetReadersDataInBytes(readersJsonBytes map[string][]byte)
- func (b *Base) ToJson() ([]byte, error)
- func (b *Base) WatchDir(path string, callback func() error) error
- type Graphite
- type Http
- type IWriter
- type NewrelicInsights
- type ResourcedMasterHost
- type Shell
- type StdOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentResourcePayload ¶
type Base ¶
type Base struct { Configs *resourced_config.Configs ReadersData map[string]interface{} Data interface{} JsonProcessor string }
func (*Base) GenerateData ¶ added in v1.4.0
GenerateData pulls ReadersData field and set it to Data field. If JsonProcessor is defined, use it to mangle JSON and save the new JSON on Data field.
func (*Base) GetData ¶ added in v1.4.0
func (b *Base) GetData() interface{}
GetData returns Data field.
func (*Base) GetJsonProcessor ¶
GetJsonProcessor returns json processor path.
func (*Base) GetReadersData ¶
GetReadersData returns ReadersData field.
func (*Base) SetConfigs ¶
func (b *Base) SetConfigs(configs *resourced_config.Configs)
SetConfigs remembers configs data in-memory.
func (*Base) SetData ¶ added in v1.4.0
func (b *Base) SetData(data interface{})
SetData assigns Data field.
func (*Base) SetReadersData ¶
SetReadersData assigns ReadersData field.
func (*Base) SetReadersDataInBytes ¶
SetReadersDataInBytes pulls readers data and store them on ReadersData field.
type Http ¶
type Http struct { Base Url string Method string Headers string Username string Password string MaxRetries int64 }
Http is a writer that simply serialize all readers data to Http.
func (*Http) NewHttpRequest ¶
NewHttpRequest builds and returns http.Request struct.
type IWriter ¶
type IWriter interface { WatchDir(string, func() error) error Run() error SetConfigs(*resourced_config.Configs) SetReadersDataInBytes(map[string][]byte) SetReadersData(map[string]interface{}) GetReadersData() map[string]interface{} SetData(interface{}) GetData() interface{} GetJsonProcessor() string GenerateData() error ToJson() ([]byte, error) }
IWriter is general interface for writer.
func NewGoStructByConfig ¶
func NewGoStructByConfig(config resourced_config.Config) (IWriter, error)
NewGoStructByConfig instantiates IWriter given Config struct
func NewNewrelicInsights ¶ added in v1.3.0
func NewNewrelicInsights() IWriter
NewNewrelicInsights is NewrelicInsights constructor.
func NewResourcedMasterHost ¶
func NewResourcedMasterHost() IWriter
NewResourcedMasterHost is ResourcedMasterHost constructor.
type NewrelicInsights ¶ added in v1.3.0
NewrelicInsights is a writer that serialize readers data to New Relic Insights.
func (*NewrelicInsights) Run ¶ added in v1.4.0
func (nr *NewrelicInsights) Run() error
Run executes the writer.
func (*NewrelicInsights) ToJson ¶ added in v1.3.0
func (nr *NewrelicInsights) ToJson() ([]byte, error)
ToJson serialize Data field to JSON.
type ResourcedMasterHost ¶
type ResourcedMasterHost struct {
Http
}
ResourcedMasterHost is a writer that serialize readers data to ResourcedMasterHost.
func (*ResourcedMasterHost) Run ¶
func (rmh *ResourcedMasterHost) Run() error
Run executes the writer.