peer

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseNonce

func MustParseNonce(nonce string) byte

func NewNonce

func NewNonce() string

Types

type ControlCode added in v0.6.2

type ControlCode uint8
const (
	CONTROL_RELAY                 ControlCode = 0
	CONTROL_NEW_PEER              ControlCode = 1
	CONTROL_NEW_PEER_UDP_ADDR     ControlCode = 2
	CONTROL_LEAD_DISCO            ControlCode = 3
	CONTROL_UPDATE_NETWORK_SECRET ControlCode = 20
	CONTROL_CONN                  ControlCode = 30
)

func (ControlCode) Byte added in v0.6.2

func (code ControlCode) Byte() byte

func (ControlCode) String added in v0.6.2

func (code ControlCode) String() string

type Error added in v0.6.0

type Error struct {
	Code int
	Msg  string
}

func (Error) Error added in v0.6.0

func (e Error) Error() string

func (Error) MarshalTo added in v0.6.0

func (e Error) MarshalTo(w io.Writer)

func (Error) Wrap added in v0.6.0

func (e Error) Wrap(err error) Error

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 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 Peermap added in v0.6.0

type Peermap struct {
	// contains filtered or unexported fields
}

func NewPeermap added in v0.6.0

func NewPeermap(server *url.URL, store SecretStore) (*Peermap, error)

func NewPeermapURL added in v0.6.0

func NewPeermapURL(serverURL string, store SecretStore) (*Peermap, error)

func (*Peermap) SecretStore added in v0.6.0

func (s *Peermap) SecretStore() SecretStore

func (*Peermap) String added in v0.6.0

func (s *Peermap) String() string

type SecretStore added in v0.1.0

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

Jump to

Keyboard shortcuts

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