app

package
v0.0.0-...-3ce1eab 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, BSD-3-Clause, MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	UDPAddress  string `env:"AGENT_UDP_ADDRESS"`
	GRPCAddress string `env:"AGENT_GRPC_ADDRESS"`
}

Agent stores configuration for communication to a logging/metric agent.

type CCTLSClientConfig

type CCTLSClientConfig struct {
	CertFile   string `env:"CC_CERT_FILE"`
	KeyFile    string `env:"CC_KEY_FILE"`
	CAFile     string `env:"CC_CA_FILE"`
	ServerName string `env:"CC_SERVER_NAME"`
}

CCTLSClientConfig stores TLS cofiguration for communication with cloud controller.

type Config

type Config struct {
	IP                    string        `env:"TRAFFIC_CONTROLLER_IP, report"`
	ApiHost               string        `env:"TRAFFIC_CONTROLLER_API_HOST, report"`
	OutgoingDropsondePort uint32        `env:"TRAFFIC_CONTROLLER_OUTGOING_DROPSONDE_PORT, report"`
	OutgoingCertFile      string        `env:"TRAFFIC_CONTROLLER_OUTGOING_CERT_FILE, report"`
	OutgoingKeyFile       string        `env:"TRAFFIC_CONTROLLER_OUTGOING_KEY_FILE, report"`
	SystemDomain          string        `env:"TRAFFIC_CONTROLLER_SYSTEM_DOMAIN, report"`
	SkipCertVerify        bool          `env:"TRAFFIC_CONTROLLER_SKIP_CERT_VERIFY, report"`
	UaaHost               string        `env:"TRAFFIC_CONTROLLER_UAA_HOST, report"`
	UaaClient             string        `env:"TRAFFIC_CONTROLLER_UAA_CLIENT, report"`
	UaaClientSecret       string        `env:"TRAFFIC_CONTROLLER_UAA_CLIENT_SECRET"`
	UaaCACert             string        `env:"TRAFFIC_CONTROLLER_UAA_CA_CERT, report"`
	SecurityEventLog      string        `env:"TRAFFIC_CONTROLLER_SECURITY_EVENT_LOG, report"`
	PProfPort             uint32        `env:"TRAFFIC_CONTROLLER_PPROF_PORT, report"`
	MetricEmitterInterval time.Duration `env:"TRAFFIC_CONTROLLER_METRIC_EMITTER_INTERVAL, report"`
	HealthAddr            string        `env:"TRAFFIC_CONTROLLER_HEALTH_ADDR, report"`
	DisableAccessControl  bool          `env:"TRAFFIC_CONTROLLER_DISABLE_ACCESS_CONTROL, report"`
	RouterAddrs           []string      `env:"ROUTER_ADDRS, report"`
	LogCacheAddr          string        `env:"LOG_CACHE_ADDR, report"`

	CCTLSClientConfig CCTLSClientConfig
	Agent             Agent
	GRPC              GRPC
	LogCacheTLSConfig LogCacheTLSConfig
}

Config stores all Configuration options for trafficcontroller.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig reads from the environment to create a Config.

type GRPC

type GRPC struct {
	CAFile   string `env:"ROUTER_CA_FILE"`
	CertFile string `env:"ROUTER_CERT_FILE"`
	KeyFile  string `env:"ROUTER_KEY_FILE"`
}

GRPC stores TLS configuration for gRPC communcation to router and agent.

type LogCacheTLSConfig

type LogCacheTLSConfig struct {
	CAFile     string `env:"LOG_CACHE_CA_FILE"`
	CertFile   string `env:"LOG_CACHE_CERT_FILE"`
	KeyFile    string `env:"LOG_CACHE_KEY_FILE"`
	ServerName string `env:"LOG_CACHE_SERVER_NAME"`
}

LogCacheTLSConfig stores TLS configuration for gRPC communcation to router and agent.

type MetricClient

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

MetricClient can be used to emit metrics and events.

type TrafficController

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

func NewTrafficController

func NewTrafficController(
	c *Config,
	disableAccessControl bool,
	metricClient MetricClient,
	uaaHTTPClient *http.Client,
	ccHTTPClient *http.Client,
) *TrafficController

func (*TrafficController) Start

func (t *TrafficController) Start()

Jump to

Keyboard shortcuts

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