app

package
v0.0.0-...-17888d6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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"`
	RouterAddrs           []string      `env:"ROUTER_ADDRS, required"`
	AgentAddr             string        `env:"AGENT_ADDR"`
	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
}

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 remote 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.

Jump to

Keyboard shortcuts

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