config

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfig      = &SConfigError{"invalid config"}
	ErrLoadLogging        = &SConfigError{"load logging"}
	ErrInvalidLogging     = &SConfigError{"invalid logging"}
	ErrLoadLanguage       = &SConfigError{"load language"}
	ErrToLanguage         = &SConfigError{"to language"}
	ErrInitConfig         = &SConfigError{"init config"}
	ErrDeserializeConfig  = &SConfigError{"deserialize config"}
	ErrReadConfig         = &SConfigError{"read config"}
	ErrConfigNotExist     = &SConfigError{"config not exist"}
	ErrWriteConfig        = &SConfigError{"write config"}
	ErrConfigAlreadyExist = &SConfigError{"config already exist"}
)

Functions

This section is empty.

Types

type IAddress

type IAddress interface {
	GetInternal() string
	GetExternal() string
}

type IConfig

type IConfig interface {
	GetSettings() IConfigSettings
	GetAddress() IAddress
	GetLogging() logger.ILogging
	GetConnection() string
}

func BuildConfig

func BuildConfig(pFilepath string, pCfg *SConfig) (IConfig, error)

func InitConfig

func InitConfig(cfgPath string, initCfg *SConfig) (IConfig, error)

func LoadConfig

func LoadConfig(pFilepath string) (IConfig, error)

type IConfigSettings

type IConfigSettings interface {
	GetRetryNum() uint64
	GetPageOffset() uint64
	GetLanguage() language.ILanguage
}

type IEditor

type IEditor interface {
	UpdateLanguage(language.ILanguage) error
}

type IWrapper

type IWrapper interface {
	GetConfig() IConfig
	GetEditor() IEditor
}

func NewWrapper

func NewWrapper(pCfg IConfig) IWrapper

type SAddress

type SAddress struct {
	FInternal string `yaml:"internal"`
	FExternal string `yaml:"external,omitempty"`
}

func (*SAddress) GetExternal added in v1.8.3

func (p *SAddress) GetExternal() string

func (*SAddress) GetInternal added in v1.8.3

func (p *SAddress) GetInternal() string

type SConfig

type SConfig struct {
	FSettings   *SConfigSettings `yaml:"settings"`
	FLogging    []string         `yaml:"logging,omitempty"`
	FAddress    *SAddress        `yaml:"address"`
	FConnection string           `yaml:"connection"`
	// contains filtered or unexported fields
}

func (*SConfig) GetAddress

func (p *SConfig) GetAddress() IAddress

func (*SConfig) GetConnection

func (p *SConfig) GetConnection() string

func (*SConfig) GetLogging

func (p *SConfig) GetLogging() logger.ILogging

func (*SConfig) GetSettings

func (p *SConfig) GetSettings() IConfigSettings

type SConfigError

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

func (*SConfigError) Error

func (err *SConfigError) Error() string

type SConfigSettings

type SConfigSettings struct {
	FPageOffset uint64 `json:"page_offset" yaml:"page_offset"`
	FRetryNum   uint64 `json:"retry_num,omitempty" yaml:"retry_num,omitempty"`
	FLanguage   string `json:"language,omitempty" yaml:"language,omitempty"`
	// contains filtered or unexported fields
}

func (*SConfigSettings) GetLanguage

func (p *SConfigSettings) GetLanguage() language.ILanguage

func (*SConfigSettings) GetPageOffset

func (p *SConfigSettings) GetPageOffset() uint64

func (*SConfigSettings) GetRetryNum

func (p *SConfigSettings) GetRetryNum() uint64

Jump to

Keyboard shortcuts

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