Documentation ¶
Index ¶
- Constants
- func GenerateBatchInputKey(appContract string, inputIndex uint64) string
- func GenerateBatchNoticeKey(appContract string, inputIndex uint64) string
- func GenerateBatchReportKey(appContract *common.Address, inputIndex int) string
- func GenerateBatchVoucherKey(appContract *common.Address, inputIndex int) string
- func GetTransaction(ctx context.Context) (*sqlx.Tx, bool)
- func StartTransaction(ctx context.Context, db *sqlx.DB) (context.Context, error)
- func StartTransactionContext(ctx context.Context, db *sqlx.DB) (context.Context, *sqlx.Tx, error)
- type BatchFilterItem
- type BatchFilterItemForNotice
- type DBExecutor
- type InputRepository
- func (c *InputRepository) BatchFindInputByInputIndexAndAppContract(ctx context.Context, filters []*BatchFilterItem) ([]*model.AdvanceInput, []error)
- func (c *InputRepository) Count(ctx context.Context, filter []*model.ConvenienceFilter) (uint64, error)
- func (r *InputRepository) Create(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
- func (r *InputRepository) CreateTables() error
- func (c *InputRepository) FindAll(ctx context.Context, first *int, last *int, after *string, before *string, ...) (*commons.PageResult[model.AdvanceInput], error)
- func (r *InputRepository) FindByIDAndAppContract(ctx context.Context, id string, appContract *common.Address) (*model.AdvanceInput, error)
- func (r *InputRepository) FindByIndexAndAppContract(ctx context.Context, inputIndex int, appContract *common.Address) (*model.AdvanceInput, error)
- func (r *InputRepository) FindByStatus(ctx context.Context, status model.CompletionStatus) (*model.AdvanceInput, error)
- func (r *InputRepository) FindByStatusNeDesc(ctx context.Context, status model.CompletionStatus) (*model.AdvanceInput, error)
- func (c *InputRepository) GetNonce(ctx context.Context, appContract common.Address, msgSender common.Address) (uint64, error)
- func (r *InputRepository) RawCreate(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
- func (r *InputRepository) Update(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
- func (r *InputRepository) UpdateStatus(ctx context.Context, appContract common.Address, inputIndex uint64, ...) error
- type NoticeRepository
- func (c *NoticeRepository) BatchFindAllNoticesByInputIndexAndAppContract(ctx context.Context, filters []*BatchFilterItemForNotice) ([]*commons.PageResult[model.ConvenienceNotice], []error)
- func (c *NoticeRepository) Count(ctx context.Context, filter []*model.ConvenienceFilter) (uint64, error)
- func (c *NoticeRepository) Create(ctx context.Context, data *model.ConvenienceNotice) (*model.ConvenienceNotice, error)
- func (c *NoticeRepository) CreateTables() error
- func (c *NoticeRepository) FindAllNotices(ctx context.Context, first *int, last *int, after *string, before *string, ...) (*commons.PageResult[model.ConvenienceNotice], error)
- func (c *NoticeRepository) FindAllNoticesByBlockNumber(ctx context.Context, startBlockGte uint64, endBlockLt uint64) ([]*model.ConvenienceNotice, error)
- func (c *NoticeRepository) FindByInputAndOutputIndex(ctx context.Context, inputIndex uint64, outputIndex uint64) (*model.ConvenienceNotice, error)
- func (c *NoticeRepository) FindNoticeByOutputIndexAndAppContract(ctx context.Context, outputIndex uint64, appContract *common.Address) (*model.ConvenienceNotice, error)
- func (c *NoticeRepository) SetProof(ctx context.Context, notice *model.ConvenienceNotice) error
- func (c *NoticeRepository) Update(ctx context.Context, data *model.ConvenienceNotice) (*model.ConvenienceNotice, error)
- type OutputRepository
- func (c *OutputRepository) CountAllNotices(ctx context.Context) (uint64, error)
- func (c *OutputRepository) CountAllOutputs(ctx context.Context) (uint64, error)
- func (c *OutputRepository) CountAllVouchers(ctx context.Context) (uint64, error)
- func (c *OutputRepository) CountNoticeProofs(ctx context.Context) (uint64, error)
- func (c *OutputRepository) CountProofs(ctx context.Context) (uint64, error)
- func (c *OutputRepository) CountVoucherProofs(ctx context.Context) (uint64, error)
- type RawInputRef
- type RawInputRefRepository
- func (r *RawInputRefRepository) Create(ctx context.Context, rawInput RawInputRef) error
- func (r *RawInputRefRepository) CreateTables() error
- func (r *RawInputRefRepository) FindByRawIdAndAppContract(ctx context.Context, rawId uint64, appContract *common.Address) (*RawInputRef, error)
- func (r *RawInputRefRepository) FindFirstInputByStatusNone(ctx context.Context, limit int) (*RawInputRef, error)
- func (r *RawInputRefRepository) GetLatestRawId(ctx context.Context) (uint64, error)
- func (r *RawInputRefRepository) UpdateStatus(ctx context.Context, rawInputsIds []string, status string) error
- type RawOutputRef
- type RawOutputRefRepository
- func (r *RawOutputRefRepository) Create(ctx context.Context, rawOutput RawOutputRef) error
- func (r *RawOutputRefRepository) CreateTable() error
- func (r *RawOutputRefRepository) FindByID(ctx context.Context, id uint64) (*RawOutputRef, error)
- func (r *RawOutputRefRepository) GetFirstOutputIdWithoutProof(ctx context.Context) (uint64, error)
- func (r *RawOutputRefRepository) GetLastUpdatedAtExecuted(ctx context.Context) (*time.Time, *uint64, error)
- func (r *RawOutputRefRepository) GetLatestOutputRawId(ctx context.Context) (uint64, error)
- func (r *RawOutputRefRepository) SetExecutedToTrue(ctx context.Context, rawOutputRef *RawOutputRef) error
- func (r *RawOutputRefRepository) SetHasProofToTrue(ctx context.Context, rawOutputRef *RawOutputRef) error
- type ReportRepository
- func (c *ReportRepository) BatchFindAllByInputIndexAndAppContract(ctx context.Context, filters []*BatchFilterItem) ([]*commons.PageResult[cModel.Report], []error)
- func (c *ReportRepository) Count(ctx context.Context, filter []*cModel.ConvenienceFilter) (uint64, error)
- func (r *ReportRepository) CreateReport(ctx context.Context, report cModel.Report) (cModel.Report, error)
- func (r *ReportRepository) CreateTables() error
- func (c *ReportRepository) FindAll(ctx context.Context, first *int, last *int, after *string, before *string, ...) (*commons.PageResult[cModel.Report], error)
- func (c *ReportRepository) FindAllByInputIndex(ctx context.Context, first *int, last *int, after *string, before *string, ...) (*commons.PageResult[cModel.Report], error)
- func (r *ReportRepository) FindByInputAndOutputIndex(ctx context.Context, inputIndex uint64, outputIndex uint64) (*cModel.Report, error)
- func (r *ReportRepository) FindByOutputIndexAndAppContract(ctx context.Context, outputIndex uint64, appContract *common.Address) (*cModel.Report, error)
- func (r *ReportRepository) FindLastRawId(ctx context.Context) (uint64, error)
- func (r *ReportRepository) FindReportByAppContractAndIndex(ctx context.Context, index int, appContract common.Address) (*cModel.Report, error)
- func (r *ReportRepository) Update(ctx context.Context, report cModel.Report) (*cModel.Report, error)
- type SynchronizerRepository
- func (c *SynchronizerRepository) Count(ctx context.Context) (uint64, error)
- func (c *SynchronizerRepository) Create(ctx context.Context, data *model.SynchronizerFetch) (*model.SynchronizerFetch, error)
- func (c *SynchronizerRepository) CreateTables() error
- func (c *SynchronizerRepository) GetDB() *sqlx.DB
- func (c *SynchronizerRepository) GetLastFetched(ctx context.Context) (*model.SynchronizerFetch, error)
- func (c *SynchronizerRepository) PurgeData(ctx context.Context, timestampBefore uint64) error
- type VoucherRepository
- func (c *VoucherRepository) BatchFindAllByInputIndexAndAppContract(ctx context.Context, filters []*BatchFilterItem) ([]*commons.PageResult[model.ConvenienceVoucher], []error)
- func (c *VoucherRepository) Count(ctx context.Context, filter []*model.ConvenienceFilter) (uint64, error)
- func (c *VoucherRepository) CreateTables() error
- func (c *VoucherRepository) CreateVoucher(ctx context.Context, voucher *model.ConvenienceVoucher) (*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) FindAllVouchers(ctx context.Context, first *int, last *int, after *string, before *string, ...) (*commons.PageResult[model.ConvenienceVoucher], error)
- func (c *VoucherRepository) FindAllVouchersByBlockNumber(ctx context.Context, startBlockGte uint64, endBlockLt uint64) ([]*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) FindVoucherByAppContractAndIndex(ctx context.Context, index int, appContract common.Address) (*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) FindVoucherByInputAndOutputIndex(ctx context.Context, inputIndex uint64, outputIndex uint64) (*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) FindVoucherByOutputIndexAndAppContract(ctx context.Context, outputIndex uint64, appContract *common.Address) (*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) SetExecuted(ctx context.Context, voucher *model.ConvenienceVoucher) error
- func (c *VoucherRepository) SetProof(ctx context.Context, voucher *model.ConvenienceVoucher) error
- func (c *VoucherRepository) UpdateExecuted(ctx context.Context, inputIndex uint64, outputIndex uint64, executedValue bool) error
- func (c *VoucherRepository) UpdateVoucher(ctx context.Context, voucher *model.ConvenienceVoucher) (*model.ConvenienceVoucher, error)
- func (c *VoucherRepository) VoucherCount(ctx context.Context) (uint64, error)
Constants ¶
View Source
const FALSE = "false"
View Source
const INDEX_FIELD = "Index"
View Source
const RAW_NOTICE_TYPE = "notice"
View Source
const RAW_VOUCHER_TYPE = "voucher"
View Source
const WHERE = "WHERE "
Variables ¶
This section is empty.
Functions ¶
func GenerateBatchInputKey ¶
func GenerateBatchNoticeKey ¶
func GenerateBatchReportKey ¶
func GenerateBatchVoucherKey ¶
func StartTransaction ¶
Types ¶
type BatchFilterItem ¶
type DBExecutor ¶
type DBExecutor struct {
// contains filtered or unexported fields
}
func (*DBExecutor) ExecContext ¶
type InputRepository ¶
func (*InputRepository) BatchFindInputByInputIndexAndAppContract ¶
func (c *InputRepository) BatchFindInputByInputIndexAndAppContract( ctx context.Context, filters []*BatchFilterItem, ) ([]*model.AdvanceInput, []error)
func (*InputRepository) Count ¶
func (c *InputRepository) Count( ctx context.Context, filter []*model.ConvenienceFilter, ) (uint64, error)
func (*InputRepository) Create ¶
func (r *InputRepository) Create(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
func (*InputRepository) CreateTables ¶
func (r *InputRepository) CreateTables() error
func (*InputRepository) FindAll ¶
func (c *InputRepository) FindAll( ctx context.Context, first *int, last *int, after *string, before *string, filter []*model.ConvenienceFilter, ) (*commons.PageResult[model.AdvanceInput], error)
func (*InputRepository) FindByIDAndAppContract ¶
func (r *InputRepository) FindByIDAndAppContract(ctx context.Context, id string, appContract *common.Address) (*model.AdvanceInput, error)
func (*InputRepository) FindByIndexAndAppContract ¶
func (r *InputRepository) FindByIndexAndAppContract(ctx context.Context, inputIndex int, appContract *common.Address, ) (*model.AdvanceInput, error)
func (*InputRepository) FindByStatus ¶
func (r *InputRepository) FindByStatus(ctx context.Context, status model.CompletionStatus) (*model.AdvanceInput, error)
func (*InputRepository) FindByStatusNeDesc ¶
func (r *InputRepository) FindByStatusNeDesc(ctx context.Context, status model.CompletionStatus) (*model.AdvanceInput, error)
func (*InputRepository) RawCreate ¶
func (r *InputRepository) RawCreate(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
func (*InputRepository) Update ¶
func (r *InputRepository) Update(ctx context.Context, input model.AdvanceInput) (*model.AdvanceInput, error)
func (*InputRepository) UpdateStatus ¶
func (r *InputRepository) UpdateStatus(ctx context.Context, appContract common.Address, inputIndex uint64, status model.CompletionStatus) error
type NoticeRepository ¶
type NoticeRepository struct { Db sqlx.DB OutputRepository OutputRepository AutoCount bool }
func (*NoticeRepository) BatchFindAllNoticesByInputIndexAndAppContract ¶
func (c *NoticeRepository) BatchFindAllNoticesByInputIndexAndAppContract( ctx context.Context, filters []*BatchFilterItemForNotice, ) ([]*commons.PageResult[model.ConvenienceNotice], []error)
func (*NoticeRepository) Count ¶
func (c *NoticeRepository) Count( ctx context.Context, filter []*model.ConvenienceFilter, ) (uint64, error)
func (*NoticeRepository) Create ¶
func (c *NoticeRepository) Create( ctx context.Context, data *model.ConvenienceNotice, ) (*model.ConvenienceNotice, error)
func (*NoticeRepository) CreateTables ¶
func (c *NoticeRepository) CreateTables() error
func (*NoticeRepository) FindAllNotices ¶
func (c *NoticeRepository) FindAllNotices( ctx context.Context, first *int, last *int, after *string, before *string, filter []*model.ConvenienceFilter, ) (*commons.PageResult[model.ConvenienceNotice], error)
func (*NoticeRepository) FindAllNoticesByBlockNumber ¶
func (c *NoticeRepository) FindAllNoticesByBlockNumber( ctx context.Context, startBlockGte uint64, endBlockLt uint64, ) ([]*model.ConvenienceNotice, error)
func (*NoticeRepository) FindByInputAndOutputIndex ¶
func (c *NoticeRepository) FindByInputAndOutputIndex( ctx context.Context, inputIndex uint64, outputIndex uint64, ) (*model.ConvenienceNotice, error)
func (*NoticeRepository) FindNoticeByOutputIndexAndAppContract ¶
func (c *NoticeRepository) FindNoticeByOutputIndexAndAppContract( ctx context.Context, outputIndex uint64, appContract *common.Address, ) (*model.ConvenienceNotice, error)
func (*NoticeRepository) SetProof ¶
func (c *NoticeRepository) SetProof( ctx context.Context, notice *model.ConvenienceNotice, ) error
func (*NoticeRepository) Update ¶
func (c *NoticeRepository) Update( ctx context.Context, data *model.ConvenienceNotice, ) (*model.ConvenienceNotice, error)
type OutputRepository ¶
func (*OutputRepository) CountAllNotices ¶
func (c *OutputRepository) CountAllNotices( ctx context.Context, ) (uint64, error)
func (*OutputRepository) CountAllOutputs ¶
func (c *OutputRepository) CountAllOutputs( ctx context.Context, ) (uint64, error)
func (*OutputRepository) CountAllVouchers ¶
func (c *OutputRepository) CountAllVouchers( ctx context.Context, ) (uint64, error)
func (*OutputRepository) CountNoticeProofs ¶
func (c *OutputRepository) CountNoticeProofs(ctx context.Context) (uint64, error)
func (*OutputRepository) CountProofs ¶
func (c *OutputRepository) CountProofs(ctx context.Context) (uint64, error)
func (*OutputRepository) CountVoucherProofs ¶
func (c *OutputRepository) CountVoucherProofs(ctx context.Context) (uint64, error)
type RawInputRef ¶
type RawInputRefRepository ¶
func (*RawInputRefRepository) Create ¶
func (r *RawInputRefRepository) Create(ctx context.Context, rawInput RawInputRef) error
func (*RawInputRefRepository) CreateTables ¶
func (r *RawInputRefRepository) CreateTables() error
func (*RawInputRefRepository) FindByRawIdAndAppContract ¶
func (r *RawInputRefRepository) FindByRawIdAndAppContract(ctx context.Context, rawId uint64, appContract *common.Address) (*RawInputRef, error)
func (*RawInputRefRepository) FindFirstInputByStatusNone ¶
func (r *RawInputRefRepository) FindFirstInputByStatusNone(ctx context.Context, limit int) (*RawInputRef, error)
func (*RawInputRefRepository) GetLatestRawId ¶
func (r *RawInputRefRepository) GetLatestRawId(ctx context.Context) (uint64, error)
func (*RawInputRefRepository) UpdateStatus ¶
type RawOutputRef ¶
type RawOutputRefRepository ¶
func (*RawOutputRefRepository) Create ¶
func (r *RawOutputRefRepository) Create(ctx context.Context, rawOutput RawOutputRef) error
func (*RawOutputRefRepository) CreateTable ¶
func (r *RawOutputRefRepository) CreateTable() error
func (*RawOutputRefRepository) FindByID ¶
func (r *RawOutputRefRepository) FindByID(ctx context.Context, id uint64) (*RawOutputRef, error)
func (*RawOutputRefRepository) GetFirstOutputIdWithoutProof ¶
func (r *RawOutputRefRepository) GetFirstOutputIdWithoutProof(ctx context.Context) (uint64, error)
func (*RawOutputRefRepository) GetLastUpdatedAtExecuted ¶
func (*RawOutputRefRepository) GetLatestOutputRawId ¶
func (r *RawOutputRefRepository) GetLatestOutputRawId(ctx context.Context) (uint64, error)
func (*RawOutputRefRepository) SetExecutedToTrue ¶
func (r *RawOutputRefRepository) SetExecutedToTrue(ctx context.Context, rawOutputRef *RawOutputRef) error
func (*RawOutputRefRepository) SetHasProofToTrue ¶
func (r *RawOutputRefRepository) SetHasProofToTrue(ctx context.Context, rawOutputRef *RawOutputRef) error
type ReportRepository ¶
func (*ReportRepository) BatchFindAllByInputIndexAndAppContract ¶
func (c *ReportRepository) BatchFindAllByInputIndexAndAppContract( ctx context.Context, filters []*BatchFilterItem, ) ([]*commons.PageResult[cModel.Report], []error)
func (*ReportRepository) Count ¶
func (c *ReportRepository) Count( ctx context.Context, filter []*cModel.ConvenienceFilter, ) (uint64, error)
func (*ReportRepository) CreateReport ¶
func (*ReportRepository) CreateTables ¶
func (r *ReportRepository) CreateTables() error
func (*ReportRepository) FindAll ¶
func (c *ReportRepository) FindAll( ctx context.Context, first *int, last *int, after *string, before *string, filter []*cModel.ConvenienceFilter, ) (*commons.PageResult[cModel.Report], error)
func (*ReportRepository) FindAllByInputIndex ¶
func (*ReportRepository) FindByInputAndOutputIndex ¶
func (*ReportRepository) FindByOutputIndexAndAppContract ¶
func (*ReportRepository) FindLastRawId ¶
func (r *ReportRepository) FindLastRawId(ctx context.Context) (uint64, error)
func (*ReportRepository) FindReportByAppContractAndIndex ¶
type SynchronizerRepository ¶
func (*SynchronizerRepository) Count ¶
func (c *SynchronizerRepository) Count( ctx context.Context, ) (uint64, error)
func (*SynchronizerRepository) Create ¶
func (c *SynchronizerRepository) Create( ctx context.Context, data *model.SynchronizerFetch, ) (*model.SynchronizerFetch, error)
func (*SynchronizerRepository) CreateTables ¶
func (c *SynchronizerRepository) CreateTables() error
func (*SynchronizerRepository) GetDB ¶
func (c *SynchronizerRepository) GetDB() *sqlx.DB
func (*SynchronizerRepository) GetLastFetched ¶
func (c *SynchronizerRepository) GetLastFetched( ctx context.Context, ) (*model.SynchronizerFetch, error)
type VoucherRepository ¶
type VoucherRepository struct { Db sqlx.DB OutputRepository OutputRepository AutoCount bool }
func (*VoucherRepository) BatchFindAllByInputIndexAndAppContract ¶
func (c *VoucherRepository) BatchFindAllByInputIndexAndAppContract( ctx context.Context, filters []*BatchFilterItem, ) ([]*commons.PageResult[model.ConvenienceVoucher], []error)
func (*VoucherRepository) Count ¶
func (c *VoucherRepository) Count( ctx context.Context, filter []*model.ConvenienceFilter, ) (uint64, error)
func (*VoucherRepository) CreateTables ¶
func (c *VoucherRepository) CreateTables() error
func (*VoucherRepository) CreateVoucher ¶
func (c *VoucherRepository) CreateVoucher( ctx context.Context, voucher *model.ConvenienceVoucher, ) (*model.ConvenienceVoucher, error)
func (*VoucherRepository) FindAllVouchers ¶
func (c *VoucherRepository) FindAllVouchers( ctx context.Context, first *int, last *int, after *string, before *string, filter []*model.ConvenienceFilter, ) (*commons.PageResult[model.ConvenienceVoucher], error)
func (*VoucherRepository) FindAllVouchersByBlockNumber ¶
func (c *VoucherRepository) FindAllVouchersByBlockNumber( ctx context.Context, startBlockGte uint64, endBlockLt uint64, ) ([]*model.ConvenienceVoucher, error)
func (*VoucherRepository) FindVoucherByAppContractAndIndex ¶
func (c *VoucherRepository) FindVoucherByAppContractAndIndex(ctx context.Context, index int, appContract common.Address) (*model.ConvenienceVoucher, error)
func (*VoucherRepository) FindVoucherByInputAndOutputIndex ¶
func (c *VoucherRepository) FindVoucherByInputAndOutputIndex( ctx context.Context, inputIndex uint64, outputIndex uint64, ) (*model.ConvenienceVoucher, error)
func (*VoucherRepository) FindVoucherByOutputIndexAndAppContract ¶
func (c *VoucherRepository) FindVoucherByOutputIndexAndAppContract( ctx context.Context, outputIndex uint64, appContract *common.Address, ) (*model.ConvenienceVoucher, error)
func (*VoucherRepository) SetExecuted ¶
func (c *VoucherRepository) SetExecuted( ctx context.Context, voucher *model.ConvenienceVoucher, ) error
func (*VoucherRepository) SetProof ¶
func (c *VoucherRepository) SetProof( ctx context.Context, voucher *model.ConvenienceVoucher, ) error
func (*VoucherRepository) UpdateExecuted ¶
func (*VoucherRepository) UpdateVoucher ¶
func (c *VoucherRepository) UpdateVoucher( ctx context.Context, voucher *model.ConvenienceVoucher, ) (*model.ConvenienceVoucher, error)
func (*VoucherRepository) VoucherCount ¶
func (c *VoucherRepository) VoucherCount( ctx context.Context, ) (uint64, error)
Click to show internal directories.
Click to hide internal directories.