Documentation
¶
Overview ¶
Package config implements the config interface for the viper config backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Databases []Database Zitadel ZitadelConfig `mapstructure:"zitadel"` Env string `mapstructure:"env"` JwtSecretKey string `mapstructure:"jwt_secret_key"` TimeZone string `mapstructure:"timezone"` }
Config represents the overall configuration structure
type Database ¶
type Database struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` Type string `mapstructure:"type"` Name string `mapstructure:"name"` Database string `mapstructure:"database"` }
Database holds the configuration for database connections
type Settings ¶
type Settings struct { Id string `bson:"id,omitempty" json:"id"` Inventory struct { DefaultInventoryQuantityWarn float64 `json:"default_inventory_quantity_warn" bson:"default_inventory_quantity_warn"` } `bson:"inventory" json:"inventory"` Orders struct { Queues []struct { Prefix string `json:"prefix" bson:"prefix"` Next uint32 `json:"next" bson:"next"` } `json:"queues" bson:"queues"` } `bson:"orders" json:"orders"` }
Settings represents the configuration settings structure
func (*Settings) LoadFromDB ¶
LoadFromDB loads settings from the database using the provided Config
type ViperConfig ¶
type ViperConfig struct {
// contains filtered or unexported fields
}
ViperConfig is the viper config backend.
func NewViperConfig ¶
func NewViperConfig(logger logger.ILogger) *ViperConfig
NewViperConfig creates a new viper config backend.
func (*ViperConfig) GetConfig ¶
func (vc *ViperConfig) GetConfig() (Config, error)
GetConfig reads the config file and unmarshals it into the config struct.
func (*ViperConfig) ReadFile ¶
func (vc *ViperConfig) ReadFile(path string)
ReadFile reads the config file from the path.
type ZitadelConfig ¶
type ZitadelConfig struct { Domain string `mapstructure:"domain"` Port uint8 `mapstructure:"port"` KeyPath string `mapstructure:"key_path"` }
ZitadelConfig holds the configuration for Zitadel
Click to show internal directories.
Click to hide internal directories.