config

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: Apache-2.0 Imports: 21 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultProxyConfig = &ProxyConfig{
	PidFilename:                   pointer.String("metricproxy.pid"),
	LogDir:                        pointer.String(os.TempDir()),
	LogMaxSize:                    pointer.Int(100),
	LogMaxBackups:                 pointer.Int(10),
	LogFormat:                     pointer.String(""),
	ServerName:                    pointer.String(getDefaultName(os.Hostname)),
	MaxGracefulWaitTimeDuration:   pointer.Duration(time.Second),
	GracefulCheckIntervalDuration: pointer.Duration(time.Second),
	SilentGracefulTimeDuration:    pointer.Duration(2 * time.Second),
}

DefaultProxyConfig is default values for the proxy config

Functions

This section is empty.

Types

type ForwardTo

type ForwardTo struct {
	URL               *string `json:",omitempty"`
	EventURL          *string `json:",omitempty"`
	Host              *string `json:",omitempty"`
	Port              *uint16 `json:",omitempty"`
	Type              string
	TimeoutDuration   *time.Duration       `json:"-"`
	Timeout           *string              `json:",omitempty"`
	DefaultSource     *string              `json:",omitempty"`
	DefaultAuthToken  *string              `json:",omitempty"`
	BufferSize        *int64               `json:",omitempty"`
	Name              *string              `json:",omitempty"`
	DrainingThreads   *int64               `json:",omitempty"`
	MetricCreationURL *string              `json:",omitempty"`
	MaxDrainSize      *int64               `json:",omitempty"`
	Filename          *string              `json:",omitempty"`
	SourceDimensions  *string              `json:",omitempty"`
	FormatVersion     *uint32              `json:",omitempty"`
	DimensionsOrder   []string             `json:",omitempty"`
	Filters           *filtering.FilterObj `json:",omitempty"`
}

ForwardTo configures where we forward datapoints to

func (*ForwardTo) String

func (forwardTo *ForwardTo) String() string

type ListenFrom

type ListenFrom struct {
	Type                           string
	ListenAddr                     *string                `json:",omitempty"`
	Dimensions                     map[string]string      `json:",omitempty"`
	MetricDeconstructor            *string                `json:",omitempty"`
	MetricDeconstructorOptions     *string                `json:",omitempty"`
	MetricDeconstructorOptionsJSON map[string]interface{} `json:",omitempty"`
	Timeout                        *string                `json:",omitempty"`
	Name                           *string                `json:",omitempty"`
	ListenPath                     *string                `json:",omitempty"`
	JSONEngine                     *string                `json:",omitempty"`
	Encrypted                      *bool                  `json:",omitempty"`
	TimeoutDuration                *time.Duration         `json:"-"`
	ServerAcceptDeadline           *time.Duration         `json:"-"`
}

ListenFrom configures how we listen for datapoints to forward

func (*ListenFrom) String

func (listenFrom *ListenFrom) String() string

type Loader added in v0.9.0

type Loader struct {
	// contains filtered or unexported fields
}

Loader is able to load forwarders and listeners from config type strings

func NewLoader added in v0.9.0

func NewLoader(ctx context.Context, logger log.Logger, version string, debugContext *web.HeaderCtxFlag, itemFlagger *dpsink.ItemFlagger, ctxdims *log.CtxDimensions, next web.NextConstructor) *Loader

NewLoader creates the default loader for proxy protocols

func (*Loader) Forwarder added in v0.9.0

func (l *Loader) Forwarder(conf *ForwardTo) (protocol.Forwarder, error)

Forwarder loads a forwarder based upon config, finding the right forwarder first

func (*Loader) Listener added in v0.9.0

func (l *Loader) Listener(sink dpsink.Sink, conf *ListenFrom) (protocol.Listener, error)

Listener loads a listener based upon config, finding the right listener first

type ProxyConfig

type ProxyConfig struct {
	ForwardTo                     []*ForwardTo   `json:",omitempty"`
	ListenFrom                    []*ListenFrom  `json:",omitempty"`
	StatsDelay                    *string        `json:",omitempty"`
	StatsDelayDuration            *time.Duration `json:"-"`
	NumProcs                      *int           `json:",omitempty"`
	LocalDebugServer              *string        `json:",omitempty"`
	PidFilename                   *string        `json:",omitempty"`
	LogDir                        *string        `json:",omitempty"`
	LogMaxSize                    *int           `json:",omitempty"`
	LogMaxBackups                 *int           `json:",omitempty"`
	LogFormat                     *string        `json:",omitempty"`
	PprofAddr                     *string        `json:",omitempty"`
	DebugFlag                     *string        `json:",omitempty"`
	ServerName                    *string        `json:",omitempty"`
	MaxGracefulWaitTime           *string        `json:",omitempty"`
	GracefulCheckInterval         *string        `json:",omitempty"`
	SilentGracefulTime            *string        `json:",omitempty"`
	MaxGracefulWaitTimeDuration   *time.Duration `json:"-"`
	GracefulCheckIntervalDuration *time.Duration `json:"-"`
	SilentGracefulTimeDuration    *time.Duration `json:"-"`
}

ProxyConfig is the full config as presented inside the proxy config file

func Load

func Load(configFile string, logger log.Logger) (*ProxyConfig, error)

Load loads proxy configuration from a filename that is in an xdg configuration location

func (*ProxyConfig) String added in v0.9.0

func (p *ProxyConfig) String() string

func (*ProxyConfig) Var added in v0.9.0

func (p *ProxyConfig) Var() expvar.Var

Var returns the proxy config itself as an expvar

Jump to

Keyboard shortcuts

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