options

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultControlPlane = "localhost:9090"

	FeatureMultiTenant = "adminV1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorConfig

type CollectorConfig struct {
	Endpoint string `env:"ENDPOINT"`
}

CollectorConfig holds config values specific to the collector tracer exporter running locally / within your cluster. All the configuration values here have a prefix of E2CORE_TRACER_COLLECTOR_, specified in the top level Options struct, and the parent TracerConfig struct.

type HoneycombConfig

type HoneycombConfig struct {
	Endpoint string `env:"ENDPOINT"`
	APIKey   string `env:"APIKEY"`
	Dataset  string `env:"DATASET"`
}

HoneycombConfig holds config values specific to the honeycomb tracer exporter. All the configuration values here have a prefix of E2CORE_TRACER_HONEYCOMB_, specified in the top level Options struct, and the parent TracerConfig struct.

type Modifier

type Modifier func(*Options)

Modifier defines options for E2Core.

func AppName

func AppName(name string) Modifier

AppName sets the app name to be used.

func Domain

func Domain(domain string) Modifier

Domain sets the domain to be used.

func HTTPPort

func HTTPPort(port int) Modifier

HTTPPort sets the http port to be used.

func TLSPort

func TLSPort(port int) Modifier

TLSPort sets the tls port to be used.

func UseBundlePath

func UseBundlePath(path string) Modifier

UseBundlePath sets the bundle path to be used.

func UseLogger

func UseLogger(logger *vlog.Logger) Modifier

UseLogger sets the logger to be used.

type Options

type Options struct {
	Features         []string      `env:"E2CORE_API_FEATURES"`
	BundlePath       string        `env:"E2CORE_BUNDLE_PATH"`
	RunSchedules     *bool         `env:"E2CORE_RUN_SCHEDULES,default=true"`
	ControlPlane     string        `env:"E2CORE_CONTROL_PLANE"`
	AuthCacheTTL     time.Duration `env:"E2CORE_AUTH_CACHE_TTL,default=10m"`
	UpstreamAddress  string        `env:"E2CORE_UPSTREAM_ADDRESS"`
	EnvironmentToken string        `env:"E2CORE_ENV_TOKEN"`
	StaticPeers      string        `env:"E2CORE_PEERS"`
	AppName          string        `env:"E2CORE_APP_NAME,default=E2Core"`
	Domain           string        `env:"E2CORE_DOMAIN"`
	HTTPPort         int           `env:"E2CORE_HTTP_PORT,default=8080"`
	TLSPort          int           `env:"E2CORE_TLS_PORT,default=443"`
	TracerConfig     TracerConfig  `env:",prefix=E2CORE_TRACER_"`
	// contains filtered or unexported fields
}

Options defines options for E2Core.

func NewWithModifiers

func NewWithModifiers(mods ...Modifier) *Options

func (*Options) AdminEnabled

func (o *Options) AdminEnabled() bool

func (*Options) Logger

func (o *Options) Logger() *vlog.Logger

Logger returns the options' logger

type TracerConfig

type TracerConfig struct {
	TracerType      string           `env:"TYPE,default=none"`
	ServiceName     string           `env:"SERVICENAME,default=e2core"`
	Probability     float64          `env:"PROBABILITY,default=0.5"`
	Collector       *CollectorConfig `env:",prefix=COLLECTOR_,noinit"`
	HoneycombConfig *HoneycombConfig `env:",prefix=HONEYCOMB_,noinit"`
}

TracerConfig holds values specific to setting up the tracer. It's only used in proxy mode. All configuration options have a prefix of E2CORE_TRACER_ specified in the parent Options struct.

Jump to

Keyboard shortcuts

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