data

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

This section is empty.

Types

type Data

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

Data .

func NewData

func NewData(bootstrap *conf.Bootstrap, logger *log.Helper) (*Data, func())

func (*Data) AppendCleanup

func (d *Data) AppendCleanup(cleanup func())

func (*Data) DB

func (d *Data) DB(ctx context.Context) *gorm.DB

DB try to get transaction handle by the context, if the handle do not exist, will return data's DB instance directly so do not forget do some sql without withContext func

func (*Data) ExecTx

func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error

ExecTx transaction manager's core func, implemented it by gorm and context value func now

type ReportTeeAttestationEventRepo

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

func NewReportTeeAttestationEventRepo

func NewReportTeeAttestationEventRepo(data *Data, logger log.Logger) *ReportTeeAttestationEventRepo

func (*ReportTeeAttestationEventRepo) CreateReportTeeAttestationEvent

func (*ReportTeeAttestationEventRepo) FindReportTeeAttestationEvent

func (t *ReportTeeAttestationEventRepo) FindReportTeeAttestationEvent(ctx context.Context, hash string, txIndex int) (*biz.ReportTeeAttestationEvent, *gorm.DB)

func (*ReportTeeAttestationEventRepo) LastReportTeeAttestationEvent

type TransactionManager

type TransactionManager interface {
	ExecTx(ctx context.Context, fn func(ctx context.Context) error) error
}

type TransactionRepo

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

func NewTransactionRepo

func NewTransactionRepo(data *Data, logger log.Logger) *TransactionRepo

func (*TransactionRepo) CreateTransaction

func (t *TransactionRepo) CreateTransaction(ctx context.Context, transaction *biz.Transaction) (*biz.Transaction, error)

type VerifierRepo

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

func NewVerifierRepo

func NewVerifierRepo(data *Data) *VerifierRepo

func (*VerifierRepo) ListAll

func (r *VerifierRepo) ListAll(ctx context.Context) ([]*model.Verifier, error)

Jump to

Keyboard shortcuts

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