Documentation
¶
Index ¶
- Constants
- Variables
- func NewRetryRunner(maxTimes int, delay time.Duration, expBackoff bool) *retryRunner
- type Checker
- type ChecksService
- type DefaultCheckers
- type NamedChecker
- type NetworkProvider
- type RetryRunner
- type StatusEvent
- type StatusSupport
- type TokenManagementServiceProvider
- type TokenTransactionDB
Constants ¶
View Source
const Infinitely = -1
Variables ¶
View Source
var ErrMaxRetriesExceeded = errors.New("maximum number of retries exceeded")
Functions ¶
Types ¶
type ChecksService ¶
type ChecksService struct {
// contains filtered or unexported fields
}
func NewChecksService ¶
func NewChecksService(checkers []NamedChecker) *ChecksService
type DefaultCheckers ¶
type DefaultCheckers struct {
// contains filtered or unexported fields
}
func (*DefaultCheckers) CheckTokenSpendability ¶ added in v0.5.0
func (a *DefaultCheckers) CheckTokenSpendability(ctx context.Context) ([]string, error)
CheckTokenSpendability checks that for each unspent token, it is still spendable. Spendability is verified against the current TMS for the given TMS ID. A token is still spendable if: - The token type is among the supported; - The token is parsable; - The token's recipients are still valid.
func (*DefaultCheckers) CheckTransactions ¶ added in v0.5.0
func (a *DefaultCheckers) CheckTransactions(ctx context.Context) ([]string, error)
CheckTransactions checks that for each transaction stored in the local database, the status of this transaction matches the status of the transaction on the ledger.
func (*DefaultCheckers) CheckUnspentTokens ¶ added in v0.5.0
func (a *DefaultCheckers) CheckUnspentTokens(ctx context.Context) ([]string, error)
CheckUnspentTokens checks that for each unspent token, the content of the local database matches the ledger
type NamedChecker ¶
func NewDefaultCheckers ¶
func NewDefaultCheckers(tmsProvider TokenManagementServiceProvider, networkProvider NetworkProvider, db TokenTransactionDB, tokenDB *tokens.Service, tmsID token.TMSID) []NamedChecker
type NetworkProvider ¶
type RetryRunner ¶
RetryRunner receives a function that potentially fails and retries according to the specified strategy
type StatusEvent ¶
type StatusSupport ¶
type StatusSupport struct {
// contains filtered or unexported fields
}
func NewStatusSupport ¶
func NewStatusSupport() *StatusSupport
func (*StatusSupport) AddStatusListener ¶
func (c *StatusSupport) AddStatusListener(txID string, ch chan StatusEvent)
func (*StatusSupport) DeleteStatusListener ¶
func (c *StatusSupport) DeleteStatusListener(txID string, ch chan StatusEvent)
func (*StatusSupport) Notify ¶
func (c *StatusSupport) Notify(event StatusEvent)
type TokenManagementServiceProvider ¶
type TokenManagementServiceProvider interface {
GetManagementService(opts ...token.ServiceOption) (*token.ManagementService, error)
}
type TokenTransactionDB ¶
type TokenTransactionDB interface { GetTokenRequest(ctx context.Context, txID string) ([]byte, error) Transactions(ctx context.Context, params driver.QueryTransactionsParams, pagination driver2.Pagination) (*driver2.PageIterator[*driver.TransactionRecord], error) }
Click to show internal directories.
Click to hide internal directories.