config

package
v1.16.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 23 Imported by: 21

Documentation

Index

Constants

View Source
const (
	// SUPERVISED sets the runtime mode as supervised threads.
	SUPERVISED = iota

	// UNSUPERVISED sets the runtime mode as a single thread.
	UNSUPERVISED
)

Variables

This section is empty.

Functions

func BindEnv added in v1.16.0

func BindEnv(c *gofig.Config, bindings []shared.EnvBinding) error

BindEnv takes a config `c` and a EnvBinding and binds the values from the environment to the address location in cfg.

func BindSourcesToStructs added in v1.16.0

func BindSourcesToStructs(extension string, dst interface{}) (*gofig.Config, error)

BindSourcesToStructs assigns any config value from a config file / env variable to struct `dst`. Its only purpose is to solely modify `dst`, not dealing with the config structs; and do so in a thread safe manner.

func DefaultConfigSources added in v1.16.0

func DefaultConfigSources(filename string, drivers []string) []string

DefaultConfigSources returns a slice with matched expected config files. It sugars coat several aspects of config file management by assuming there are 3 default locations a config file could be. It uses globbing to match a config file by name, and retrieve any supported extension supported by our drivers. It sanitizes the output depending on the list of drivers provided.

func GetEnv added in v1.16.0

func GetEnv() []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 Config

type Config struct {
	*shared.Commons `ocisConfig:"shared"`

	Mode    Mode // DEPRECATED
	File    string
	OcisURL string `ocisConfig:"ocis_url"`

	Registry     string       `ocisConfig:"registry"`
	Log          shared.Log   `ocisConfig:"log"`
	Tracing      Tracing      `ocisConfig:"tracing"`
	TokenManager TokenManager `ocisConfig:"token_manager"`
	Runtime      Runtime      `ocisConfig:"runtime"`

	Accounts      *accounts.Config      `ocisConfig:"accounts"`
	GLAuth        *glauth.Config        `ocisConfig:"glauth"`
	Graph         *graph.Config         `ocisConfig:"graph"`
	GraphExplorer *graphExplorer.Config `ocisConfig:"graph_explorer"`
	IDP           *idp.Config           `ocisConfig:"idp"`
	OCS           *ocs.Config           `ocisConfig:"ocs"`
	Web           *web.Config           `ocisConfig:"web"`
	Proxy         *proxy.Config         `ocisConfig:"proxy"`
	Settings      *settings.Config      `ocisConfig:"settings"`
	Storage       *storage.Config       `ocisConfig:"storage"`
	Store         *store.Config         `ocisConfig:"store"`
	Thumbnails    *thumbnails.Config    `ocisConfig:"thumbnails"`
	WebDAV        *webdav.Config        `ocisConfig:"webdav"`
}

Config combines all available configuration parts.

func DefaultConfig added in v1.16.0

func DefaultConfig() *Config

func New

func New() *Config

New initializes a new configuration with or without defaults.

type Mode

type Mode int

type Runtime

type Runtime struct {
	Port       string `ocisConfig:"port"`
	Host       string `ocisConfig:"host"`
	Extensions string `ocisConfig:"extensions"`
}

Runtime configures the oCIS runtime when running in supervised mode.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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