config

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 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"}
	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"}
	ErrDuplicatePublicKey = &SConfigError{"duplicate public key"}
	ErrInvalidPublicKey   = &SConfigError{"invalid public key"}
	ErrLoadPublicKey      = &SConfigError{"load public key"}
	ErrLoadConfig         = &SConfigError{"load config"}
	ErrRebuildConfig      = &SConfigError{"rebuild config"}
	ErrNetworkNotFound    = &SConfigError{"network not found"}
	ErrBuildConfig        = &SConfigError{"build config"}
)

Functions

This section is empty.

Types

type IAddress

type IAddress interface {
	GetHTTP() string
	GetPPROF() string
}

type IConfig

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

	GetAddress() IAddress
	GetFriends() map[string]asymmetric.IPubKey
}

func BuildConfig

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

func InitConfig

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

func LoadConfig

func LoadConfig(pFilepath string) (IConfig, error)

type IConfigSettings

type IConfigSettings interface {
	net_message.ISettings

	GetMessageSizeBytes() uint64
}

type IEditor

type IEditor interface {
	UpdateFriends(map[string]asymmetric.IPubKey) error
}

type IWrapper

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

func NewWrapper

func NewWrapper(pCfg IConfig) IWrapper

type SAddress

type SAddress struct {
	FHTTP  string `yaml:"http"`
	FPPROF string `yaml:"pprof,omitempty"`
}

func (*SAddress) GetHTTP

func (p *SAddress) GetHTTP() 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"`
	FFriends  map[string]string `yaml:"friends,omitempty"`
	// contains filtered or unexported fields
}

func (*SConfig) GetAddress

func (p *SConfig) GetAddress() IAddress

func (*SConfig) GetFriends

func (p *SConfig) GetFriends() map[string]asymmetric.IPubKey

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

func (*SConfigSettings) GetEncKeySizeBytes

func (p *SConfigSettings) GetEncKeySizeBytes() uint64

func (*SConfigSettings) GetMessageSizeBytes

func (p *SConfigSettings) GetMessageSizeBytes() uint64

func (*SConfigSettings) GetNetworkKey

func (p *SConfigSettings) GetNetworkKey() 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