Relay

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadKind

func ReadKind(v any) (int, error)

ReadKind extracts the kind discriminator from a CBOR-decoded value. fxamacker/cbor decodes positive integers as uint64 by default, so we must accept both uint64 and int64 here.

Types

type MultiHostName

type MultiHostName struct {
	DnsName string
}

func (MultiHostName) Kind

func (v MultiHostName) Kind() int

func (MultiHostName) MarshalCBOR

func (v MultiHostName) MarshalCBOR() ([]byte, error)

func (*MultiHostName) UnmarshalCBOR

func (v *MultiHostName) UnmarshalCBOR(data []byte) error

type RelayInterface

type RelayInterface interface {
	Kind() int
	MarshalCBOR() ([]byte, error)
}

func UnmarshalRelay

func UnmarshalRelay(data []byte) (RelayInterface, error)

UnmarshalRelay unmarshals CBOR data into the appropriate Relay type based on the kind discriminator. It returns a RelayInterface and an error.

type Relays

type Relays []RelayInterface

func (Relays) MarshalCBOR

func (v Relays) MarshalCBOR() ([]byte, error)

func (*Relays) UnmarshalCBOR

func (v *Relays) UnmarshalCBOR(data []byte) error

type SingleHostAddr

type SingleHostAddr struct {
	Port *uint16
	Ipv4 []byte
	Ipv6 []byte
}

func (SingleHostAddr) Kind

func (v SingleHostAddr) Kind() int

func (SingleHostAddr) MarshalCBOR

func (v SingleHostAddr) MarshalCBOR() ([]byte, error)

func (*SingleHostAddr) UnmarshalCBOR

func (v *SingleHostAddr) UnmarshalCBOR(data []byte) error

type SingleHostName

type SingleHostName struct {
	Port    *uint16
	DnsName string
}

func (SingleHostName) Kind

func (v SingleHostName) Kind() int

func (SingleHostName) MarshalCBOR

func (v SingleHostName) MarshalCBOR() ([]byte, error)

func (*SingleHostName) UnmarshalCBOR

func (v *SingleHostName) UnmarshalCBOR(data []byte) error

Jump to

Keyboard shortcuts

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