config

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAddress

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

type IConfig

type IConfig interface {
	GetSettings() IConfigSettings
	GetLogging() logger.ILogging
	GetAddress() IAddress
	GetF2FDisabled() bool
	GetFriends() map[string]asymmetric.IPubKey
	GetConnections() []string
	GetService(string) (IService, bool)
}

func BuildConfig added in v1.5.6

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

func InitConfig added in v1.5.14

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

func LoadConfig

func LoadConfig(pFilepath string) (IConfig, error)

type IConfigSettings added in v1.5.18

type IConfigSettings interface {
	message.ISettings
	net_message.ISettings

	GetQueuePeriodMS() uint64
	GetLimitVoidSizeBytes() uint64
}

type IEditor

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

type IService added in v1.5.24

type IService interface {
	GetHost() string
	GetShare() bool
}

type IWrapper

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

func NewWrapper

func NewWrapper(pCfg IConfig) IWrapper

type SAddress

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

func (*SAddress) GetHTTP added in v1.5.6

func (p *SAddress) GetHTTP() string

func (*SAddress) GetPPROF added in v1.5.19

func (p *SAddress) GetPPROF() string

func (*SAddress) GetTCP added in v1.5.6

func (p *SAddress) GetTCP() string

type SConfig

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

	FLogging     []string             `yaml:"logging,omitempty"`
	FAddress     *SAddress            `yaml:"address,omitempty"`
	FF2FDisabled bool                 `yaml:"f2f_disabled,omitempty"`
	FServices    map[string]*SService `yaml:"services,omitempty"`
	FConnections []string             `yaml:"connections,omitempty"`
	FFriends     map[string]string    `yaml:"friends,omitempty"`
	// contains filtered or unexported fields
}

func (*SConfig) GetAddress added in v1.5.6

func (p *SConfig) GetAddress() IAddress

func (*SConfig) GetConnections added in v1.5.6

func (p *SConfig) GetConnections() []string

func (*SConfig) GetF2FDisabled added in v1.5.27

func (p *SConfig) GetF2FDisabled() bool

func (*SConfig) GetFriends added in v1.5.6

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

func (*SConfig) GetLogging added in v1.5.6

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

func (*SConfig) GetService added in v1.5.6

func (p *SConfig) GetService(name string) (IService, bool)

func (*SConfig) GetSettings added in v1.5.18

func (p *SConfig) GetSettings() IConfigSettings

type SConfigSettings added in v1.5.18

type SConfigSettings struct {
	FMessageSizeBytes   uint64 `json:"message_size_bytes" yaml:"message_size_bytes"`
	FQueuePeriodMS      uint64 `json:"queue_period_ms" yaml:"queue_period_ms"`
	FKeySizeBits        uint64 `json:"key_size_bits" yaml:"key_size_bits"`
	FWorkSizeBits       uint64 `json:"work_size_bits,omitempty" yaml:"work_size_bits,omitempty"`
	FLimitVoidSizeBytes uint64 `json:"limit_void_size_bytes,omitempty" yaml:"limit_void_size_bytes,omitempty"`
	FNetworkKey         string `json:"network_key,omitempty" yaml:"network_key,omitempty"`
	// contains filtered or unexported fields
}

func (*SConfigSettings) GetKeySizeBits added in v1.5.18

func (p *SConfigSettings) GetKeySizeBits() uint64

func (*SConfigSettings) GetLimitVoidSizeBytes added in v1.5.18

func (p *SConfigSettings) GetLimitVoidSizeBytes() uint64

func (*SConfigSettings) GetMessageSizeBytes added in v1.5.18

func (p *SConfigSettings) GetMessageSizeBytes() uint64

func (*SConfigSettings) GetNetworkKey added in v1.5.22

func (p *SConfigSettings) GetNetworkKey() string

func (*SConfigSettings) GetQueuePeriodMS added in v1.5.18

func (p *SConfigSettings) GetQueuePeriodMS() uint64

func (*SConfigSettings) GetWorkSizeBits added in v1.5.18

func (p *SConfigSettings) GetWorkSizeBits() uint64

type SService added in v1.5.24

type SService struct {
	FHost  string `yaml:"host,omitempty"`
	FShare bool   `yaml:"share,omitempty"`
}

func (*SService) GetHost added in v1.5.24

func (p *SService) GetHost() string

func (*SService) GetShare added in v1.5.24

func (p *SService) GetShare() bool

Jump to

Keyboard shortcuts

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