auditor

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var TxStatusMessage = auditdb.TxStatusMessage

Functions

This section is empty.

Types

type CheckService added in v0.4.0

type CheckService interface {
	Check(ctx context.Context) ([]string, error)
}

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 NetworkProvider interface {
	GetNetwork(network string, channel string) (*network.Network, error)
}

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

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

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

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) Check added in v0.5.0

func (a *Service) Check(ctx context.Context) ([]string, error)

func (*Service) GetStatus added in v0.5.0

func (a *Service) GetStatus(ctx context.Context, txID string) (TxStatus, string, error)

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

func (a *Service) GetTokenRequest(ctx context.Context, txID string) ([]byte, error)

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.

func (*Service) SetStatus added in v0.5.0

func (a *Service) SetStatus(ctx context.Context, txID string, status db.TxStatus, message string) error

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

func (*Service) Validate added in v0.5.0

func (a *Service) Validate(ctx context.Context, request *token.Request) error

Validate validates the passed token request

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]

type Transaction

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

Transaction models a generic token transaction

type TxStatus

type TxStatus = auditdb.TxStatus

TxStatus is the status of a transaction

Jump to

Keyboard shortcuts

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