Documentation ¶
Index ¶
- Constants
- Variables
- type AuditDBProvider
- type Auditor
- func (a *Auditor) Append(tx Transaction) error
- func (a *Auditor) Audit(tx Transaction) (*token.InputStream, *token.OutputStream, error)
- func (a *Auditor) Check(context context.Context) ([]string, error)
- func (a *Auditor) GetStatus(txID string) (TxStatus, string, error)
- func (a *Auditor) GetTokenRequest(txID string) ([]byte, error)
- func (a *Auditor) Release(tx Transaction)
- func (a *Auditor) SetStatus(ctx context.Context, txID string, status db.TxStatus, message string) error
- func (a *Auditor) Validate(context context.Context, request *token.Request) error
- type CheckService
- type CheckServiceProvider
- type Manager
- type NetworkProvider
- type TokenDBProvider
- type TokenManagementServiceProvider
- type Transaction
- type TxStatus
Constants ¶
const ( // Pending is the status of a transaction that has been submitted to the ledger Pending = auditdb.Pending // Confirmed is the status of a transaction that has been confirmed by the ledger Confirmed = auditdb.Confirmed // Deleted is the status of a transaction that has been deleted due to a failure to commit Deleted = auditdb.Deleted )
Variables ¶
var TxStatusMessage = auditdb.TxStatusMessage
Functions ¶
This section is empty.
Types ¶
type AuditDBProvider ¶ added in v0.4.0
type Auditor ¶
type Auditor struct {
// contains filtered or unexported fields
}
Auditor is the interface for the auditor service
func Get ¶
func Get(sp token.ServiceProvider, w *token.AuditorWallet) *Auditor
Get returns the Auditor instance for the passed auditor wallet
func GetByTMSID ¶ added in v0.4.0
func GetByTMSID(sp token.ServiceProvider, tmsID token.TMSID) *Auditor
GetByTMSID returns the Auditor instance for the passed auditor wallet
func New ¶
func New(sp token.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) Release ¶ added in v0.2.0
func (a *Auditor) Release(tx Transaction)
Release releases the lock acquired of the passed transaction.
type CheckService ¶ added in v0.4.0
type CheckServiceProvider ¶ added in v0.4.0
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the databases
func NewManager ¶
func NewManager( networkProvider NetworkProvider, auditDBProvider AuditDBProvider, tokenDBProvider TokenDBProvider, tmsProvider TokenManagementServiceProvider, tracerProvider trace.TracerProvider, checkServiceProvider CheckServiceProvider, ) *Manager
NewManager creates a new Auditor manager.
type NetworkProvider ¶ added in v0.4.0
type TokenDBProvider ¶ added in v0.4.0
type TokenManagementServiceProvider ¶ added in v0.4.0
type TokenManagementServiceProvider interface {
GetManagementService(opts ...token.ServiceOption) (*token.ManagementService, error)
}