v0.0.0-...-3ce1eab Latest Latest

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: 16 Imported by: 3




This section is empty.


This section is empty.


This section is empty.


type Config

type Config struct {
	PProfPort             uint32        `env:"RLP_PPROF_PORT"`
	HealthAddr            string        `env:"RLP_HEALTH_ADDR"`
	MetricEmitterInterval time.Duration `env:"RLP_METRIC_EMITTER_INTERVAL"`
	MetricSourceID        string        `env:"RLP_METRIC_SOURCE_ID"`
	RouterAddrs           []string      `env:"ROUTER_ADDRS, required"`
	AgentAddr             string        `env:"AGENT_ADDR"`
	MaxEgressStreams      int64         `env:"MAX_EGRESS_STREAMS"`
	GRPC                  GRPC

Config stores all configurations options for RLP.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig reads from the environment to create a Config.

type GRPC

type GRPC struct {
	Port         int      `env:"RLP_PORT"`
	CertFile     string   `env:"RLP_CERT_FILE"`
	KeyFile      string   `env:"RLP_KEY_FILE"`
	CAFile       string   `env:"RLP_CA_FILE"`
	CipherSuites []string `env:"RLP_CIPHER_SUITES"`

GRPC stores the configuration for the RLP as a server using a PORT with mTLS certs and as a client also using mTSL certs for emitting metrics and for connecting to the Router.

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.

type RLP

type RLP struct {
	// contains filtered or unexported fields

RLP represents the reverse log proxy component. It connects to various gRPC servers to ingress data and opens a gRPC server to egress data.

func NewRLP

func NewRLP(m MetricClient, opts ...RLPOption) *RLP

NewRLP returns a new unstarted RLP.

func (*RLP) EgressAddr

func (r *RLP) EgressAddr() net.Addr

EgressAddr returns the address used for the egress server.

func (*RLP) Start

func (r *RLP) Start()

Start starts a remote log proxy. This connects to various gRPC servers and listens for gRPC connections for egressing data.

func (*RLP) Stop

func (r *RLP) Stop()

Stop stops the remote log proxy. It stops listening for new subscriptions and drains existing ones. Stop will not return until existing connections are drained or timeout has elapsed.

type RLPOption

type RLPOption func(c *RLP)

RLPOption represents a function that can configure a reverse log proxy.

func WithEgressPort

func WithEgressPort(port int) RLPOption

WithEgressPort specifies the port used to bind the egress gRPC server.

func WithEgressServerOptions

func WithEgressServerOptions(opts ...grpc.ServerOption) RLPOption

WithEgressServerOptions specifies the dial options used when serving data via gRPC.

func WithHealthAddr

func WithHealthAddr(addr string) RLPOption

WithHealthAddr specifies the host and port to bind to for servicing the health endpoint.

func WithIngressAddrs

func WithIngressAddrs(addrs []string) RLPOption

WithIngressAddrs specifies the addresses used to connect to ingress data.

func WithIngressDialOptions

func WithIngressDialOptions(opts ...grpc.DialOption) RLPOption

WithIngressDialOptions specifies the dial options used when connecting to the gRPC server to ingress data.

func WithMaxEgressConnections

func WithMaxEgressConnections(max int) RLPOption

WithMaxEgressConnections specifies the number of connections the RLP will accept on the egress endpoint.

func WithMaxEgressStreams

func WithMaxEgressStreams(max int64) RLPOption

WithMaxEgressStreams specifies the number of streams the RLP will allow.

Jump to

Keyboard shortcuts

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