selector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 12 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,
	metricsAgent MetricsAgent,
) *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(id ...*token2.ID)
	UnlockByTxID(txID string)
	IsLocked(id *token2.ID) bool
}

type LockerProvider

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

type MetricsAgent

type MetricsAgent interface {
	EmitKey(val float32, event ...string)
}

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 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