settings

package
v1.5.20 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CServiceName  = "HLS"
	CTitlePattern = "go-peer/hidden-lake-service"
)
View Source
const (
	CServiceMask = uint32(0x1750571)
	CNetworkMask = uint64(0x676F2D7065657201)
)
View Source
const (
	CPathCFG = "hls.cfg"
	CPathDB  = "hls.db"
)
View Source
const (
	CHeaderPublicKey    = "Hl-Service-Public-Key"
	CHeaderResponseMode = "Hl-Service-Response-Mode"
)
View Source
const (
	CHeaderResponseModeON  = "on" // default
	CHeaderResponseModeOFF = "off"
)
View Source
const (
	CRetryEnqueue = 2
	CFetchTimeout = time.Minute
)
View Source
const (
	CDefaultMessageSize      = (8 << 10) // 8KiB
	CDefaultWorkSize         = 20        // bits
	CDefaultKeySize          = 4096      // bits
	CDefaultQueuePeriod      = 5000      // 5seconds
	CDefaultLimitVoidSize    = (4 << 10) // 4KiB
	CDefaultMessagesCapacity = 2048      // messages
)
View Source
const (
	CDefaultTCPAddress  = "127.0.0.1:9571"
	CDefaultHTTPAddress = "127.0.0.1:9572"
)
View Source
const (
	CDefaultServiceHLTAddress = "127.0.0.1:9582"
	CDefaultServiceHLMAddress = "127.0.0.1:9592"
)
View Source
const (
	CQueueCapacity     = (1 << 6) // messages in queue
	CQueuePoolCapacity = (1 << 5) // generated fake messages
)
View Source
const (
	CNetworkCapacity = (1 << 10) // 1024 hashes
	CNetworkMaxConns = (1 << 8)  // 256 conns
)
View Source
const (
	CConnWaitReadDeadline = time.Hour
	CConnKeeperDuration   = 10 * time.Second
)
View Source
const (
	CHandleIndexPath          = "/api/index"
	CHandleConfigSettingsPath = "/api/config/settings"
	CHandleConfigConnectsPath = "/api/config/connects"
	CHandleConfigFriendsPath  = "/api/config/friends"
	CHandleNetworkOnlinePath  = "/api/network/online"
	CHandleNetworkRequestPath = "/api/network/request"
	CHandleNetworkMessagePath = "/api/network/message"
	CHandleNetworkKeyPath     = "/api/network/key"
	CHandleNodeKeyPath        = "/api/node/key"
)
View Source
const (
	CHandleIndexTemplate          = "%s" + CHandleIndexPath
	CHandleConfigSettingsTemplate = "%s" + CHandleConfigSettingsPath
	CHandleConfigConnectsTemplate = "%s" + CHandleConfigConnectsPath
	CHandleConfigFriendsTemplate  = "%s" + CHandleConfigFriendsPath
	CHandleNetworkOnlineTemplate  = "%s" + CHandleNetworkOnlinePath
	CHandleNetworkRequestTemplate = "%s" + CHandleNetworkRequestPath
	CHandleNetworkMessageTemplate = "%s" + CHandleNetworkMessagePath
	CHandleNetworkKeyTemplate     = "%s" + CHandleNetworkKeyPath
	CHandleNodeKeyTemplate        = "%s" + CHandleNodeKeyPath
)

Variables

This section is empty.

Functions

func GetConnDeadline added in v1.5.19

func GetConnDeadline(pQueuePeriod time.Duration) time.Duration

func InitClient

func InitClient(pSett message.ISettings, pPrivKey asymmetric.IPrivKey) client.IClient

Types

type SFriend

type SFriend struct {
	FAliasName string `json:"alias_name"`
	FPublicKey string `json:"public_key"`
}

type SPrivKey

type SPrivKey struct {
	FSessionKey string `json:"session_key,omitempty"`
	FPrivKey    string `json:"priv_key"`
}

type SRequest added in v1.5.6

type SRequest struct {
	FReceiver string `json:"receiver"` // alias_name
	FReqData  string `json:"req_data"` // data in hex encode
}

Jump to

Keyboard shortcuts

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