selector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(
	locker Locker,
	newQueryEngine NewQueryEngineFunc,
	numRetry int,
	timeout time.Duration,
	requestCertification bool,
	precision uint64,
	tracer Tracer,
) *manager

func NewProvider

func NewProvider(sp view.ServiceProvider, lockerProvider LockerProvider, numRetry int, timeout time.Duration) *selectorService

Types

type Cache

type Cache interface {
	Get(key string) (interface{}, bool)
	Add(key string, value interface{})
}

type Locker

type Locker interface {
	Lock(id *token2.ID, txID string, reclaim bool) (string, error)
	// UnlockIDs unlocks the passed IDS. It returns the list of tokens that were not locked in the first place among
	// those passed.
	UnlockIDs(ids ...*token2.ID) []*token2.ID
	UnlockByTxID(txID string)
	IsLocked(id *token2.ID) bool
}

type LockerProvider

type LockerProvider interface {
	New(network, channel, namespace string) Locker
}

type NewQueryEngineFunc

type NewQueryEngineFunc func() QueryService

type QueryService

type QueryService interface {
	UnspentTokensIterator() (*token.UnspentTokensIterator, error)
	UnspentTokensIteratorBy(id, typ string) (*token.UnspentTokensIterator, error)
	GetTokens(inputs ...*token2.ID) ([]*token2.Token, error)
}

type Repository

type Repository interface {
	Next(typ string, of token.OwnerFilter) (*token2.UnspentToken, error)
}

type Tracer added in v0.3.0

type Tracer tracing.Tracer

type Transaction

type Transaction interface {
	ID() string
	Network() string
	Channel() string
	Namespace() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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