config

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

This package handles all the configuration things.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Options Options
	// contains filtered or unexported fields
}

Configuration holds both the application config and the plugin configuration

func ReadConfig

func ReadConfig() Configuration

ReadConfig reads the configuration from the CLI options, the ENV vars and the config file

func (*Configuration) ForPlugin

func (conf *Configuration) ForPlugin(name string) *PluginConfig

ForPlugin get the configuration for the plugin name

type Options

type Options struct {
	Freq             time.Duration
	ElasticsearchURL *url.URL
	Port             int
	Config           string
	PluginDir        string
	Path             string
	TimeKey          string
}

Options holds all the application configuration

type PluginConfig

type PluginConfig struct {
	Options interface{}
	Queries []Query
}

PluginConfig the config struct for a plugin

type Query

type Query map[string]interface{}

Query all the options for a single query

func CreateQuery

func CreateQuery(name string, query string) Query

CreateQuery creates a valid Query instance

func (*Query) Name

func (query *Query) Name() string

Name the name of the query

func (*Query) QueryText

func (query *Query) QueryText() string

QueryText the query instruction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL