owner

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown = ttxdb.Unknown
	// Pending is the status of a transaction that has been submitted to the ledger
	Pending = ttxdb.Pending
	// Confirmed is the status of a transaction that has been confirmed by the ledger
	Confirmed = ttxdb.Confirmed
	// Deleted is the status of a transaction that has been deleted due to a failure to commit
	Deleted = ttxdb.Deleted
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	TMSID token.TMSID
}

type KVS

type KVS interface {
	Exists(id string) bool
	Put(id string, state interface{}) error
	Get(id string, state interface{}) error
}

type Manager

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

Manager handles the databases

func NewManager

func NewManager(sp view.ServiceProvider, kvs KVS) *Manager

NewManager creates a new Auditor manager.

func (*Manager) Owner

func (cm *Manager) Owner(tms *token.ManagementService) (*Owner, error)

Owner returns the Owner for the given TMS

func (*Manager) Restore

func (cm *Manager) Restore() error

type Owner

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

Owner is the interface for the owner service

func Get

Get returns the Owner instance for the passed TMS

func New

New returns the Owner instance for the passed TMS

func (*Owner) Append

func (a *Owner) Append(tx Transaction) error

Append adds the passed transaction to the database

func (*Owner) GetStatus added in v0.3.0

func (a *Owner) GetStatus(txID string) (TxStatus, error)

GetStatus return the status of the given transaction id. It returns an error if no transaction with that id is found

func (*Owner) GetTokenRequest added in v0.3.0

func (a *Owner) GetTokenRequest(txID string) ([]byte, error)

GetTokenRequest returns the token request bound to the passed transaction id, if available.

func (*Owner) NewQueryExecutor

func (a *Owner) NewQueryExecutor() *QueryExecutor

NewQueryExecutor returns a new query executor

func (*Owner) SetStatus

func (a *Owner) SetStatus(txID string, status TxStatus) error

SetStatus sets the status of the audit records with the passed transaction id to the passed status

type QueryExecutor

type QueryExecutor struct {
	*ttxdb.QueryExecutor
}

QueryExecutor defines the interface for the query executor

type QueryTransactionsParams

type QueryTransactionsParams = ttxdb.QueryTransactionsParams

type Transaction

type Transaction interface {
	ID() string
	Network() string
	Channel() string
	Request() *token.Request
}

Transaction models a token transaction

type TxStatus

type TxStatus = ttxdb.TxStatus

TxStatus is the status of a transaction

type TxStatusChangesListener

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

func (*TxStatusChangesListener) OnStatusChange

func (t *TxStatusChangesListener) OnStatusChange(txID string, status int) error

Jump to

Keyboard shortcuts

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