config

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadLogging        = &SConfigError{"load logging"}
	ErrInvalidConfig      = &SConfigError{"invalid config"}
	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 IConfig

type IConfig interface {
	GetLogging() logger.ILogging
	GetSettings() IConfigSettings

	GetConnection() IConnection
}

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 {
	net_message.ISettings
	GetWaitTimeMS() uint64
}

type IConnection

type IConnection interface {
	GetHLTHost() string
	GetSrvHost() string
}

type SConfig

type SConfig struct {
	FSettings *SConfigSettings `yaml:"settings"`

	FLogging    []string     `yaml:"logging,omitempty"`
	FConnection *SConnection `yaml:"connection"`
	// contains filtered or unexported fields
}

func (*SConfig) GetConnection

func (p *SConfig) GetConnection() IConnection

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 {
	FWorkSizeBits uint64 `json:"work_size_bits,omitempty" yaml:"work_size_bits,omitempty"`
	FNetworkKey   string `json:"network_key,omitempty" yaml:"network_key,omitempty"`
	FWaitTimeMS   uint64 `json:"wait_time_ms" yaml:"wait_time_ms"`
}

func (*SConfigSettings) GetNetworkKey

func (p *SConfigSettings) GetNetworkKey() string

func (*SConfigSettings) GetWaitTimeMS

func (p *SConfigSettings) GetWaitTimeMS() uint64

func (*SConfigSettings) GetWorkSizeBits

func (p *SConfigSettings) GetWorkSizeBits() uint64

type SConnection

type SConnection struct {
	FHLTHost string `yaml:"hlt_host"`
	FSrvHost string `yaml:"srv_host"`
}

func (*SConnection) GetHLTHost

func (p *SConnection) GetHLTHost() string

func (*SConnection) GetSrvHost

func (p *SConnection) GetSrvHost() string

Jump to

Keyboard shortcuts

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