Documentation
¶
Overview ¶
Package order is a payment-order state machine: submit a charge to a provider, resend on timeout up to MaxRetries, and finish as Paid, Failed or Cancelled.
Index ¶
Constants ¶
View Source
const MaxRetries = 3
MaxRetries is the protocol's resend budget before giving up.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions uint64
Actions is the set of things the holder must do after a transition, one bit each. The holder performs them in declaration order. The zero value is the empty set.
type Event ¶
type Event uint8
Event is an input to Fire.
const ( EvSubmit Event EvAck EvTimeout EvCancel )
Event values.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine is one order. Build it with New and change it only with Fire.
func (Machine) Fire ¶
Fire applies e and returns the next machine, the actions to perform and what happened.
Click to show internal directories.
Click to hide internal directories.