Documentation ¶
Index ¶
- func BlockSyncerDBBuilder(ctx *database.Context) (database.Database, error)
- type DB
- func (db *DB) AutoMigrate(ctx context.Context, tables []schema.Tabler) error
- func (db *DB) BatchDeleteGroupMemberToSQL(ctx context.Context, group *models.Group, groupID common.Hash, ...) (string, []interface{})
- func (db *DB) BatchDeletePrefixTreeNodeByBucketAndPathAndFullName(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) error
- func (db *DB) BatchDeletePrefixTreeNodeByID(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) error
- func (db *DB) BatchUpdateBucketSize(ctx context.Context, buckets []*models.Bucket) error
- func (db *DB) CreateGroup(ctx context.Context, groupMembers []*models.Group) error
- func (db *DB) CreateGroupToSQL(ctx context.Context, groupMembers []*models.Group) (string, []interface{})
- func (db *DB) CreateObjectIDMap(ctx context.Context, objectIDMap *bsdb.ObjectIDMap) (string, []interface{})
- func (db *DB) CreatePrefixTree(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) (string, []interface{})
- func (db *DB) CreateStorageProvider(ctx context.Context, storageProvider *models.StorageProvider) error
- func (db *DB) CreateStorageProviderToSQL(ctx context.Context, storageProvider *models.StorageProvider) (string, []interface{})
- func (db *DB) DeleteBlockResult(ctx context.Context, blockHeight int64) error
- func (db *DB) DeleteGVGToSQL(ctx context.Context, gvg *models.GlobalVirtualGroup) (string, []interface{})
- func (db *DB) DeleteGroupToSQL(ctx context.Context, group *models.Group) (string, []interface{})
- func (db *DB) DeleteLVGToSQL(ctx context.Context, lvg *models.LocalVirtualGroup) (string, []interface{})
- func (db *DB) DeletePrefixTree(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) (string, []interface{})
- func (db *DB) GetBucketByBucketName(ctx context.Context, bucketName string) (*models.Bucket, error)
- func (b *DB) GetBucketNameByObjectID(objectID common.Hash) (string, error)
- func (db *DB) GetDataMigrationRecord(ctx context.Context, processKey string) (*bsdb.DataMigrationRecord, error)
- func (db *DB) GetMasterDB(ctx context.Context) (*bsdb.MasterDB, error)
- func (db *DB) GetObject(ctx context.Context, objectId common.Hash) (*models.Object, error)
- func (db *DB) GetObjectCount(needSeal bool, blockHeight int64) ([]int64, error)
- func (db *DB) GetPrefixTree(ctx context.Context, fullName, bucketName string) (*bsdb.SlashPrefixTreeNode, error)
- func (db *DB) GetPrefixTreeCount(ctx context.Context, pathName, bucketName string) (int64, error)
- func (db *DB) GetPrefixTreeObject(ctx context.Context, objectID common.Hash, bucketName string) (*bsdb.SlashPrefixTreeNode, error)
- func (db *DB) GetPrefixTreesByBucketAndPathName(ctx context.Context, bucketName, pathName string) ([]*bsdb.SlashPrefixTreeNode, error)
- func (db *DB) GetPrefixTreesByBucketAndPathNameAndFullName(ctx context.Context, bucketName, pathName, fullName string) (*bsdb.SlashPrefixTreeNode, error)
- func (db *DB) MultiSaveStatement(ctx context.Context, statements []*models.Statements) error
- func (db *DB) MultiSaveStatementToSQL(ctx context.Context, statements []*models.Statements) (string, []interface{})
- func (db *DB) PrepareTables(ctx context.Context, tables []schema.Tabler) error
- func (db *DB) RemoveStatements(ctx context.Context, policyID common.Hash) error
- func (db *DB) RemoveStatementsToSQL(ctx context.Context, policyID common.Hash) (string, []interface{})
- func (db *DB) SaveBlockResult(ctx context.Context, br *models.BlockResult) error
- func (db *DB) SaveBucket(ctx context.Context, bucket *models.Bucket) error
- func (db *DB) SaveBucketToSQL(ctx context.Context, bucket *models.Bucket) (string, []interface{})
- func (db *DB) SaveEpoch(ctx context.Context, epoch *models.Epoch) error
- func (db *DB) SaveEpochToSQL(ctx context.Context, epoch *models.Epoch) (string, []interface{})
- func (db *DB) SaveEventCancelMigrationBucket(ctx context.Context, ...) (string, []interface{})
- func (db *DB) SaveEventCancelSwapOut(ctx context.Context, eventCancelSwapOut *bsdb.EventCancelSwapOut) (string, []interface{})
- func (db *DB) SaveEventCompleteMigrationBucket(ctx context.Context, ...) (string, []interface{})
- func (db *DB) SaveEventCompleteSwapOut(ctx context.Context, eventCompleteSwapOut *bsdb.EventCompleteSwapOut) (string, []interface{})
- func (db *DB) SaveEventMigrationBucket(ctx context.Context, eventMigrationBucket *bsdb.EventMigrationBucket) (string, []interface{})
- func (db *DB) SaveEventRejectMigrationBucket(ctx context.Context, eventRejectMigrationBucket *bsdb.EventRejectMigrateBucket) (string, []interface{})
- func (db *DB) SaveEventSPCompleteExit(ctx context.Context, ...) (string, []interface{})
- func (db *DB) SaveEventSPExit(ctx context.Context, eventSPExit *bsdb.EventStorageProviderExit) (string, []interface{})
- func (db *DB) SaveEventSwapOut(ctx context.Context, eventSwapOut *bsdb.EventSwapOut) (string, []interface{})
- func (db *DB) SaveGVG(ctx context.Context, gvg *models.GlobalVirtualGroup) error
- func (db *DB) SaveGVGToSQL(ctx context.Context, gvg *models.GlobalVirtualGroup) (string, []interface{})
- func (db *DB) SaveLVG(ctx context.Context, lvg *models.LocalVirtualGroup) error
- func (db *DB) SaveLVGToSQL(ctx context.Context, lvg *models.LocalVirtualGroup) (string, []interface{})
- func (db *DB) SaveObject(ctx context.Context, object *models.Object) error
- func (db *DB) SaveObjectToSQL(ctx context.Context, object *models.Object) (string, []interface{})
- func (db *DB) SavePaymentAccount(ctx context.Context, paymentAccount *models.PaymentAccount) error
- func (db *DB) SavePaymentAccountToSQL(ctx context.Context, paymentAccount *models.PaymentAccount) (string, []interface{})
- func (db *DB) SavePermission(ctx context.Context, permission *models.Permission) error
- func (db *DB) SavePermissionToSQL(ctx context.Context, permission *models.Permission) (string, []interface{})
- func (db *DB) SaveStat(ctx context.Context, stat *models.DataStat) error
- func (db *DB) SaveStreamRecord(ctx context.Context, streamRecord *models.StreamRecord) error
- func (db *DB) SaveStreamRecordToSQL(ctx context.Context, streamRecord *models.StreamRecord) (string, []interface{})
- func (db *DB) SaveVGF(ctx context.Context, vgf *models.GlobalVirtualGroupFamily) error
- func (db *DB) SaveVGFToSQL(ctx context.Context, vgf *models.GlobalVirtualGroupFamily) (string, []interface{})
- func (db *DB) SetMasterDB(ctx context.Context, masterDB *bsdb.MasterDB) error
- func (db *DB) UpdateBucket(ctx context.Context, bucket *models.Bucket) error
- func (db *DB) UpdateBucketByNameToSQL(ctx context.Context, bucket *models.Bucket) (string, []interface{})
- func (db *DB) UpdateBucketOffChainStatus(ctx context.Context, bucket *models.Bucket) (string, []interface{})
- func (db *DB) UpdateBucketToSQL(ctx context.Context, bucket *models.Bucket) (string, []interface{})
- func (db *DB) UpdateChargeSizeToSQL(ctx context.Context, objectID common.Hash, bucketName, operation string) (string, []interface{})
- func (db *DB) UpdateDataMigrationRecord(ctx context.Context, processKey string, isCompleted bool) error
- func (db *DB) UpdateGVG(ctx context.Context, gvg *models.GlobalVirtualGroup) error
- func (db *DB) UpdateGVGToSQL(ctx context.Context, gvg *models.GlobalVirtualGroup) (string, []interface{})
- func (db *DB) UpdateGroup(ctx context.Context, group *models.Group) error
- func (db *DB) UpdateGroupByOwnerAndNameToSQL(ctx context.Context, group *models.Group) (string, []interface{})
- func (db *DB) UpdateGroupToSQL(ctx context.Context, group *models.Group) (string, []interface{})
- func (db *DB) UpdateLVG(ctx context.Context, lvg *models.LocalVirtualGroup) error
- func (db *DB) UpdateLVGToSQL(ctx context.Context, lvg *models.LocalVirtualGroup) (string, []interface{})
- func (db *DB) UpdateObject(ctx context.Context, object *models.Object) error
- func (db *DB) UpdateObjectByBucketNameAndObjectNameToSQL(ctx context.Context, object *models.Object) (string, []interface{})
- func (db *DB) UpdateObjectToSQL(ctx context.Context, object *models.Object) (string, []interface{})
- func (db *DB) UpdatePermission(ctx context.Context, permission *models.Permission) error
- func (db *DB) UpdatePermissionToSQL(ctx context.Context, permission *models.Permission) (string, []interface{})
- func (db *DB) UpdateStorageProvider(ctx context.Context, storageProvider *models.StorageProvider) error
- func (db *DB) UpdateStorageProviderToSQL(ctx context.Context, storageProvider *models.StorageProvider) (string, []interface{})
- func (db *DB) UpdateStorageSizeToSQL(ctx context.Context, objectID common.Hash, bucketName, operation string) (string, []interface{})
- func (db *DB) UpdateVGF(ctx context.Context, vgf *models.GlobalVirtualGroupFamily) error
- func (db *DB) UpdateVGFToSQL(ctx context.Context, vgf *models.GlobalVirtualGroupFamily) (string, []interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
DB represents a SQL database with expanded features. so that it can properly store custom BigDipper-related data.
func (*DB) AutoMigrate ¶ added in v0.2.3
func (*DB) BatchDeleteGroupMemberToSQL ¶ added in v1.0.1
func (*DB) BatchDeletePrefixTreeNodeByBucketAndPathAndFullName ¶ added in v1.2.0
func (*DB) BatchDeletePrefixTreeNodeByID ¶ added in v1.2.0
func (*DB) BatchUpdateBucketSize ¶ added in v1.1.0
func (*DB) CreateGroup ¶ added in v0.2.3
func (*DB) CreateGroupToSQL ¶ added in v0.2.3
func (*DB) CreateObjectIDMap ¶ added in v0.2.3
func (db *DB) CreateObjectIDMap(ctx context.Context, objectIDMap *bsdb.ObjectIDMap) (string, []interface{})
CreateObjectIDMap create object id map table entry
func (*DB) CreatePrefixTree ¶
func (db *DB) CreatePrefixTree(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) (string, []interface{})
CreatePrefixTree create prefix tree nodes by input slice
func (*DB) CreateStorageProvider ¶ added in v0.2.3
func (*DB) CreateStorageProviderToSQL ¶ added in v0.2.3
func (*DB) DeleteBlockResult ¶ added in v1.8.0
func (*DB) DeleteGVGToSQL ¶ added in v1.5.0
func (*DB) DeleteGroupToSQL ¶ added in v0.2.4
func (*DB) DeleteLVGToSQL ¶ added in v1.5.0
func (*DB) DeletePrefixTree ¶
func (db *DB) DeletePrefixTree(ctx context.Context, prefixTree []*bsdb.SlashPrefixTreeNode) (string, []interface{})
DeletePrefixTree delete prefix tree nodes by given conditions
func (*DB) GetBucketByBucketName ¶ added in v1.6.0
GetBucketByBucketName get bucket by bucket name
func (*DB) GetBucketNameByObjectID ¶ added in v0.2.3
GetBucketNameByObjectID get bucket name info by an object id
func (*DB) GetDataMigrationRecord ¶ added in v1.1.0
func (*DB) GetMasterDB ¶
GetMasterDB get master db info
func (*DB) GetObjectCount ¶ added in v1.8.0
func (*DB) GetPrefixTree ¶
func (db *DB) GetPrefixTree(ctx context.Context, fullName, bucketName string) (*bsdb.SlashPrefixTreeNode, error)
GetPrefixTree get prefix tree node by full name and bucket name
func (*DB) GetPrefixTreeCount ¶
GetPrefixTreeCount get prefix tree nodes count by path and bucket name
func (*DB) GetPrefixTreeObject ¶
func (db *DB) GetPrefixTreeObject(ctx context.Context, objectID common.Hash, bucketName string) (*bsdb.SlashPrefixTreeNode, error)
GetPrefixTreeObject get prefix tree node object by object id
func (*DB) GetPrefixTreesByBucketAndPathName ¶ added in v1.2.0
func (db *DB) GetPrefixTreesByBucketAndPathName(ctx context.Context, bucketName, pathName string) ([]*bsdb.SlashPrefixTreeNode, error)
GetPrefixTreesByBucketAndPathName get prefix tree node by bucket name and path name
func (*DB) GetPrefixTreesByBucketAndPathNameAndFullName ¶ added in v1.2.0
func (db *DB) GetPrefixTreesByBucketAndPathNameAndFullName(ctx context.Context, bucketName, pathName, fullName string) (*bsdb.SlashPrefixTreeNode, error)
GetPrefixTreesByBucketAndPathNameAndFullName get prefix tree node by bucket name and path name and full name
func (*DB) MultiSaveStatement ¶ added in v0.2.3
func (*DB) MultiSaveStatementToSQL ¶ added in v0.2.3
func (*DB) PrepareTables ¶ added in v0.2.3
func (*DB) RemoveStatements ¶ added in v0.2.3
func (*DB) RemoveStatementsToSQL ¶ added in v0.2.3
func (*DB) SaveBlockResult ¶ added in v1.8.0
func (*DB) SaveBucket ¶ added in v0.2.3
func (*DB) SaveBucketToSQL ¶ added in v0.2.3
func (*DB) SaveEpochToSQL ¶ added in v0.2.3
func (*DB) SaveEventCancelMigrationBucket ¶ added in v0.2.3
func (*DB) SaveEventCancelSwapOut ¶ added in v0.2.3
func (*DB) SaveEventCompleteMigrationBucket ¶ added in v0.2.3
func (*DB) SaveEventCompleteSwapOut ¶ added in v0.2.3
func (*DB) SaveEventMigrationBucket ¶ added in v0.2.3
func (*DB) SaveEventRejectMigrationBucket ¶ added in v1.1.0
func (*DB) SaveEventSPCompleteExit ¶ added in v0.2.3
func (*DB) SaveEventSPExit ¶ added in v0.2.3
func (*DB) SaveEventSwapOut ¶ added in v0.2.3
func (*DB) SaveGVGToSQL ¶ added in v0.2.3
func (*DB) SaveLVGToSQL ¶ added in v0.2.3
func (*DB) SaveObject ¶ added in v0.2.3
func (*DB) SaveObjectToSQL ¶ added in v0.2.3
func (*DB) SavePaymentAccount ¶ added in v0.2.3
func (*DB) SavePaymentAccountToSQL ¶ added in v0.2.3
func (*DB) SavePermission ¶ added in v0.2.3
func (*DB) SavePermissionToSQL ¶ added in v0.2.3
func (*DB) SaveStreamRecord ¶ added in v0.2.3
func (*DB) SaveStreamRecordToSQL ¶ added in v0.2.3
func (*DB) SaveVGFToSQL ¶ added in v0.2.3
func (*DB) SetMasterDB ¶
SetMasterDB set the master db