app

package
v0.0.0-...-ae39917 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 14 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 {
	UseRFC339                  bool   `env:"USE_RFC339"`
	LogsProviderAddr           string `env:"LOGS_PROVIDER_ADDR,             required, report"`
	LogsProviderCAPath         string `env:"LOGS_PROVIDER_CA_PATH,          required, report"`
	LogsProviderClientCertPath string `env:"LOGS_PROVIDER_CLIENT_CERT_PATH, required, report"`
	LogsProviderClientKeyPath  string `env:"LOGS_PROVIDER_CLIENT_KEY_PATH,  required, report"`
	LogsProviderCommonName     string `env:"LOGS_PROVIDER_COMMON_NAME, report"`
	SkipCertVerify             bool   `env:"SKIP_CERT_VERIFY, report"`

	PProfPort uint32 `env:"PPROF_PORT"`

	LogAccessAuthorization LogAccessAuthorization
	LogAdminAuthorization  LogAdminAuthorization

	StreamTimeout time.Duration `env:"STREAM_TIMEOUT, report"`

	HTTP          HTTP
	MetricsServer MetricsServer
}

Config holds the configuration for the RLP Gateway

func LoadConfig

func LoadConfig() Config

LoadConfig will load and return the config from the current environment. If this fails this function will fatally log.

type Gateway

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

Gateway provides a high level for running the RLP gateway

func NewGateway

func NewGateway(
	cfg Config,
	metrics Metrics,
	log *log.Logger,
	httpLogOutput io.Writer,
) *Gateway

NewGateway creates a new Gateway

func (*Gateway) Addr

func (g *Gateway) Addr() string

Addr returns the address the gateway HTTP listener is bound to

func (*Gateway) Start

func (g *Gateway) Start(blocking bool)

Start will start the process that connects to the logs provider and listens on http

func (*Gateway) Stop

func (g *Gateway) Stop()

Stop closes the server connection

type HTTP

type HTTP struct {
	GatewayAddr string `env:"GATEWAY_ADDR, report"`
	CertPath    string `env:"HTTP_CERT_PATH,   required, report"`
	KeyPath     string `env:"HTTP_KEY_PATH,    required, report"`
}

type LogAccessAuthorization

type LogAccessAuthorization struct {
	Addr       string `env:"LOG_ACCESS_ADDR,        required, report"`
	CertPath   string `env:"LOG_ACCESS_CERT_PATH,   required, report"`
	KeyPath    string `env:"LOG_ACCESS_KEY_PATH,    required, report"`
	CAPath     string `env:"LOG_ACCESS_CA_PATH,     required, report"`
	CommonName string `env:"LOG_ACCESS_COMMON_NAME, required, report"`

	ExternalAddr string `env:"LOG_ACCESS_ADDR_EXTERNAL, required, report"`
}

LogAccessAuthorization holds the configuration for verifying log access.

type LogAdminAuthorization

type LogAdminAuthorization struct {
	Addr         string `env:"LOG_ADMIN_ADDR,          required, report"`
	ClientID     string `env:"LOG_ADMIN_CLIENT_ID,     required"`
	ClientSecret string `env:"LOG_ADMIN_CLIENT_SECRET, required"`
	CAPath       string `env:"LOG_ADMIN_CA_PATH,       required, report"`
}

LogAdminAuthorization holds the configuration for verifing log admin access.

type Metrics

type Metrics interface {
	NewGauge(name, helpText string, opts ...metrics.MetricOption) metrics.Gauge
	NewCounter(name, helpText string, opts ...metrics.MetricOption) metrics.Counter
}

type MetricsServer

type MetricsServer struct {
	Port     uint16 `env:"METRICS_PORT, report"`
	CAFile   string `env:"METRICS_CA_FILE_PATH, required, report"`
	CertFile string `env:"METRICS_CERT_FILE_PATH, required, report"`
	KeyFile  string `env:"METRICS_KEY_FILE_PATH, required, report"`
}

MetricsServer stores the configuration for the metrics server

Jump to

Keyboard shortcuts

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