config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "otter"

All environment variables will have this prefix unless otherwise defined in struct tags. For example, the conf.LogLevel environment variable will be OTTER_LOG_LEVEL because of this prefix and the split_words struct tag in the conf below.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Maintenance bool                `default:"false" yaml:"maintenance"`
	LogLevel    logger.LevelDecoder `split_words:"true" default:"info" yaml:"log_level"`
	ConsoleLog  bool                `split_words:"true" default:"false" yaml:"console_log"`
	Server      ServerConfig
	Replica     ReplicaConfig
	Web         WebConfig
	// contains filtered or unexported fields
}

Config contains all of the configuration parameters for an otterdb instance and is loaded from the environment or a configuration file with reasonable defaults for values that are omitted. The Config should be validated in preparation for running the otterdb instance to ensure that all server operations work as expected.

func New

func New() (conf Config, err error)

func (Config) GetLogLevel

func (c Config) GetLogLevel() zerolog.Level

func (Config) IsZero

func (c Config) IsZero() bool

Returns true if the config has not been correctly processed from the environment.

func (Config) Validate

func (c Config) Validate() (err error)

Custom validations are added here, particularly validations that require one or more fields to be processed before the validation occurs. NOTE: ensure that all nested config validation methods are called here.

type ReplicaConfig

type ReplicaConfig struct{}

type ServerConfig

type ServerConfig struct{}

type WebConfig

type WebConfig struct{}

Jump to

Keyboard shortcuts

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