config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Commons        *shared.Commons       `yaml:"-"` // don't use this directly as configuration for a service
	GRPC           GRPC                  `yaml:"grpc"`
	Service        Service               `yaml:"-"`
	Debug          Debug                 `yaml:"debug"`
	Events         Events                `yaml:"events"`
	GRPCClientTLS  *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
	Context        context.Context       `yaml:"-"`
	Log            *Log                  `yaml:"log"`
	Engine         Engine                `yaml:"engine"`
	Postprocessing Postprocessing        `yaml:"postprocessing"`
	Tracing        *Tracing              `yaml:"tracing"`
}

Config combines all available configuration parts.

type Debug

type Debug struct {
	Addr   string `` /* 173-byte string literal not displayed */
	Token  string `yaml:"token" env:"POLICIES_DEBUG_TOKEN" desc:"Token to secure the metrics endpoint." introductionVersion:"1.0.0"`
	Pprof  bool   `yaml:"pprof" env:"POLICIES_DEBUG_PPROF" desc:"Enables pprof, which can be used for profiling." introductionVersion:"1.0.0"`
	Zpages bool   `` /* 155-byte string literal not displayed */
}

Debug defines the available debug configuration.

type Engine

type Engine struct {
	Timeout  time.Duration `` /* 252-byte string literal not displayed */
	Policies []string      `yaml:"policies"`
	// Mimes file path, RFC 4288
	Mimes string `` /* 190-byte string literal not displayed */
}

Engine configures the policy engine.

type Events

type Events struct {
	Endpoint             string `` /* 246-byte string literal not displayed */
	Cluster              string `` /* 288-byte string literal not displayed */
	TLSInsecure          bool   `` /* 194-byte string literal not displayed */
	TLSRootCACertificate string `` /* 280-byte string literal not displayed */
	EnableTLS            bool   `` /* 258-byte string literal not displayed */
	AuthUsername         string `` /* 263-byte string literal not displayed */
	AuthPassword         string `` /* 263-byte string literal not displayed */
}

Events combines the configuration options for the event bus.

type GRPC

type GRPC struct {
	Addr      string                 `yaml:"addr" env:"POLICIES_GRPC_ADDR" desc:"The bind address of the GRPC service." introductionVersion:"1.0.0"`
	Namespace string                 `yaml:"-"`
	TLS       *shared.GRPCServiceTLS `yaml:"tls"`
}

GRPC defines the available grpc configuration.

type Log

type Log struct {
	Level  string `` /* 187-byte string literal not displayed */
	Pretty bool   `mapstructure:"pretty" env:"OC_LOG_PRETTY;POLICIES_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
	Color  bool   `mapstructure:"color" env:"OC_LOG_COLOR;POLICIES_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
	File   string `` /* 155-byte string literal not displayed */
}

Log defines the available log configuration.

type Postprocessing

type Postprocessing struct {
	Query string `` /* 233-byte string literal not displayed */
}

Postprocessing defines the config options for the postprocessing policy handling.

type Service

type Service struct {
	Name string `yaml:"-"`
}

Service defines the available service configuration.

type Tracing

type Tracing struct {
	Enabled   bool   `yaml:"enabled" env:"OC_TRACING_ENABLED;POLICIES_TRACING_ENABLED" desc:"Activates tracing." introductionVersion:"1.0.0"`
	Type      string `` /* 211-byte string literal not displayed */
	Endpoint  string `` /* 137-byte string literal not displayed */
	Collector string `` /* 257-byte string literal not displayed */
}

Tracing defines the available tracing configuration.

func (Tracing) Convert

func (t Tracing) Convert() tracing.Config

Convert Tracing to the tracing package's Config struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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