offermgr

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OfferManager

type OfferManager interface {
	// GetNonce is used to get the current nonce.
	//
	// @input - context.
	//
	// @output - nonce, error.
	GetNonce(ctx context.Context) (uint64, error)

	// SetNonce is used to set the current nonce.
	//
	// @input - context, nonce.
	//
	// @output - error.
	SetNonce(ctx context.Context, nonce uint64) error
}

OfferManager is the interface for a manager that tracks the offer nonce.

type OfferManagerImpl

type OfferManagerImpl struct {
	// contains filtered or unexported fields
}

OfferManagerImpl is the implementation for OfferManager.

func NewOfferManagerImpl

func NewOfferManagerImpl(ctx context.Context, opts Opts) (*OfferManagerImpl, error)

NewOfferManagerImpl creates a new offer manager.

@input - context, options.

@output - offer manager, error.

func (*OfferManagerImpl) GetNonce

func (mgr *OfferManagerImpl) GetNonce(ctx context.Context) (uint64, error)

GetNonce is used to get the current nonce.

@input - context.

@output - nonce, error.

func (*OfferManagerImpl) SetNonce

func (mgr *OfferManagerImpl) SetNonce(ctx context.Context, nonce uint64) error

SetNonce is used to set the current nonce.

@input - context, nonce.

@output - error.

func (*OfferManagerImpl) Shutdown

func (mgr *OfferManagerImpl) Shutdown()

Shutdown safely shuts down the component.

type Opts

type Opts struct {
	// The datastore path of the offer manager.
	Path string
}

Opts is the options for offer manager.

Jump to

Keyboard shortcuts

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