config

package
v1.17.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

	Service Service

	Tracing *Tracing `ocisConfig:"tracing"`
	Log     *Log     `ocisConfig:"log"`
	Debug   Debug    `ocisConfig:"debug"`

	HTTP HTTP `ocisConfig:"http"`

	OcisPublicURL   string `ocisConfig:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL"`
	WebdavNamespace string `ocisConfig:"webdav_namespace" env:"STORAGE_WEBDAV_NAMESPACE"` //TODO: prevent this cross config
	RevaGateway     string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY"`

	Context context.Context
}

Config combines all available configuration parts.

func DefaultConfig added in v1.16.0

func DefaultConfig() *Config

type Debug

type Debug struct {
	Addr   string `ocisConfig:"addr" env:"WEBDAV_DEBUG_ADDR"`
	Token  string `ocisConfig:"token" env:"WEBDAV_DEBUG_TOKEN"`
	Pprof  bool   `ocisConfig:"pprof" env:"WEBDAV_DEBUG_PPROF"`
	Zpages bool   `ocisConfig:"zpages" env:"WEBDAV_DEBUG_ZPAGES"`
}

Debug defines the available debug configuration.

type HTTP

type HTTP struct {
	Addr      string `ocisConfig:"addr" env:"WEBDAV_HTTP_ADDR"`
	Namespace string
	Root      string `ocisConfig:"root" env:"WEBDAV_HTTP_ROOT"`
	CORS      CORS   `ocisConfig:"cors"`
}

HTTP defines the available http configuration.

type Log

type Log struct {
	Level  string `mapstructure:"level" env:"OCIS_LOG_LEVEL;WEBDAV_LOG_LEVEL"`
	Pretty bool   `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;WEBDAV_LOG_PRETTY"`
	Color  bool   `mapstructure:"color" env:"OCIS_LOG_COLOR;WEBDAV_LOG_COLOR"`
	File   string `mapstructure:"file" env:"OCIS_LOG_FILE;WEBDAV_LOG_FILE"`
}

Log defines the available log configuration.

type Service

type Service struct {
	Name string
}

Service defines the available service configuration.

type Tracing

type Tracing struct {
	Enabled   bool   `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;WEBDAV_TRACING_ENABLED"`
	Type      string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;WEBDAV_TRACING_TYPE"`
	Endpoint  string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEBDAV_TRACING_ENDPOINT"`
	Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;WEBDAV_TRACING_COLLECTOR"`
}

Tracing defines the available tracing configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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