Documentation ¶
Index ¶
- Constants
- type Auditor
- func (a *Auditor) Append(tx Transaction) error
- func (a *Auditor) Audit(tx Transaction) (*token.InputStream, *token.OutputStream, error)
- func (a *Auditor) GetStatus(txID string) (TxStatus, error)
- func (a *Auditor) GetTokenRequest(txID string) ([]byte, error)
- func (a *Auditor) NewQueryExecutor() *QueryExecutor
- func (a *Auditor) Release(tx Transaction)
- func (a *Auditor) SetStatus(txID string, status TxStatus) error
- func (a *Auditor) Validate(request *token.Request) error
- type Entry
- type KVS
- type Manager
- type QueryExecutor
- type Transaction
- type TxStatus
- type TxStatusChangesListener
Constants ¶
const ( // 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 Auditor ¶
type Auditor struct {
// contains filtered or unexported fields
}
Auditor is the interface for the auditor service
func Get ¶
func Get(sp view.ServiceProvider, w *token.AuditorWallet) *Auditor
Get returns the Auditor instance for the passed auditor wallet
func New ¶
func New(sp view.ServiceProvider, w *token.AuditorWallet) *Auditor
New returns the Auditor instance for the passed auditor wallet
func (*Auditor) Append ¶
func (a *Auditor) Append(tx Transaction) error
Append adds the passed transaction to the auditor database. It also releases the locks acquired by Audit.
func (*Auditor) Audit ¶
func (a *Auditor) Audit(tx Transaction) (*token.InputStream, *token.OutputStream, error)
Audit extracts the list of inputs and outputs from the passed transaction. In addition, the Audit locks the enrollment named ids. Release must be invoked in case
func (*Auditor) GetStatus ¶ added in v0.3.0
GetStatus return the status of the given transaction id. It returns an error if no transaction with that id is found
func (*Auditor) GetTokenRequest ¶ added in v0.3.0
GetTokenRequest returns the token request bound to the passed transaction id, if available.
func (*Auditor) NewQueryExecutor ¶
func (a *Auditor) NewQueryExecutor() *QueryExecutor
NewQueryExecutor returns a new query executor
func (*Auditor) Release ¶ added in v0.2.0
func (a *Auditor) Release(tx Transaction)
Release releases the lock acquired of the passed transaction.
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.
type QueryExecutor ¶
type QueryExecutor struct {
*ttxdb.QueryExecutor
}
QueryExecutor defines the interface for the query executor
func (*QueryExecutor) Done ¶
func (a *QueryExecutor) Done()
Done closes the query executor. It must be called when the query executor is no longer needed.
func (*QueryExecutor) NewHoldingsFilter ¶
func (a *QueryExecutor) NewHoldingsFilter() *ttxdb.HoldingsFilter
NewHoldingsFilter returns a filter for holdings
func (*QueryExecutor) NewPaymentsFilter ¶
func (a *QueryExecutor) NewPaymentsFilter() *ttxdb.PaymentsFilter
NewPaymentsFilter returns a filter for payments
type Transaction ¶
type Transaction interface { ID() string Network() string Channel() string Request() *token.Request }
Transaction models a generic token transaction
type TxStatusChangesListener ¶
type TxStatusChangesListener struct {
// contains filtered or unexported fields
}
func (*TxStatusChangesListener) OnStatusChange ¶
func (t *TxStatusChangesListener) OnStatusChange(txID string, status int) error