session

package
v0.1.18 Latest Latest
Warning

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

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

Documentation

Overview

Package session provides an onion message type that delivers the two session private keys to be associated with a session, for which the hash of the secrets was used as the payment preimage for starting a session.

Topping up sessions does not require following up with this message as the handler finds the session and adjusts the balance according to the payment.

Index

Constants

View Source
const (
	SessionMagic = "sess"
	SessionLen   = magic.Len + nonce.IDLen + crypto.PrvKeyLen*2
)

Variables

This section is empty.

Functions

func NewSession

func NewSession(hop byte) (x ont.Onion)

Types

type Session

type Session struct {
	ID              nonce.ID // only used by a client
	Hop             byte     // only used by a client
	Header, Payload *crypto.Keys
	ont.Onion
}

func (*Session) Account

func (x *Session) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data,
	last bool) (skip bool, sd *sessions.Data)

func (*Session) Decode

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

func (*Session) Encode

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

func (*Session) GetOnion

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

func (*Session) Handle

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

func (*Session) Len

func (x *Session) Len() int

func (*Session) Magic

func (x *Session) Magic() string

func (*Session) PreimageHash

func (x *Session) PreimageHash() sha256.Hash

func (*Session) Wrap

func (x *Session) Wrap(inner ont.Onion)

Jump to

Keyboard shortcuts

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