simple

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

type Locker

type Locker interface {
	Lock(ctx context.Context, 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(ctx context.Context, ids ...*token2.ID) []*token2.ID
	UnlockByTxID(ctx context.Context, txID string)
	IsLocked(id *token2.ID) bool
}

type LockerProvider

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

type Manager

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

func NewManager

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

func (*Manager) Close

func (m *Manager) Close(txID string) error

func (*Manager) NewSelector

func (m *Manager) NewSelector(id string) (token.Selector, error)

func (*Manager) Unlock

func (m *Manager) Unlock(ctx context.Context, txID string) error

type NewQueryEngineFunc

type NewQueryEngineFunc func() QueryService

type QueryService

type QueryService interface {
	UnspentTokensIterator(ctx context.Context) (*token.UnspentTokensIterator, error)
	UnspentTokensIteratorBy(ctx context.Context, id string, tokenType token2.Type) (driver.UnspentTokensIterator, error)
	GetTokens(ctx context.Context, inputs ...*token2.ID) ([]*token2.Token, error)
}

type SelectorService

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

func NewService

func NewService(lockerProvider LockerProvider, c core.ConfigProvider) *SelectorService

func (*SelectorService) SelectorManager

func (s *SelectorService) SelectorManager(tms *token.ManagementService) (token.SelectorManager, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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