Documentation
¶
Overview ¶
Package confirmation provides an onion message type that simply returns a confirmation for an associated nonce.ID of a previous message that we want to confirm was received.
Index ¶
- Constants
- func Gen() codec.Codec
- func New(id nonce.ID) ont.Onion
- type Confirmation
- func (x *Confirmation) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
- func (x *Confirmation) Decode(s *splice.Splice) (e error)
- func (x *Confirmation) Encode(s *splice.Splice) (e error)
- func (x *Confirmation) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)
- func (x *Confirmation) Len() int
- func (x *Confirmation) Magic() string
- func (x *Confirmation) Unwrap() interface{}
- func (x *Confirmation) Wrap(inner ont.Onion)
Constants ¶
const ( Magic = "conf" Len = magic.Len + nonce.IDLen )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Confirmation ¶
Confirmation is simply a nonce that associates with a pending circuit transmission.
If a reply is required there needs to be a RoutingHeader and cipher/nonce set.
func (*Confirmation) Account ¶
func (x *Confirmation) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
Account simply records the message ID, which will be recognised in the pending responses cache.
func (*Confirmation) Decode ¶
func (x *Confirmation) Decode(s *splice.Splice) (e error)
Decode a splice.Splice's next bytes into a Confirmation.
func (*Confirmation) Encode ¶
func (x *Confirmation) Encode(s *splice.Splice) (e error)
Encode a Balance into a splice.Splice's next bytes.
func (*Confirmation) Handle ¶
Handle searches for a pending response and if it matches, runs the stored callbacks attached to it.
func (*Confirmation) Len ¶
func (x *Confirmation) Len() int
Len returns the length of bytes required to encode the Confirmation.
func (*Confirmation) Magic ¶
func (x *Confirmation) Magic() string
Magic bytes that identify this message
func (*Confirmation) Unwrap ¶
func (x *Confirmation) Unwrap() interface{}
Unwrap returns nothing because there isn't an onion inside a Confirmation.
func (*Confirmation) Wrap ¶
func (x *Confirmation) Wrap(inner ont.Onion)
Wrap is a no-op because a Confirmation is terminal.