adproto

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Magic = "prot"
	Len   = magic.Len +
		nonce.IDLen +
		crypto.PubKeyLen +
		slice.Uint64Len +
		crypto.SigLen
	TTL = time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ad struct {
	ID     nonce.ID // To ensure no repeating message
	Key    *crypto.Pub
	Expiry time.Time
	Sig    crypto.SigBytes
}

Ad entries are stored with an index generated by concatenating the bytes of the public key with a string path "/address/N" where N is the index of the address. This means hidden service introducers for values over zero. Hidden services have no value in the zero index, which is "<hash>/address/0".

func NewProtoAd

func NewProtoAd(id nonce.ID, key *crypto.Prv,
	expiry time.Time) (protoAd *Ad)

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) Gossip

func (x *Ad) Gossip(sm *sess.Manager, c qu.C)

func (*Ad) Len

func (x *Ad) Len() int

func (*Ad) Magic

func (x *Ad) Magic() string

func (*Ad) Splice

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

func (*Ad) SpliceWithoutSig

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

func (*Ad) Validate

func (x *Ad) Validate() bool

Jump to

Keyboard shortcuts

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