app

package
Version: v0.0.0-...-14308cf Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 23 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 NewV1App

func NewV1App(
	c *Config,
	creds credentials.TransportCredentials,
	m MetricClient,
	opts ...AppV1Option,
) *AppV1

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,
	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"`
	MetricBatchIntervalMilliseconds uint              `env:"AGENT_METRIC_BATCH_INTERVAL_MILLISECONDS"`
	MetricSourceID                  string            `env:"AGENT_METRIC_SOURCE_ID"`
	DebugPort                       uint32            `env:"AGENT_DEBUG_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 ...metrics.MetricOption) metrics.Counter
	NewGauge(name string, opts ...metrics.MetricOption) metrics.Gauge
}

MetricClient is used to serve metrics.

Jump to

Keyboard shortcuts

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