Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoDB = errors.Validation.NewWithKeyAndDetail("ERR_NO_DB", "no db")
)
Functions ¶
This section is empty.
Types ¶
type BlobHashRepository ¶
type BlobHashRepository struct {
// contains filtered or unexported fields
}
func NewBlobHashRepository ¶
func NewBlobHashRepository(db DB) (*BlobHashRepository, error)
func (*BlobHashRepository) DeleteAllAfterBlockID ¶
func (r *BlobHashRepository) DeleteAllAfterBlockID(blockID uint64) error
DeleteAllAfterBlockID is used when a reorg is detected
func (*BlobHashRepository) FirstByBlobHash ¶
func (r *BlobHashRepository) FirstByBlobHash(blobHash string) (*blobstorage.BlobHash, error)
func (*BlobHashRepository) Save ¶
func (r *BlobHashRepository) Save(opts blobstorage.SaveBlobHashOpts) error
type BlockMetaRepository ¶
type BlockMetaRepository struct {
// contains filtered or unexported fields
}
func NewBlockMetaRepository ¶
func NewBlockMetaRepository(db DB) (*BlockMetaRepository, error)
func (*BlockMetaRepository) DeleteAllAfterBlockID ¶
func (r *BlockMetaRepository) DeleteAllAfterBlockID(blockID uint64) error
DeleteAllAfterBlockID is used when a reorg is detected
func (*BlockMetaRepository) FindLatestBlockID ¶
func (r *BlockMetaRepository) FindLatestBlockID() (uint64, error)
func (*BlockMetaRepository) Save ¶
func (r *BlockMetaRepository) Save(opts blobstorage.SaveBlockMetaOpts) error
type DBTransaction ¶
type DBTransaction interface {
Begin() *DB
}
type Repositories ¶
type Repositories struct { BlobHashRepo *BlobHashRepository BlockMetaRepo *BlockMetaRepository // contains filtered or unexported fields }
func NewRepositories ¶
func NewRepositories(db DB) (*Repositories, error)
func (*Repositories) DeleteAllAfterBlockID ¶
func (r *Repositories) DeleteAllAfterBlockID(ctx context.Context, blockID uint64) error
Database transaction to delete all blobs and blocks meta after a block id
func (*Repositories) SaveBlobAndBlockMeta ¶
func (r *Repositories) SaveBlobAndBlockMeta( ctx context.Context, saveBlockMetaOpts *blobstorage.SaveBlockMetaOpts, saveBlobHashOpts *blobstorage.SaveBlobHashOpts, ) error
Database transaction to store blobs and blocks meta func (r *Repositories) SaveBlobAndBlockMeta(ctx context.Context, opts *blobstorage.SaveBlobAndBlockMetaOpts) error {
Click to show internal directories.
Click to hide internal directories.