confirmation

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 9 Imported by: 0

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

View Source
const (
	Magic = "conf"
	Len   = magic.Len + nonce.IDLen
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function to generate an Ad.

func New

func New(id nonce.ID) ont.Onion

New creates a new Confirmation.

Types

type Confirmation

type Confirmation struct {

	// ID of the request this response relates to.
	ID nonce.ID
}

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

func (x *Confirmation) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)

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.

Jump to

Keyboard shortcuts

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