Documentation ¶
Overview ¶
Package delay provides an onion message type that allows a client to specify an arbitrary delay time before processing the rest of an onion message.
Index ¶
- Constants
- func Gen() codec.Codec
- func New(d time.Duration) ont.Onion
- type Delay
- func (x *Delay) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
- func (x *Delay) Decode(s *splice.Splice) (e error)
- func (x *Delay) Encode(s *splice.Splice) (e error)
- func (x *Delay) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)
- func (x *Delay) Len() int
- func (x *Delay) Magic() string
- func (x *Delay) Wrap(inner ont.Onion)
Constants ¶
View Source
const ( Magic = "dely" Len = magic.Len + slice.Uint64Len )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Delay ¶
Delay is an instruction to hold a message for a specified time period before forwarding.
func (*Delay) Account ¶
func (x *Delay) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
Account todo: record a decrement value based on a time coefficient of RelayRate.
func (*Delay) Handle ¶
Handle provides relay and accounting processing logic for receiving a Delay message.
Click to show internal directories.
Click to hide internal directories.