config

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfig      = &SConfigError{"invalid config"}
	ErrLoadLogging        = &SConfigError{"load 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 {
	GetInterface() string
	GetIncoming() string
	GetPPROF() 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 {
	GetMessagesCapacity() uint64
	GetWorkSizeBits() uint64
	GetStorageKey() string
	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 {
	FInterface string `yaml:"interface"`
	FIncoming  string `yaml:"incoming"`
	FPPROF     string `yaml:"pprof,omitempty"`
}

func (*SAddress) GetIncoming

func (p *SAddress) GetIncoming() string

func (*SAddress) GetInterface

func (p *SAddress) GetInterface() string

func (*SAddress) GetPPROF

func (p *SAddress) GetPPROF() 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 added in v1.6.8

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

func (*SConfigError) Error added in v1.6.8

func (err *SConfigError) Error() string

type SConfigSettings

type SConfigSettings struct {
	FMessagesCapacity uint64 `yaml:"messages_capacity"`
	FWorkSizeBits     uint64 `yaml:"work_size_bits,omitempty"`
	FStorageKey       string `yaml:"storage_key,omitempty"`
	FLanguage         string `yaml:"language,omitempty"`
	// contains filtered or unexported fields
}

func (*SConfigSettings) GetLanguage added in v1.6.3

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

func (*SConfigSettings) GetMessagesCapacity

func (p *SConfigSettings) GetMessagesCapacity() uint64

func (*SConfigSettings) GetStorageKey added in v1.6.3

func (p *SConfigSettings) GetStorageKey() string

func (*SConfigSettings) GetWorkSizeBits

func (p *SConfigSettings) GetWorkSizeBits() uint64

Jump to

Keyboard shortcuts

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