config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_LOG_LEVEL = "info"
)

Variables

This section is empty.

Functions

func NewErrUnknownLogLevel

func NewErrUnknownLogLevel(level string) error

Types

type Config

type Config struct {
	LogLevel   string                    `yaml:"logLevel,omitempty"`
	Kubeconfig string                    `yaml:"kubeconfig,omitempty"`
	Server     *server.ServerConfig      `yaml:"server,omitempty"`
	Storage    lockmanager.StorageConfig `yaml:"storage,omitempty"`
	Groups     lockmanager.Groups        `yaml:"groups,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(path string, env bool) (*Config, error)

Loads the config from the given path. When path is empty, returns default config. Returns error when the given config is invalid.

func (*Config) Defaults

func (c *Config) Defaults()

func (*Config) Validate

func (c *Config) Validate() error

type ErrUnknownLogLevel

type ErrUnknownLogLevel struct {
	// contains filtered or unexported fields
}

func (*ErrUnknownLogLevel) Error

func (e *ErrUnknownLogLevel) Error() string

Jump to

Keyboard shortcuts

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