config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllServices

func AllServices() map[string]ServiceConfig

func DatabasePath

func DatabasePath() string

func DefaultConfigDir

func DefaultConfigDir() string

func InitConfig

func InitConfig(cfgFile string) error

initConfig reads in config file and ENV variables if set.

func ValidateKey

func ValidateKey(key string) error

func WriteConfig

func WriteConfig(removedKeys ...string) error

Write the configuration except for removedKeys

Types

type ServiceConfig

type ServiceConfig struct {
	Name         string
	Backend      string
	ConfigValues map[string]any
}

func GetService

func GetService(name string) (ServiceConfig, error)

func NewServiceConfig

func NewServiceConfig(name string, config *viper.Viper) ServiceConfig

func (*ServiceConfig) Delete

func (c *ServiceConfig) Delete() error

Deletes the service configuration from the config file

func (*ServiceConfig) GetBool

func (c *ServiceConfig) GetBool(key string, defaultValue bool) bool

func (*ServiceConfig) GetInt added in v0.4.0

func (c *ServiceConfig) GetInt(key string, defaultValue int) int

func (*ServiceConfig) GetString

func (c *ServiceConfig) GetString(key string) string

func (*ServiceConfig) IsSet

func (c *ServiceConfig) IsSet(key string) bool

func (*ServiceConfig) Save

func (c *ServiceConfig) Save() error

func (ServiceConfig) String

func (c ServiceConfig) String() string

type ServiceList

type ServiceList []ServiceConfig

func AllServicesAsList

func AllServicesAsList() ServiceList

func (ServiceList) Len

func (l ServiceList) Len() int

func (ServiceList) Less

func (l ServiceList) Less(i, j int) bool

func (ServiceList) Swap

func (l ServiceList) Swap(i, j int)

Jump to

Keyboard shortcuts

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