Documentation
¶
Index ¶
- Constants
- Variables
- type CheckService
- type CheckServiceProvider
- type NetworkProvider
- type Service
- func (a *Service) Append(ctx context.Context, tx Transaction) error
- func (a *Service) Audit(ctx context.Context, tx Transaction) (*token.InputStream, *token.OutputStream, error)
- func (a *Service) Check(ctx context.Context) ([]string, error)
- func (a *Service) GetStatus(ctx context.Context, txID string) (TxStatus, string, error)
- func (a *Service) GetTokenRequest(ctx context.Context, txID string) ([]byte, error)
- func (a *Service) Release(ctx context.Context, tx Transaction)
- func (a *Service) SetStatus(ctx context.Context, txID string, status db.TxStatus, message string) error
- func (a *Service) Validate(ctx context.Context, request *token.Request) error
- type ServiceManager
- type StoreServiceManager
- type TokenManagementServiceProvider
- type TokensServiceManager
- 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 CheckService ¶ added in v0.4.0
type CheckServiceProvider ¶ added in v0.4.0
type CheckServiceProvider interface {
CheckService(id token.TMSID, adb *auditdb.StoreService, tdb *tokens.Service) (CheckService, error)
}
type NetworkProvider ¶ added in v0.4.0
type Service ¶ added in v0.5.0
type Service struct {
// contains filtered or unexported fields
}
Service is the interface for the auditor service
func Get ¶
func Get(sp token.ServiceProvider, w *token.AuditorWallet) *Service
Get returns the Service instance for the passed auditor wallet
func GetByTMSID ¶ added in v0.4.0
func GetByTMSID(sp token.ServiceProvider, tmsID token.TMSID) *Service
GetByTMSID returns the Service instance for the passed auditor wallet
func New ¶
func New(sp token.ServiceProvider, w *token.AuditorWallet) *Service
New returns the Service instance for the passed auditor wallet
func (*Service) Append ¶ added in v0.5.0
func (a *Service) Append(ctx context.Context, tx Transaction) error
Append adds the passed transaction to the auditor database. It also releases the locks acquired by Audit.
func (*Service) Audit ¶ added in v0.5.0
func (a *Service) Audit(ctx context.Context, 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 (*Service) GetStatus ¶ added in v0.5.0
GetStatus return the status of the given transaction id. It returns an error if no transaction with that id is found
func (*Service) GetTokenRequest ¶ added in v0.5.0
GetTokenRequest returns the token request bound to the passed transaction id, if available.
func (*Service) Release ¶ added in v0.5.0
func (a *Service) Release(ctx context.Context, tx Transaction)
Release releases the lock acquired of the passed transaction.
type ServiceManager ¶ added in v0.5.0
type ServiceManager struct {
// contains filtered or unexported fields
}
ServiceManager handles the services
func NewServiceManager ¶ added in v0.5.0
func NewServiceManager( networkProvider NetworkProvider, auditStoreServiceManager StoreServiceManager, tokensServiceManager TokensServiceManager, tmsProvider TokenManagementServiceProvider, tracerProvider trace.TracerProvider, checkServiceProvider CheckServiceProvider, ) *ServiceManager
NewServiceManager creates a new Service manager.
func (*ServiceManager) Auditor ¶ added in v0.5.0
func (cm *ServiceManager) Auditor(tmsID token.TMSID) (*Service, error)
Auditor returns the Service for the given wallet
func (*ServiceManager) RestoreTMS ¶ added in v0.5.0
func (cm *ServiceManager) RestoreTMS(tmsID token.TMSID) error
RestoreTMS restores the auditdb corresponding to the passed TMS ID.
type StoreServiceManager ¶ added in v0.5.0
type StoreServiceManager db.StoreServiceManager[*auditdb.StoreService]
type TokenManagementServiceProvider ¶ added in v0.4.0
type TokenManagementServiceProvider interface {
GetManagementService(opts ...token.ServiceOption) (*token.ManagementService, error)
}
type TokensServiceManager ¶ added in v0.5.0
type TokensServiceManager db.ServiceManager[*tokens.Service]