peer

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTROL_RELAY                 = 0
	CONTROL_NEW_PEER              = 1
	CONTROL_NEW_PEER_UDP_ADDR     = 2
	CONTROL_LEAD_DISCO            = 3
	CONTROL_UPDATE_NETWORK_SECRET = 20
)

Variables

This section is empty.

Functions

func MustParseNonce

func MustParseNonce(nonce string) byte

func NewNonce

func NewNonce() string

Types

type FileSecretStore added in v0.1.0

type FileSecretStore struct {
	StoreFilePath string
}

func (*FileSecretStore) NetworkSecret added in v0.1.0

func (s *FileSecretStore) NetworkSecret() (NetworkSecret, error)

func (*FileSecretStore) UpdateNetworkSecret added in v0.1.0

func (s *FileSecretStore) UpdateNetworkSecret(secret NetworkSecret) error

type ID added in v0.2.0

type ID string

func (ID) Bytes added in v0.2.0

func (id ID) Bytes() []byte

func (ID) Len added in v0.2.0

func (id ID) Len() byte

func (ID) Network added in v0.2.0

func (id ID) Network() string

func (ID) String added in v0.2.0

func (id ID) String() string

type Metadata added in v0.0.2

type Metadata struct {
	SilenceMode bool           `json:"silenceMode"`
	Alias1      string         `json:"alias1"`
	Alias2      string         `json:"alias2"`
	Extra       map[string]any `json:"extra"`
}

func (Metadata) MustMarshalJSON added in v0.0.2

func (meta Metadata) MustMarshalJSON() []byte

type NetworkSecret

type NetworkSecret struct {
	Secret  string    `json:"secret"`
	Network string    `json:"network"`
	Expire  time.Time `json:"expire"`
}

func (NetworkSecret) Expired added in v0.1.0

func (s NetworkSecret) Expired() bool

func (*NetworkSecret) NetworkSecret added in v0.1.0

func (s *NetworkSecret) NetworkSecret() (NetworkSecret, error)

func (*NetworkSecret) UpdateNetworkSecret added in v0.1.0

func (s *NetworkSecret) UpdateNetworkSecret(secret NetworkSecret) error

type SecretStore added in v0.1.0

type SecretStore interface {
	NetworkSecret() (NetworkSecret, error)
	UpdateNetworkSecret(NetworkSecret) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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