Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addrs ¶
type Addrs struct {
GRPC string
}
Addrs stores listener addresses of the router process.
type Agent ¶
type Agent struct {
GRPCAddress string `env:"AGENT_GRPC_ADDRESS"`
}
Agent stores the configuration for connecting to the Agent over gRPC.
type Config ¶
type Config struct {
GRPC GRPC
IngressBufferSize int `env:"INGRESS_BUFFER_SIZE"`
EgressBufferSize int `env:"EGRESS_BUFFER_SIZE"`
UseRFC339 bool `env:"USE_RFC339"`
PProfPort uint32 `env:"ROUTER_PPROF_PORT"`
Agent Agent
MetricBatchIntervalMilliseconds uint `env:"ROUTER_METRIC_BATCH_INTERVAL_MILLISECONDS"`
MetricSourceID string `env:"ROUTER_METRIC_SOURCE_ID"`
}
Config stores all configurations options for the Router.
func LoadConfig ¶
LoadConfig reads from the environment to create a Config.
type GRPC ¶
type GRPC struct {
Port uint16 `env:"ROUTER_PORT"`
CertFile string `env:"ROUTER_CERT_FILE"`
KeyFile string `env:"ROUTER_KEY_FILE"`
CAFile string `env:"ROUTER_CA_FILE"`
CipherSuites []string `env:"ROUTER_CIPHER_SUITES"`
}
GRPC stores the configuration for the router as a server using a PORT with mTLS certs and as a client also using mTSL certs for emitting metrics.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router routes envelopes from producers to any subscribers.
func NewRouter ¶
func NewRouter(grpc GRPC, opts ...RouterOption) *Router
NewRouter creates a new Router with the given options. Each provided RouterOption will manipulate the Router behavior.
type RouterOption ¶
type RouterOption func(*Router)
RouterOption is used to configure a new Router.
func WithBufferSizes ¶
func WithBufferSizes( ingressBufferSize int, egressBufferSize int, ) RouterOption
WithBufferSizes returns a routerOption that enables configurable buffer sizes
func WithMetricReporting ¶
func WithMetricReporting( agent Agent, metricBatchIntervalMilliseconds uint, sourceID string, ) RouterOption
WithMetricReporting returns a RouterOption that enables Router to emit metrics about itself.