config

package
v1.16.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv added in v1.16.0

func GetEnv(cfg *Config) []string

GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list with all the environment variables an extension supports.

func StructMappings added in v1.16.0

func StructMappings(cfg *Config) []shared.EnvBinding

StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets us propagate changes easier.

Types

type Asset

type Asset struct {
	Path string `ocisConfig:"asset"`
}

Asset undocumented

type CORS added in v1.14.0

type CORS struct {
	AllowedOrigins   []string `ocisConfig:"allowed_origins"`
	AllowedMethods   []string `ocisConfig:"allowed_methods"`
	AllowedHeaders   []string `ocisConfig:"allowed_headers"`
	AllowCredentials bool     `ocisConfig:"allow_credentials"`
}

CORS defines the available cors configuration.

type Config

type Config struct {
	*shared.Commons

	File         string       `ocisConfig:"file"`
	Service      Service      `ocisConfig:"service"`
	Log          *shared.Log  `ocisConfig:"log"`
	Debug        Debug        `ocisConfig:"debug"`
	HTTP         HTTP         `ocisConfig:"http"`
	GRPC         GRPC         `ocisConfig:"grpc"`
	Tracing      Tracing      `ocisConfig:"tracing"`
	Asset        Asset        `ocisConfig:"asset"`
	TokenManager TokenManager `ocisConfig:"token_manager"`

	Context    context.Context
	Supervised bool
}

Config combines all available configuration parts.

func DefaultConfig added in v1.16.0

func DefaultConfig() *Config

DefaultConfig provides sane bootstrapping defaults.

func New

func New() *Config

New initializes a new configuration with or without defaults.

type Debug

type Debug struct {
	Addr   string `ocisConfig:"addr"`
	Token  string `ocisConfig:"token"`
	Pprof  bool   `ocisConfig:"pprof"`
	Zpages bool   `ocisConfig:"zpages"`
}

Debug defines the available debug configuration.

type GRPC

type GRPC struct {
	Addr      string `ocisConfig:"grpc"`
	Namespace string `ocisConfig:"namespace"`
}

GRPC defines the available grpc configuration.

type HTTP

type HTTP struct {
	Addr      string `ocisConfig:"addr"`
	Namespace string `ocisConfig:"namespace"`
	Root      string `ocisConfig:"root"`
	CacheTTL  int    `ocisConfig:"cache_ttl"`
	CORS      CORS   `ocisConfig:"cors"`
}

HTTP defines the available http configuration.

type Service

type Service struct {
	Name     string `ocisConfig:"name"`
	Version  string `ocisConfig:"version"`
	DataPath string `ocisConfig:"data_path"`
}

Service provides configuration options for the service

type TokenManager

type TokenManager struct {
	JWTSecret string `ocisConfig:"jwt_secret"`
}

TokenManager is the config for using the reva token manager

type Tracing

type Tracing struct {
	Enabled   bool   `ocisConfig:"enabled"`
	Type      string `ocisConfig:"type"`
	Endpoint  string `ocisConfig:"endpoint"`
	Collector string `ocisConfig:"collector"`
	Service   string `ocisConfig:"service"`
}

Tracing defines the available tracing configuration.

Jump to

Keyboard shortcuts

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