config

package
v1.5.18 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 10 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
}

type IConfig

type IConfig interface {
	GetSettings() IConfigSettings
	GetLogging() logger.ILogging
	GetAddress() IAddress
	GetNetworkKey() string
	GetConnections() []string
	GetFriends() map[string]asymmetric.IPubKey
	GetService(string) (string, 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

	GetKeySizeBits() uint64
	GetQueuePeriodMS() uint64
	GetLimitVoidSizeBytes() uint64
}

type IEditor

type IEditor interface {
	UpdateNetworkKey(string) error
	UpdateConnections([]string) error
	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 {
	FTCP  string `json:"tcp,omitempty"`
	FHTTP string `json:"http,omitempty"`
}

func (*SAddress) GetHTTP added in v1.5.6

func (p *SAddress) GetHTTP() string

func (*SAddress) GetTCP added in v1.5.6

func (p *SAddress) GetTCP() string

type SConfig

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

	FLogging     []string          `json:"logging,omitempty"`
	FAddress     *SAddress         `json:"address,omitempty"`
	FNetworkKey  string            `json:"network_key,omitempty"`
	FConnections []string          `json:"connections,omitempty"`
	FServices    map[string]string `json:"services,omitempty"`
	FFriends     map[string]string `json:"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) 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) GetNetworkKey added in v1.5.16

func (p *SConfig) GetNetworkKey() string

func (*SConfig) GetService added in v1.5.6

func (p *SConfig) GetService(name string) (string, 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"`
	FWorkSizeBits       uint64 `json:"work_size_bits"`
	FQueuePeriodMS      uint64 `json:"queue_period_ms"`
	FKeySizeBits        uint64 `json:"key_size_bits"`
	FLimitVoidSizeBytes uint64 `json:"limit_void_size_bytes,omitempty"`
}

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) 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 STraffic

type STraffic struct {
	FDownload []string `json:"download,omitempty"`
	FUpload   []string `json:"upload,omitempty"`
}

func (*STraffic) GetDownload added in v1.5.6

func (p *STraffic) GetDownload() []string

func (*STraffic) GetUpload added in v1.5.6

func (p *STraffic) GetUpload() []string

Jump to

Keyboard shortcuts

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