Documentation
¶
Index ¶
- Constants
- func OutputJSON(data interface{}, pretty bool) error
- func Run(log *logrus.Logger, client RedisClientImpl, redisConf Config, prettyPrint bool, ...)
- func ValidateConfig(log *logrus.Logger, redisConf *Config)
- type Config
- type EventData
- type InventoryData
- type MetricData
- type PluginData
- type RedisClientImpl
Constants ¶
const EVENTTYPE string = "RedisInfo"
EVENTTYPE -
const NAME string = "redis"
NAME - name of plugin
const PROVIDER string = "redis"
PROVIDER -
const ProtocolVersion string = "1"
ProtocolVersion -
Variables ¶
This section is empty.
Functions ¶
func OutputJSON ¶
OutputJSON takes an object and prints it as a JSON string to the stdout. If the pretty attribute is set to true, the JSON will be idented for easy reading.
func Run ¶
func Run(log *logrus.Logger, client RedisClientImpl, redisConf Config, prettyPrint bool, version string)
Run -
func ValidateConfig ¶
ValidateConfig - function to validate the config and set defaults
Types ¶
type Config ¶
type Config struct { RedisHost string // Optional: leaving blank will default to localhost RedisPort string // Optional: leaving blank will default to 6379 RedisPass string // Optional: leaving blank means no password RedisDB string // Optional: leaving blank will keep DBID at 0 DBID int // Not from external config, but holder for DBID int value if specified }
Config is the keeper of the config
type EventData ¶
type EventData map[string]interface{}
EventData is the data type for single shot events
type InventoryData ¶
type InventoryData map[string]interface{}
InventoryData is the data type for inventory data produced by a plugin data source and emitted to the agent's inventory data store
type MetricData ¶
type MetricData map[string]interface{}
MetricData is the data type for events produced by a plugin data source and emitted to the agent's metrics data store
type PluginData ¶
type PluginData struct { Name string `json:"name"` ProtocolVersion string `json:"protocol_version"` PluginVersion string `json:"plugin_version"` Metrics []MetricData `json:"metrics"` Inventory map[string]InventoryData `json:"inventory"` Events []EventData `json:"events"` Status string `json:"status"` }
PluginData defines the format of the output JSON that plugins will return
type RedisClientImpl ¶
RedisClientImpl - interface used for mocking
func InitRedisClient ¶
func InitRedisClient(conf Config) RedisClientImpl
InitRedisClient - function to create a redis client