settings

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 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 (
	CPathCFG = "hls.cfg"
	CPathDB  = "hls.db"
)
View Source
const (
	CHeaderPubKey  = "Service-Public-Key"
	CHeaderMsgHash = "Service-Message-Hash"
	CNetworkMask   = 0x676F2D7065657201
)
View Source
const (
	CRetryEnqueue = 2
	CWaitTime     = time.Minute
)
View Source
const (
	CQueueCapacity     = (1 << 6) // messages in queue
	CQueuePullCapacity = (1 << 5) // generated fake messages
	CQueueDuration     = 5 * time.Second
)
View Source
const (
	CAKeySize        = 4096
	CNetworkCapacity = (1 << 10) // hashes
	CNetworkMaxConns = 10
	CWorkSize        = 20        // bits
	CMessageSize     = (1 << 20) // 1MiB
	CMaxVoidSize     = (1 << 20) // 1MiB
	CNetworkWaitTime = 10 * time.Second
)
View Source
const (
	CHandleIndexPath          = "/api/index"
	CHandleConfigConnectsPath = "/api/config/connects"
	CHandleConfigFriendsPath  = "/api/config/friends"
	CHandleNetworkOnlinePath  = "/api/network/online"
	CHandleNetworkRequestPath = "/api/network/request"
	CHandleNodeKeyPath        = "/api/node/key"
)
View Source
const (
	CHandleIndexTemplate          = "%s" + CHandleIndexPath
	CHandleConfigConnectsTemplate = "%s" + CHandleConfigConnectsPath
	CHandleConfigFriendsTemplate  = "%s" + CHandleConfigFriendsPath
	CHandleNetworkOnlineTemplate  = "%s" + CHandleNetworkOnlinePath
	CHandleNetworkRequestTemplate = "%s" + CHandleNetworkRequestPath
	CHandleNodeKeyTemplate        = "%s" + CHandleNodeKeyPath
)
View Source
const (
	CErrorNone = iota + 1
	CErrorMethod
	CErrorDecode
	CErrorPubKey
	CErrorPrivKey
	CErrorMessage
	CErrorResponse
	CErrorBroadcast
	CErrorExist
	CErrorNotExist
	CErrorAction
	CErrorValue
	CErrorOpen
	CErrorRead
	CErrorWrite
	CErrorSize
	CErrorUnauth
)
View Source
const (
	CHeaderHLS = uint32(0x1750571)
)

Variables

This section is empty.

Functions

func InitClient

func InitClient(pPrivKey asymmetric.IPrivKey) client.IClient

Types

type SConnect

type SConnect struct {
	FConnect string `json:"connect"`
}

type SFriend

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

type SPrivKey

type SPrivKey struct {
	FPrivKey string `json:"priv_key"`
}

type SRequest added in v1.5.6

type SRequest struct {
	FReceiver string `json:"receiver"` // public key
	FHexData  string `json:"hex_data"` // data in hex encode
}

Jump to

Keyboard shortcuts

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