Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PayPerInterval ¶
func PayPerInterval(storeDriver store.BalanceStore, interval time.Duration, creditPerInterval *big.Int) *payPerInterval
PayPerInterval creates a balance Manager which implements a pay-per-interval scheme.
Types ¶
type LowBalanceError ¶ added in v0.2.5
LowBalanceError is returned when the account's positive balance check fails.
func (LowBalanceError) Error ¶ added in v0.2.5
func (err LowBalanceError) Error() string
type Manager ¶
type Manager interface { // OnClient is called when a client connects to the pool. If an error is // returned, the client is disconnected with the error. OnClient(node store.Node) error // OnUpdate is called every time the state of a node's peers is updated. OnUpdate(node store.Node, peers []store.Node) (store.Balance, error) }
Manager is the minimal interface required to support a payment scheme. The payment implementation will receive handler calls. TODO: OnConnect, OnDisconnect, etc? OnConnect would be useful for time-based trials. TODO: Support error type that forces a disconnect (eg. trial expired?)
Click to show internal directories.
Click to hide internal directories.