id

package
v0.12.18-rc6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: ISC Imports: 4 Imported by: 7

Documentation

Index

Constants

View Source
const IDLength = 16

IDLength of array used to store the ID.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

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

ID identifies a network connection

func FromBytes

func FromBytes(serializedID []byte) (*ID, error)

FromBytes returns an ID deserialized from the given byte slice.

func GenerateID

func GenerateID() (*ID, error)

GenerateID generates a new ID

func (*ID) Deserialize

func (id *ID) Deserialize(r io.Reader) error

Deserialize decodes a block from r into the receiver.

func (*ID) IsEqual

func (id *ID) IsEqual(other *ID) bool

IsEqual returns whether id equals to other.

func (*ID) Serialize

func (id *ID) Serialize(w io.Writer) error

Serialize serializes the receiver into the given writer.

func (*ID) SerializeToBytes

func (id *ID) SerializeToBytes() ([]byte, error)

SerializeToBytes serializes the receiver and returns a byte slice of the serialized id.

func (*ID) String

func (id *ID) String() string

Jump to

Keyboard shortcuts

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