legacyhost

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 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 Address

type Address struct {
	net.UDPAddr
}

Address is host's real network address.

func NewAddress

func NewAddress(address string) (Address, error)

NewAddress is constructor.

func (Address) Equal

func (address Address) Equal(other Address) bool

Equal checks if address is equal to another.

func (Address) IsZero

func (address Address) IsZero() bool

type Host

type Host struct {
	// NodeID is unique identifier of the node
	NodeID reference.Global
	// ShortID is shortened unique identifier of the node inside the globe
	ShortID node.ShortNodeID
	// Address is IP and port.
	Address Address
}

Host is the over-the-wire representation of a host.

func NewHost

func NewHost(address string) (*Host, error)

NewHost creates a new Host with specified physical address.

func NewHostN

func NewHostN(address string, nodeID reference.Global) (*Host, error)

NewHostN creates a new Host with specified physical address and NodeID.

func NewHostNS

func NewHostNS(address string, nodeID reference.Global, shortID node.ShortNodeID) (*Host, error)

NewHostNS creates a new Host with specified physical address, NodeID and ShortID.

func (Host) Equal

func (host Host) Equal(other Host) bool

Equal checks if host equals to other host (e.g. hosts' IDs and network addresses match).

func (*Host) Marshal

func (host *Host) Marshal() ([]byte, error)

func (*Host) MarshalTo

func (host *Host) MarshalTo(data []byte) (int, error)

func (*Host) ProtoSize

func (host *Host) ProtoSize() int

func (*Host) Size

func (host *Host) Size() int

func (Host) String

func (host Host) String() string

String representation of Host.

func (*Host) Unmarshal

func (host *Host) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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