app

package
v0.0.0-...-17888d6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLookup

func WithLookup(l func(string) ([]net.IP, error)) func(*Agent)

WithLookup allows the default DNS resolver to be changed.

func WithV1Lookup

func WithV1Lookup(l func(string) ([]net.IP, error)) func(*AppV1)

WithV1Lookup allows the default DNS resolver to be changed.

func WithV2Lookup

func WithV2Lookup(l func(string) ([]net.IP, error)) func(*AppV2)

WithV2Lookup allows the default DNS resolver to be changed.

Types

type Agent

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

func NewAgent

func NewAgent(
	c *Config,
	opts ...AgentOption,
) *Agent

func (*Agent) Start

func (a *Agent) Start()

type AgentOption

type AgentOption func(*Agent)

AgentOption configures agent options.

type AppV1

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

func (*AppV1) Start

func (a *AppV1) Start()

type AppV1Option

type AppV1Option func(*AppV1)

AppV1Option configures AppV1 options.

type AppV2

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

func NewV2App

func NewV2App(
	c *Config,
	r *healthendpoint.Registrar,
	clientCreds credentials.TransportCredentials,
	serverCreds credentials.TransportCredentials,
	metricClient MetricClient,
	opts ...AppV2Option,
) *AppV2

func (*AppV2) Start

func (a *AppV2) Start()

type AppV2Option

type AppV2Option func(*AppV2)

AppV2Option configures AppV2 options.

type Config

type Config struct {
	Deployment                      string            `env:"AGENT_DEPLOYMENT"`
	Zone                            string            `env:"AGENT_ZONE"`
	Job                             string            `env:"AGENT_JOB"`
	Index                           string            `env:"AGENT_INDEX"`
	IP                              string            `env:"AGENT_IP"`
	Tags                            map[string]string `env:"AGENT_TAGS"`
	DisableUDP                      bool              `env:"AGENT_DISABLE_UDP"`
	IncomingUDPPort                 int               `env:"AGENT_INCOMING_UDP_PORT"`
	HealthEndpointPort              uint              `env:"AGENT_HEALTH_ENDPOINT_PORT"`
	MetricBatchIntervalMilliseconds uint              `env:"AGENT_METRIC_BATCH_INTERVAL_MILLISECONDS"`
	PProfPort                       uint32            `env:"AGENT_PPROF_PORT"`
	RouterAddr                      string            `env:"ROUTER_ADDR"`
	RouterAddrWithAZ                string            `env:"ROUTER_ADDR_WITH_AZ"`
	GRPC                            GRPC
}

Config stores all configurations options for the Agent.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig reads from the environment to create a Config.

type GRPC

type GRPC struct {
	Port         uint16   `env:"AGENT_PORT"`
	CAFile       string   `env:"AGENT_CA_FILE"`
	CertFile     string   `env:"AGENT_CERT_FILE"`
	KeyFile      string   `env:"AGENT_KEY_FILE"`
	CipherSuites []string `env:"AGENT_CIPHER_SUITES"`
}

GRPC stores the configuration for the router as a server using a PORT with mTLS certs and as a client.

type MetricClient

type MetricClient interface {
	NewCounter(name string, opts ...metricemitter.MetricOption) *metricemitter.Counter
	NewGauge(name, unit string, opts ...metricemitter.MetricOption) *metricemitter.Gauge
}

MetricClient creates new CounterMetrics to be emitted periodically.

Jump to

Keyboard shortcuts

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