Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultAfterTxConfirmed(hash string) error
- func DefaultAfterTxSent(hash string) error
- func DefaultErrHandler(hash string, err error)
- type AfterTxConfirmed
- type AfterTxSent
- type Client
- type ConfirmationBlocks
- type ConfirmationInterval
- type Confirmer
- type ErrHandler
- type HashHandler
- type Opt
- type Timeout
- type WorkerInterval
- type Workers
Constants ¶
View Source
const ( DEFAULT_CONFIEMATION_BLOCKS = uint64(2) DEFAULT_CONFIEMATION_INTERVAL = int64(1) // 1s DEFAULT_WORKER_INTERVAL = int64(10) DEFAULT_TIMEOUT = int64(60) )
Variables ¶
View Source
var ( ErrTxNotFound = errors.New("tx not found") ErrTxFailed = errors.New("tx failed") ErrTxConfirmPending = errors.New("tx confirm pending") ErrQueueIsEmpty = errors.New("queue is empty") ErrBeforeConfirmationInterval = errors.New("before confirmation interval") )
View Source
var (
DEFAULT_WORKERS = runtime.NumCPU() - 2
)
Functions ¶
func DefaultAfterTxConfirmed ¶
func DefaultAfterTxSent ¶
func DefaultErrHandler ¶
Types ¶
type AfterTxConfirmed ¶
AfterTxConfirmed
func WithAfterTxConfirmed ¶
func WithAfterTxConfirmed(f func(string) error) AfterTxConfirmed
func (AfterTxConfirmed) Apply ¶
func (f AfterTxConfirmed) Apply(c *Confirmer)
type AfterTxSent ¶
AfterTxSent
func WithAfterTxSent ¶
func WithAfterTxSent(f func(string) error) AfterTxSent
func (AfterTxSent) Apply ¶
func (f AfterTxSent) Apply(c *Confirmer)
type ConfirmationBlocks ¶
type ConfirmationBlocks uint64
ConfirmationBlocks
func WithConfirmationBlock ¶
func WithConfirmationBlock(b uint64) ConfirmationBlocks
func (ConfirmationBlocks) Apply ¶
func (b ConfirmationBlocks) Apply(c *Confirmer)
type ConfirmationInterval ¶
type ConfirmationInterval int64
ConfirmationInterval
func WithConfirmationInterval ¶
func WithConfirmationInterval(i int64) ConfirmationInterval
func (ConfirmationInterval) Apply ¶
func (i ConfirmationInterval) Apply(c *Confirmer)
type Confirmer ¶
type Confirmer struct { AfterTxSent HashHandler AfterTxConfirmed HashHandler ErrHandler ErrHandler // contains filtered or unexported fields }
func (*Confirmer) Close ¶
func (c *Confirmer) Close(canncel context.CancelFunc)
type ErrHandler ¶
func WithErrHandler ¶
func WithErrHandler(f func(string, error)) ErrHandler
func (ErrHandler) Apply ¶
func (f ErrHandler) Apply(c *Confirmer)
type HashHandler ¶
type WorkerInterval ¶
type WorkerInterval int64
WorkerInterval
func WithWorkerInterval ¶
func WithWorkerInterval(i int64) WorkerInterval
func (WorkerInterval) Apply ¶
func (i WorkerInterval) Apply(c *Confirmer)
Click to show internal directories.
Click to hide internal directories.