config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

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"`
}

func ConfigFactory

func ConfigFactory(t string, path string, logger logger.ILogger) Config

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"`
}

type IConfig

type IConfig interface {
	ReadFile(path string)
	GetConfig() (config Config)
}

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"`
}

func (*Settings) LoadFromDB

func (s *Settings) LoadFromDB(config Config) error

type ViperConfig

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

func NewViperConfig

func NewViperConfig(logger logger.ILogger) *ViperConfig

func (*ViperConfig) GetConfig

func (vc *ViperConfig) GetConfig() (Config, error)

func (*ViperConfig) ReadFile

func (vc *ViperConfig) ReadFile(path string)

type ZitadelConfig

type ZitadelConfig struct {
	Domain  string `mapstructure:"domain"`
	Port    uint8  `mapstructure:"port"`
	KeyPath string `mapstructure:"key_path"`
}

Jump to

Keyboard shortcuts

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