Documentation
¶
Overview ¶
Package services provides a message type for advertising what kinds of exit services a peer provides to clients, including the port number and the cost per megabyte of data.
Index ¶
- Constants
- func Gen() codec.Codec
- func ServiceSplice(s *splice.Splice, id nonce.ID, key *crypto.Pub, services []Service, ...)
- type Ad
- func (x *Ad) Decode(s *splice.Splice) (e error)
- func (x *Ad) Encode(s *splice.Splice) (e error)
- func (x *Ad) Len() int
- func (x *Ad) Magic() string
- func (x *Ad) Sign(prv *crypto.Prv) (e error)
- func (x *Ad) Splice(s *splice.Splice)
- func (x *Ad) SpliceNoSig(s *splice.Splice)
- func (x *Ad) Unwrap() interface{}
- func (x *Ad) Validate() (valid bool)
- type Service
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ad ¶
type Ad struct { // Embed ad.Ad for the common fields ad.Ad // Services available on the relay identified by the public key. 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 (*Ad) Len ¶
Len returns the length of the binary encoded Ad.
This gives different values depending on how many services are listed.
func (*Ad) SpliceNoSig ¶
SpliceNoSig serializes the Ad but stops at the signature.