Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 // persistence MaxRetainedLogMessages uint32 `env:"ROUTER_MAX_RETAINED_LOG_MESSAGES"` SinkInactivityTimeoutSeconds int `env:"ROUTER_SINK_INACTIVITY_TIMEOUT_SECONDS"` // health PProfPort uint32 `env:"ROUTER_PPROF_PORT"` HealthAddr string `env:"ROUTER_HEALTH_ADDR"` 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 WithMetricReporting ¶
func WithMetricReporting( healthAddr string, agent Agent, metricBatchIntervalMilliseconds uint, sourceID string, ) RouterOption
WithMetricReporting returns a RouterOption that enables Router to emit metrics about itself.
func WithPersistence ¶
func WithPersistence( maxRetainedLogMessages uint32, sinkInactivityTimeoutSeconds int, ) RouterOption
WithPersistence turns on recent log storage.