config

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 8 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 {
	GetNetwork() string
	GetLogging() logger.ILogging
	GetAddress() IAddress
	GetConnections() []string
	GetFriends() map[string]asymmetric.IPubKey
	GetService(string) (string, bool)
}

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 IEditor

type IEditor interface {
	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

func (p *SAddress) GetHTTP() string

func (*SAddress) GetTCP

func (p *SAddress) GetTCP() string

type SConfig

type SConfig struct {
	FNetwork string `json:"network,omitempty"`

	FAddress *SAddress `json:"address,omitempty"`
	FLogging []string  `json:"logging,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

func (p *SConfig) GetAddress() IAddress

func (*SConfig) GetConnections

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

func (*SConfig) GetFriends

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

func (*SConfig) GetLogging

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

func (*SConfig) GetNetwork

func (p *SConfig) GetNetwork() string

func (*SConfig) GetService

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

type STraffic

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

func (*STraffic) GetDownload

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

func (*STraffic) GetUpload

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

Jump to

Keyboard shortcuts

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