adservices

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Magic      = "svad"
	ServiceLen = slice.Uint16Len + slice.Uint32Len
)

Variables

This section is empty.

Functions

func ServiceSplice

func ServiceSplice(s *splice.Splice, id nonce.ID, key *crypto.Pub, services []Service, expiry time.Time)

Types

type Ad struct {
	adproto.Ad
	Services []Service
}

Ad stores a specification for the fee rate and the service port, which must be a well known port to match with a type of service, eg 80 for web, 53 for DNS, etc. These are also attached to the PeerAd entry via concatenating "/service/N" where N is the index of the entry. A zero value at an index signals to stop scanning for more subsequent values.

func New

func New(id nonce.ID, key *crypto.Prv, services []Service,
	expiry time.Time) (sv *Ad)

New ...

func (*Ad) Decode

func (x *Ad) Decode(s *splice.Splice) (e error)

func (*Ad) Encode

func (x *Ad) Encode(s *splice.Splice) (e error)

func (*Ad) GetOnion

func (x *Ad) GetOnion() interface{}

func (*Ad) Len

func (x *Ad) Len() int

func (*Ad) Magic

func (x *Ad) Magic() string

func (*Ad) Sign

func (x *Ad) Sign(prv *crypto.Prv) (e error)

func (*Ad) Splice

func (x *Ad) Splice(s *splice.Splice)

func (*Ad) SpliceNoSig

func (x *Ad) SpliceNoSig(s *splice.Splice)

func (*Ad) Validate

func (x *Ad) Validate() (valid bool)

type Service

type Service struct {
	Port      uint16
	RelayRate uint32
}

Jump to

Keyboard shortcuts

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