config

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OAuthCommands = struct {
	None     OAuthCommand
	Request  OAuthCommand
	Exchange OAuthCommand
}{
	None:     "",
	Request:  "request",
	Exchange: "exchange",
}

Functions

func Init

func Init(VERSION string, SOURCE_DATE string)

func MapTemplate

func MapTemplate(from interface{}) interface{}

func ParseTimeInterval

func ParseTimeInterval(source string) (time.Duration, error)

Types

type CLIConfigType

type CLIConfigType struct {
	APIURL              string
	ChannelTag          string
	ConfigFileLocation  string
	LogLevel            gotelemetry.LogLevel
	Filter              *regexp.Regexp
	ForceRunOnce        bool
	IsPiping            bool
	UseJSONPatch        bool
	UsePOST             bool
	IsNotifying         bool
	DebugMode           bool
	NotificationChannel string
	NotificationFlow    string
	Notification        gotelemetry.Notification
	WantsFunctionHelp   bool
	FunctionHelpName    string
	OAuthCommand        OAuthCommand
	OAuthName           string
	OAuthCode           string
	OAuthVerifier       string
	OAuthRealmID        string
}
var CLIConfig CLIConfigType

type ConfigFile

type ConfigFile struct {
	Server    ServerConfig                `toml:"server"`
	Graphite  GraphiteConfig              `toml:"graphite"`
	Data      DataConfig                  `toml:"data"`
	Listen    string                      `toml:"listen"`
	JobsField []Job                       `toml:"jobs"`
	FlowField []Job                       `toml:"flow"`
	OAuth     map[string]OAuthConfigEntry `toml:"oauth"`
}

func NewConfigFile

func NewConfigFile() (*ConfigFile, error)

func (*ConfigFile) APIToken

func (c *ConfigFile) APIToken() (string, error)

func (*ConfigFile) APIURL

func (c *ConfigFile) APIURL() string

func (*ConfigFile) ChannelTag

func (c *ConfigFile) ChannelTag() string

func (*ConfigFile) DataConfig

func (c *ConfigFile) DataConfig() DataConfig

func (*ConfigFile) GraphiteConfig

func (c *ConfigFile) GraphiteConfig() GraphiteConfig

func (*ConfigFile) Jobs

func (c *ConfigFile) Jobs() []Job

func (*ConfigFile) OAuthConfig

func (c *ConfigFile) OAuthConfig() map[string]OAuthConfigEntry

func (*ConfigFile) SubmissionInterval

func (c *ConfigFile) SubmissionInterval() time.Duration

type ConfigInterface

type ConfigInterface interface {
	APIURL() string
	APIToken() (string, error)
	ChannelTag() string
	DataConfig() DataConfig
	GraphiteConfig() GraphiteConfig
	SubmissionInterval() time.Duration
	OAuthConfig() map[string]OAuthConfigEntry
	Jobs() []Job
}

type DataConfig

type DataConfig struct {
	DataLocation *string `toml:"path"`
	TTL          *string `toml:"ttl"`
	Listen       *string `toml:"listen"`
}

type GraphiteConfig

type GraphiteConfig struct {
	TCPListenPort string `toml:"listen_tcp"`
	UDPListenPort string `toml:"listen_udp"`
}

type Job

type Job map[string]interface{}

func (Job) ChannelTag

func (j Job) ChannelTag() string

func (Job) ID

func (j Job) ID() string

func (Job) Plugin

func (j Job) Plugin() string

type OAuthCommand

type OAuthCommand string

type OAuthConfigEntry

type OAuthConfigEntry struct {
	Version          int               `toml:"version"`
	ClientID         string            `toml:"client_id"`
	ClientSecret     string            `toml:"client_secret"`
	CredentialsURL   string            `toml:"credentials_url"`
	AuthorizationURL string            `toml:"authorization_url"`
	TokenURL         string            `toml:"token_url"`
	Scopes           []string          `toml:"scopes"`
	Header           map[string]string `toml:"header"`
	SignatureMethod  string            `toml:"signature_method"`
	PrivateKey       string            `toml:"private_key"`
}

type ServerConfig

type ServerConfig struct {
	APIToken              string      `toml:"api_token"`
	RawSubmissionInterval interface{} `toml:"submission_interval"`
}

Jump to

Keyboard shortcuts

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