config

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 43 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.

Types

type Config

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

	Tracing shared.Tracing `yaml:"tracing"`
	Log     *shared.Log    `yaml:"log"`

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

	Registry     string       `yaml:"registry"`
	TokenManager TokenManager `yaml:"token_manager"`
	Runtime      Runtime      `yaml:"runtime"`

	Audit         *audit.Config         `yaml:"audit"`
	Accounts      *accounts.Config      `yaml:"accounts"`
	GLAuth        *glauth.Config        `yaml:"glauth"`
	Graph         *graph.Config         `yaml:"graph"`
	GraphExplorer *graphExplorer.Config `yaml:"graph_explorer"`
	IDP           *idp.Config           `yaml:"idp"`
	IDM           *idm.Config           `yaml:"idm"`
	Nats          *nats.Config          `yaml:"nats"`
	Notifications *notifications.Config `yaml:"notifications"`
	OCS           *ocs.Config           `yaml:"ocs"`
	Web           *web.Config           `yaml:"web"`
	Proxy         *proxy.Config         `yaml:"proxy"`
	Settings      *settings.Config      `yaml:"settings"`
	Storage       *storage.Config       `yaml:"storage"`
	Store         *store.Config         `yaml:"store"`
	Thumbnails    *thumbnails.Config    `yaml:"thumbnails"`
	WebDAV        *webdav.Config        `yaml:"webdav"`
}

Config combines all available configuration parts.

func DefaultConfig added in v1.16.0

func DefaultConfig() *Config

type Mode

type Mode int

type Runtime

type Runtime struct {
	Port       string `yaml:"port" env:"OCIS_RUNTIME_PORT"`
	Host       string `yaml:"host" env:"OCIS_RUNTIME_HOST"`
	Extensions string `yaml:"extensions" env:"OCIS_RUN_EXTENSIONS"`
}

Runtime configures the oCIS runtime when running in supervised mode.

type TokenManager

type TokenManager struct {
	JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET"`
}

TokenManager is the config for using the reva token manager

Directories

Path Synopsis
Package envdecode is a package for populating structs from environment variables, using struct tags.
Package envdecode is a package for populating structs from environment variables, using struct tags.

Jump to

Keyboard shortcuts

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