bsdb

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: store/bsdb/database.go

Generated by this command:

mockgen -source=store/bsdb/database.go -destination=store/bsdb/database_mock.go -package=bsdb

Package bsdb is a generated GoMock package.

Index

Constants

View Source
const (
	// BsDBUser defines env variable name for block syncer db username.
	BsDBUser = "BS_DB_USER"
	// BsDBPasswd defines env variable name for block syncer db user passwd.
	BsDBPasswd = "BS_DB_PASSWORD"
	// BsDBAddress defines env variable name for block syncer db address.
	BsDBAddress = "BS_DB_ADDRESS"
	// BsDBDatabase defines env variable name for block syncer db database.
	BsDBDatabase = "BS_DB_DATABASE"
	// BsDBSwitchedUser defines env variable name for switched block syncer db username.
	BsDBSwitchedUser = "BS_DB_SWITCHED_USER"
	// BsDBSwitchedPasswd defines env variable name for switched block syncer db user passwd.
	BsDBSwitchedPasswd = "BS_DB_SWITCHED_PASSWORD"
	// BsDBSwitchedAddress defines env variable name for switched block syncer db address.
	BsDBSwitchedAddress = "BS_DB_SWITCHED_ADDRESS"
	// BsDBSwitchedDatabase defines env variable name for switched block syncer db database.
	BsDBSwitchedDatabase = "BS_DB_SWITCHED_DATABASE"
)
View Source
const (
	// DeletedObjectsDefaultSize defines the default size of ListDeletedObjectsByBlockNumberRange response
	DeletedObjectsDefaultSize = 1000
	// ExpiredBucketsDefaultSize defines the default size of ListExpiredBucketsBySp response
	ExpiredBucketsDefaultSize = 1000
	// ListObjectsDefaultMaxKeys defines the default size of ListObjectsByBucketName response
	ListObjectsDefaultMaxKeys = 50
	// ListGroupsDefaultLimit defines the default size of GetUserGroups response
	ListGroupsDefaultLimit = 50
	// GetUserBucketsLimitSize defines the default limit for the number of buckets in any given account is 100
	GetUserBucketsLimitSize = 100
	// ListObjectsLimitSize defines the default limit of ListObjectsByBucketName response
	ListObjectsLimitSize = 1000
	// ListGroupsLimitSize defines the default limit of GetUserGroups response
	ListGroupsLimitSize = 1000
	// 	LisPoliciesDefaultLimit defines the default size of policies response
	LisPoliciesDefaultLimit = 50
	// LisPoliciesLimitSize defines the max limit of policies response
	LisPoliciesLimitSize = 1000
)

define metadata query statement

View Source
const (
	// BucketTableName defines the name of bucket table
	BucketTableName = "buckets"
	// ObjectTableName defines the name of object table
	ObjectTableName = "objects"
	// EpochTableName defines the name of epoch table
	EpochTableName = "epoch"
	// PermissionTableName defines the name of permission table
	PermissionTableName = "permission"
	// StatementTableName defines the name of statement table
	StatementTableName = "statements"
	// GroupTableName defines the name of group table
	GroupTableName = "groups"
	// MasterDBTableName defines the name of master db table
	MasterDBTableName = "master_db"
	// DataMigrationRecordTableName defines the name of data migration record table
	DataMigrationRecordTableName = "data_migration_record"
	// PrefixTreeTableName defines the name of prefix tree node table
	PrefixTreeTableName = "slash_prefix_tree_nodes"
	// GlobalVirtualGroupFamilyTableName defines the name of global virtual group family table
	GlobalVirtualGroupFamilyTableName = "global_virtual_group_families"
	// LocalVirtualGroupTableName defines the name of local virtual group table
	LocalVirtualGroupTableName = "local_virtual_groups"
	// GlobalVirtualGroupTableName defines the name of global virtual group table
	GlobalVirtualGroupTableName = "global_virtual_groups"
	// EventMigrationTableName defines the name of event migrate bucket table
	EventMigrationTableName = "event_migration_bucket"
	// EventCompleteMigrationTableName defines the name of event complete migrate bucket table
	EventCompleteMigrationTableName = "event_complete_migration_bucket"
	// EventCancelMigrationTableName defines the name of event cancel migrate bucket table
	EventCancelMigrationTableName = "event_cancel_migration_bucket"
	// EventRejectMigrateTableName defines the name of event reject migrate bucket table
	EventRejectMigrateTableName = "event_reject_migrate_bucket"
	// EventStorageProviderExitTableName defines the name of event sp exit table
	EventStorageProviderExitTableName = "event_sp_exit"
	// EventCompleteStorageProviderExitTableName defines the name of event sp exit complete table
	EventCompleteStorageProviderExitTableName = "event_sp_exit_complete"
	// EventSwapOutTableName defines the name of event swap out table
	EventSwapOutTableName = "event_swap_out"
	// ObjectIDMapTableName defines the name of object id map table
	ObjectIDMapTableName = "object_id_map"
	// EventCompleteSwapOutTableName defines the name of event swap out complete table
	EventCompleteSwapOutTableName = "event_swap_out_complete"
	// EventCancelSwapOutTableName defines the name of event swap out cancel table
	EventCancelSwapOutTableName = "event_cancel_swap_out"
	// StorageProviderTableName defines the name of storage providers table
	StorageProviderTableName = "storage_providers"
	// StreamRecordTableName stream records of payment info
	StreamRecordTableName = "stream_records"
	// PaymentAccountTableName defines payment account info
	PaymentAccountTableName = "payment_accounts"
)

define table name constant of block syncer db

View Source
const (
	ObjectName   = "object"
	CommonPrefix = "common_prefix"
	GroupAddress = "0x0000000000000000000000000000000000000000"
)

define the list objects const

View Source
const (
	DatabaseSuccess = "success"
	DatabaseFailure = "failure"
	DatabaseLevel   = "database"
)

define the metrics const

View Source
const (
	ProcessKeyUpdateBucketSize      = "key_update_bucket_size"
	ProcessKeyUpdateSlashPrefixTree = "key_update_slash_prefix_tree"
)
View Source
const ObjectsNumberOfShards = 64
View Source
const PrefixesNumberOfShards = 64

Variables

View Source
var (
	AppVersion    = ""
	GitCommit     = ""
	GitCommitDate = ""
)

Build Info (set via linker flags)

ActionTypeMap db action value is a bitmap, traverse this map to get the corresponding action list

Functions

func BucketIDStartAfterFilter added in v0.2.3

func BucketIDStartAfterFilter(bucketID common.Hash) func(db *gorm.DB) *gorm.DB

func ContinuationTokenFilter added in v0.2.0

func ContinuationTokenFilter(continuationToken string) func(db *gorm.DB) *gorm.DB

func CreateAtFilter added in v0.2.3

func CreateAtFilter(createAt int64) func(db *gorm.DB) *gorm.DB

func CreateSwapOutIdx added in v0.2.3

func CreateSwapOutIdx(vgfID uint32, spID uint32, gvgIDS []uint32) string

func FullNameFilter added in v0.2.2

func FullNameFilter(fullName string) func(db *gorm.DB) *gorm.DB

func GetObjectsShardNumberByBucketName added in v0.2.3

func GetObjectsShardNumberByBucketName(bucketName string) uint32

func GetObjectsTableName added in v0.2.3

func GetObjectsTableName(bucketName string) string

func GetObjectsTableNameByShardNumber added in v0.2.3

func GetObjectsTableNameByShardNumber(shard int) string

func GetPrefixesShardNumberByBucketName added in v0.2.3

func GetPrefixesShardNumberByBucketName(bucketName string) uint32

func GetPrefixesTableName added in v0.2.3

func GetPrefixesTableName(bucketName string) string

func GetPrefixesTableNameByShardNumber added in v0.2.3

func GetPrefixesTableNameByShardNumber(shard int) string

func GroupAccountIDStartAfterFilter added in v0.2.4

func GroupAccountIDStartAfterFilter(accountID common.Address) func(db *gorm.DB) *gorm.DB

GroupAccountIDStartAfterFilter In the "group" table, each group has an account ID of "0x0000000000000000000000000000000000000000" representing the group's creation information. Since the "group" table maps groups to account, this special value is used to filter out non-user data

func GroupIDStartAfterFilter added in v0.2.4

func GroupIDStartAfterFilter(groupID common.Hash) func(db *gorm.DB) *gorm.DB

func InitDB

func InitDB(config *config.SQLDBConfig) (*gorm.DB, error)

InitDB init a block syncer db instance

func MetadataDatabaseFailureMetrics added in v0.2.3

func MetadataDatabaseFailureMetrics(err error, startTime time.Time, methodName string)

func MetadataDatabaseSuccessMetrics added in v0.2.3

func MetadataDatabaseSuccessMetrics(startTime time.Time, methodName string)

func NameFilter added in v0.2.2

func NameFilter(name string) func(db *gorm.DB) *gorm.DB

func ObjectIDStartAfterFilter added in v0.2.3

func ObjectIDStartAfterFilter(objectID common.Hash) func(db *gorm.DB) *gorm.DB

func PathNameFilter added in v0.2.2

func PathNameFilter(pathName string) func(db *gorm.DB) *gorm.DB

func PossibleValuesForAction added in v0.2.5

func PossibleValuesForAction(targetAction permtypes.ActionType) []int

func PrefixFilter added in v0.2.0

func PrefixFilter(prefix string) func(db *gorm.DB) *gorm.DB

func RemovedFilter added in v0.2.2

func RemovedFilter(removed bool) func(db *gorm.DB) *gorm.DB

func SourceTypeFilter added in v0.2.2

func SourceTypeFilter(sourceType string) func(db *gorm.DB) *gorm.DB

func WithLimit added in v0.2.3

func WithLimit(limit int) func(*gorm.DB) *gorm.DB

Types

type BSDB

type BSDB interface {
	Metadata
}

BSDB contains all the methods required by block syncer database

type BsDBImpl

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

BsDBImpl block syncer database, implements BSDB interface

func NewBsDB

func NewBsDB(cfg *gfspconfig.GfSpConfig) (*BsDBImpl, error)

NewBsDB return a block syncer db instance or a block syncer db backup instance based on the isBackup flag

func (*BsDBImpl) GetBucketByID

func (b *BsDBImpl) GetBucketByID(bucketID int64, includePrivate bool) (*Bucket, error)

GetBucketByID get buckets info by a bucket id

func (*BsDBImpl) GetBucketByName

func (b *BsDBImpl) GetBucketByName(bucketName string, includePrivate bool) (*Bucket, error)

GetBucketByName get buckets info by a bucket name

func (*BsDBImpl) GetBucketMetaByName added in v0.2.0

func (b *BsDBImpl) GetBucketMetaByName(bucketName string, includePrivate bool) (*BucketFullMeta, error)

func (*BsDBImpl) GetBucketNameByObjectID added in v0.2.3

func (b *BsDBImpl) GetBucketNameByObjectID(objectID common.Hash) (string, error)

GetBucketNameByObjectID get bucket name info by an object id

func (*BsDBImpl) GetBucketSizeByID added in v1.1.0

func (b *BsDBImpl) GetBucketSizeByID(bucketID uint64) (decimal.Decimal, error)

GetBucketSizeByID get bucket size by a bucket id

func (*BsDBImpl) GetDataMigrationRecordByProcessKey added in v1.1.0

func (b *BsDBImpl) GetDataMigrationRecordByProcessKey(processKey string) (*DataMigrationRecord, error)

GetDataMigrationRecordByProcessKey get the record of data migration by the given process key

func (*BsDBImpl) GetDefaultCharacterSet added in v0.2.4

func (b *BsDBImpl) GetDefaultCharacterSet() (string, error)

GetDefaultCharacterSet get the current mysql default character set

func (*BsDBImpl) GetDefaultCollationName added in v0.2.4

func (b *BsDBImpl) GetDefaultCollationName() (string, error)

GetDefaultCollationName get the current mysql default collation name

func (*BsDBImpl) GetEpoch added in v0.2.4

func (b *BsDBImpl) GetEpoch() (*Epoch, error)

GetEpoch get the current epoch

func (*BsDBImpl) GetEventMigrationBucketByBucketID added in v0.2.6

func (b *BsDBImpl) GetEventMigrationBucketByBucketID(bucketID common.Hash) (*EventMigrationBucket, error)

GetEventMigrationBucketByBucketID get migration bucket event by bucket id

func (*BsDBImpl) GetEventSwapOutByGvgID added in v0.2.6

func (b *BsDBImpl) GetEventSwapOutByGvgID(gvgID uint32) (*EventSwapOut, error)

GetEventSwapOutByGvgID get swap out event by gvg id

func (*BsDBImpl) GetGlobalVirtualGroupByGvgID added in v0.2.3

func (b *BsDBImpl) GetGlobalVirtualGroupByGvgID(gvgID uint32) (*GlobalVirtualGroup, error)

GetGlobalVirtualGroupByGvgID get global virtual group by gvg id

func (*BsDBImpl) GetGroupByID added in v0.2.3

func (b *BsDBImpl) GetGroupByID(groupID int64, includeRemoved bool) (*Group, error)

GetGroupByID get group info by object id

func (*BsDBImpl) GetGroupMembers added in v0.2.4

func (b *BsDBImpl) GetGroupMembers(groupID common.Hash, startAfter common.Address, limit int) ([]*GroupMemberMeta, error)

GetGroupMembers get group members by group id

func (*BsDBImpl) GetGroupMembersCount added in v0.2.5

func (b *BsDBImpl) GetGroupMembersCount(groupIDs []common.Hash) ([]*GroupCount, error)

GetGroupMembersCount get the count of group members

func (*BsDBImpl) GetGroupsByGroupIDAndAccount added in v0.1.2

func (b *BsDBImpl) GetGroupsByGroupIDAndAccount(groupIDList []common.Hash, account common.Address, includeRemoved bool) ([]*Group, error)

GetGroupsByGroupIDAndAccount get groups info by group id list and account id

func (*BsDBImpl) GetGvgByBucketAndLvgID added in v0.2.3

func (b *BsDBImpl) GetGvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*GlobalVirtualGroup, error)

GetGvgByBucketAndLvgID get global virtual group by lvg id and bucket id

func (*BsDBImpl) GetLatestBlockNumber

func (b *BsDBImpl) GetLatestBlockNumber() (int64, error)

GetLatestBlockNumber get current latest block number

func (*BsDBImpl) GetLatestObjectID added in v1.2.0

func (b *BsDBImpl) GetLatestObjectID() (uint64, error)

GetLatestObjectID get latest object id

func (*BsDBImpl) GetLvgByBucketAndLvgID added in v0.2.3

func (b *BsDBImpl) GetLvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*LocalVirtualGroup, error)

GetLvgByBucketAndLvgID get global virtual group by lvg id and bucket id

func (*BsDBImpl) GetMigrateBucketCancelEventByBucketID added in v1.2.0

func (b *BsDBImpl) GetMigrateBucketCancelEventByBucketID(bucketID common.Hash) (*EventCancelMigrationBucket, error)

GetMigrateBucketCancelEventByBucketID get migrate bucket event by bucket id

func (*BsDBImpl) GetMigrateBucketEventByBucketID added in v0.2.3

func (b *BsDBImpl) GetMigrateBucketEventByBucketID(bucketID common.Hash) (*EventCompleteMigrationBucket, error)

GetMigrateBucketEventByBucketID get migrate bucket event by bucket id

func (*BsDBImpl) GetMysqlVersion added in v0.2.4

func (b *BsDBImpl) GetMysqlVersion() (string, error)

GetMysqlVersion get the current mysql version

func (*BsDBImpl) GetObjectByID added in v0.2.3

func (b *BsDBImpl) GetObjectByID(objectID int64, includeRemoved bool) (*Object, error)

GetObjectByID get object info by object id

func (*BsDBImpl) GetObjectByName added in v0.1.1

func (b *BsDBImpl) GetObjectByName(objectName string, bucketName string, includePrivate bool) (*Object, error)

GetObjectByName get object info by an object name

func (*BsDBImpl) GetPaymentByBucketID

func (b *BsDBImpl) GetPaymentByBucketID(bucketID int64, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketID get payment info by a bucket id

func (*BsDBImpl) GetPaymentByBucketName

func (b *BsDBImpl) GetPaymentByBucketName(bucketName string, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketName get payment info by a bucket name

func (*BsDBImpl) GetPaymentByPaymentAddress

func (b *BsDBImpl) GetPaymentByPaymentAddress(paymentAddress common.Address) (*StreamRecord, error)

GetPaymentByPaymentAddress get payment info by a payment address

func (*BsDBImpl) GetPermissionByResourceAndPrincipal added in v0.1.2

func (b *BsDBImpl) GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue string, resourceID common.Hash) (*Permission, error)

GetPermissionByResourceAndPrincipal get permission by resource type & ID, principal type & value

func (*BsDBImpl) GetPermissionsByResourceAndPrincipleType added in v0.1.2

func (b *BsDBImpl) GetPermissionsByResourceAndPrincipleType(resourceType, principalType string, resourceID common.Hash, includeRemoved bool) ([]*Permission, error)

GetPermissionsByResourceAndPrincipleType get permission by resource type & ID, principal type

func (*BsDBImpl) GetPrimarySPStreamRecordBySpID added in v1.1.0

func (b *BsDBImpl) GetPrimarySPStreamRecordBySpID(spID uint32) ([]*PrimarySpIncomeMeta, error)

GetPrimarySPStreamRecordBySpID return primary SP's stream records

func (*BsDBImpl) GetSPByAddress added in v0.2.3

func (b *BsDBImpl) GetSPByAddress(operatorAddress common.Address) (*StorageProvider, error)

GetSPByAddress get sp info by operator address

func (*BsDBImpl) GetSecondarySPStreamRecordBySpID added in v1.1.0

func (b *BsDBImpl) GetSecondarySPStreamRecordBySpID(spID uint32) ([]*SecondarySpIncomeMeta, error)

GetSecondarySPStreamRecordBySpID return secondary SP's stream records

func (*BsDBImpl) GetSpVersion added in v0.2.4

func (b *BsDBImpl) GetSpVersion() *SpVersion

func (*BsDBImpl) GetStatementsByPolicyID added in v0.1.2

func (b *BsDBImpl) GetStatementsByPolicyID(policyIDList []common.Hash, includeRemoved bool) ([]*Statement, error)

GetStatementsByPolicyID get statements info by a policy id

func (*BsDBImpl) GetSwitchDBSignal added in v0.2.0

func (b *BsDBImpl) GetSwitchDBSignal() (*MasterDB, error)

GetSwitchDBSignal get signal to switch db

func (*BsDBImpl) GetUserBuckets

func (b *BsDBImpl) GetUserBuckets(accountID common.Address, includeRemoved bool) ([]*Bucket, error)

GetUserBuckets get buckets info by a user address

func (*BsDBImpl) GetUserBucketsCount

func (b *BsDBImpl) GetUserBucketsCount(accountID common.Address, includeRemoved bool) (int64, error)

GetUserBucketsCount get buckets count by a user address

func (*BsDBImpl) GetUserGroups added in v0.2.4

func (b *BsDBImpl) GetUserGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*GroupMemberMeta, error)

GetUserGroups get groups info by a user address

func (*BsDBImpl) GetUserOwnedGroups added in v0.2.4

func (b *BsDBImpl) GetUserOwnedGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*Group, error)

GetUserOwnedGroups retrieve groups where the user is the owner

func (*BsDBImpl) GetVirtualGroupFamiliesByVgfID added in v0.2.3

func (b *BsDBImpl) GetVirtualGroupFamiliesByVgfID(vgfID uint32) (*GlobalVirtualGroupFamily, error)

GetVirtualGroupFamiliesByVgfID get virtual group families by vgf id

func (*BsDBImpl) ListBucketsByIDs added in v0.2.4

func (b *BsDBImpl) ListBucketsByIDs(ids []common.Hash, includeRemoved bool) ([]*Bucket, error)

ListBucketsByIDs list buckets by bucket ids

func (*BsDBImpl) ListBucketsByVgfID added in v0.2.3

func (b *BsDBImpl) ListBucketsByVgfID(vgfIDs []uint32, startAfter common.Hash, limit int) ([]*Bucket, error)

func (*BsDBImpl) ListDeletedObjectsByBlockNumberRange

func (b *BsDBImpl) ListDeletedObjectsByBlockNumberRange(startBlockNumber int64, endBlockNumber int64, includePrivate bool) ([]*Object, error)

ListDeletedObjectsByBlockNumberRange list deleted objects info by a block number range

func (*BsDBImpl) ListExpiredBucketsBySp added in v0.1.2

func (b *BsDBImpl) ListExpiredBucketsBySp(createAt int64, primarySpID uint32, limit int64) ([]*Bucket, error)

ListExpiredBucketsBySp lists expired buckets

func (*BsDBImpl) ListGroupsByIDs added in v0.2.5

func (b *BsDBImpl) ListGroupsByIDs(ids []common.Hash) ([]*Group, error)

ListGroupsByIDs list groups by ids

func (*BsDBImpl) ListGroupsByNameAndSourceType added in v0.2.2

func (b *BsDBImpl) ListGroupsByNameAndSourceType(name, prefix, sourceType string, limit, offset int, includeRemoved bool) ([]*Group, int64, error)

ListGroupsByNameAndSourceType get groups list by specific parameters

func (*BsDBImpl) ListGvgByBucketID added in v0.2.3

func (b *BsDBImpl) ListGvgByBucketID(bucketID common.Hash) ([]*GlobalVirtualGroup, error)

ListGvgByBucketID list global virtual group by bucket id

func (*BsDBImpl) ListGvgByPrimarySpID added in v0.2.3

func (b *BsDBImpl) ListGvgByPrimarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgByPrimarySpID list gvg by primary sp id

func (*BsDBImpl) ListGvgBySecondarySpID added in v0.2.3

func (b *BsDBImpl) ListGvgBySecondarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgBySecondarySpID list gvg by secondary sp id

func (*BsDBImpl) ListLvgByGvgAndBucketID added in v0.2.3

func (b *BsDBImpl) ListLvgByGvgAndBucketID(bucketID common.Hash, gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgAndBucketID list lvg by gvg id and bucket id

func (*BsDBImpl) ListLvgByGvgID added in v0.2.3

func (b *BsDBImpl) ListLvgByGvgID(gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgID list lvg by gvg id

func (*BsDBImpl) ListMigrateBucketEvents added in v0.2.3

func (b *BsDBImpl) ListMigrateBucketEvents(spID uint32, filters ...func(*gorm.DB) *gorm.DB) ([]*EventMigrationBucket, []*EventCompleteMigrationBucket, []*EventCancelMigrationBucket, []*EventRejectMigrateBucket, error)

ListMigrateBucketEvents list migrate bucket events

func (*BsDBImpl) ListObjectPolicies added in v0.2.5

func (b *BsDBImpl) ListObjectPolicies(objectID common.Hash, actionType permtypes.ActionType, startAfter common.Hash, limit int) ([]*PermissionWithStatement, error)

ListObjectPolicies list policies by object info

func (*BsDBImpl) ListObjects added in v0.2.2

func (b *BsDBImpl) ListObjects(bucketName, continuationToken, prefix string, maxKeys int) ([]*ListObjectsResult, error)

ListObjects List objects by bucket name

func (*BsDBImpl) ListObjectsByBucketName

func (b *BsDBImpl) ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter string, maxKeys int, includeRemoved bool) ([]*ListObjectsResult, error)

ListObjectsByBucketName lists objects information by a bucket name. The function takes the following parameters: - bucketName: The name of the bucket to search for objects. - continuationToken: A token to paginate through the list of objects. - prefix: A prefix to filter the objects by their object names. - delimiter: A delimiter to group objects that share a common prefix. An empty delimiter means no grouping. - maxKeys: The maximum number of objects to return in the result.

The function returns a slice of ListObjectsResult, which contains information about the objects and their types (object or common_prefix). If there is a delimiter specified, the function will group objects that share a common prefix and return them as common_prefix in the result. If the delimiter is empty, the function will return all objects without grouping them by a common prefix.

func (*BsDBImpl) ListObjectsByGVGAndBucketForGC added in v0.2.3

func (b *BsDBImpl) ListObjectsByGVGAndBucketForGC(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsByGVGAndBucketForGC list objects by gvg and bucket for gc

func (*BsDBImpl) ListObjectsByIDs added in v0.2.4

func (b *BsDBImpl) ListObjectsByIDs(ids []common.Hash, includeRemoved bool) ([]*Object, error)

ListObjectsByIDs list objects by object ids

func (*BsDBImpl) ListObjectsByLVGID added in v0.2.3

func (b *BsDBImpl) ListObjectsByLVGID(lvgIDs []uint32, bucketID common.Hash, startAfter common.Hash, limit int, filters ...func(*gorm.DB) *gorm.DB) ([]*Object, *Bucket, error)

ListObjectsByLVGID list objects by lvg id

func (*BsDBImpl) ListObjectsInGVG added in v0.2.3

func (b *BsDBImpl) ListObjectsInGVG(gvgID uint32, startAfter common.Hash, limit int) ([]*Object, []*Bucket, error)

ListObjectsInGVG list objects by gvg and bucket id

func (*BsDBImpl) ListObjectsInGVGAndBucket added in v0.2.3

func (b *BsDBImpl) ListObjectsInGVGAndBucket(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsInGVGAndBucket list objects by gvg and bucket id

func (*BsDBImpl) ListPaymentAccountStreams added in v0.2.5

func (b *BsDBImpl) ListPaymentAccountStreams(paymentAccount common.Address) ([]*Bucket, error)

ListPaymentAccountStreams list payment account streams

func (*BsDBImpl) ListSpExitEvents added in v0.2.3

func (b *BsDBImpl) ListSpExitEvents(blockID uint64, spID uint32) (*EventStorageProviderExit, *EventCompleteStorageProviderExit, error)

ListSpExitEvents list sp exit events

func (*BsDBImpl) ListSwapOutEvents added in v0.2.3

func (b *BsDBImpl) ListSwapOutEvents(blockID uint64, spID uint32) ([]*EventSwapOut, []*EventCompleteSwapOut, []*EventCancelSwapOut, error)

ListSwapOutEvents list swap out events

func (*BsDBImpl) ListUserPaymentAccounts added in v0.2.5

func (b *BsDBImpl) ListUserPaymentAccounts(accountID common.Address) ([]*StreamRecordPaymentAccount, error)

ListUserPaymentAccounts list payment accounts by owner address

func (*BsDBImpl) ListVgfByGvgID added in v0.2.3

func (b *BsDBImpl) ListVgfByGvgID(gvgIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVgfByGvgID list vgf by gvg id

func (*BsDBImpl) ListVirtualGroupFamiliesBySpID added in v0.2.3

func (b *BsDBImpl) ListVirtualGroupFamiliesBySpID(spID uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesBySpID list virtual group families by sp id

func (*BsDBImpl) ListVirtualGroupFamiliesByVgfIDs added in v0.2.5

func (b *BsDBImpl) ListVirtualGroupFamiliesByVgfIDs(vgfIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesByVgfIDs list virtual group families by vgf id

type Bucket

type Bucket struct {
	// ID defines db auto_increment id of bucket
	ID uint64 `gorm:"id"`
	// Owner is the account address of bucket creator, it is also the bucket owner.
	Owner common.Address `gorm:"owner"`
	// Operator defines the operator address of bucket
	Operator common.Address `gorm:"operator"`
	// BucketName is a globally unique name of bucket
	BucketName string `gorm:"bucket_name"`
	// Visibility defines the highest permissions for bucket. When a bucket is public, everyone can get storage obj
	Visibility string `gorm:"visibility"`
	// ID is the unique identification for bucket.
	BucketID common.Hash `gorm:"bucket_id"`
	// SourceType defines which chain the user should send the bucket management transactions to
	SourceType string `gorm:"source_type"`
	// CreateAt defines the block number when the bucket created.
	CreateAt int64 `gorm:"create_at"`
	// CreateTime defines the timestamp when the bucket created
	CreateTime int64 `gorm:"create_time"`
	// CreateTxHash defines the creation transaction hash of bucket
	CreateTxHash common.Hash `gorm:"create_tx_hash"`
	// PaymentAddress is the address of the payment account
	PaymentAddress common.Address `gorm:"payment_address"`
	// GlobalVirtualGroupFamilyID defines the unique id of gvg family
	GlobalVirtualGroupFamilyID uint32 `json:"global_virtual_group_family_id"`
	// ReadQuota defines the traffic quota for read
	ChargedReadQuota uint64 `gorm:"charged_read_quota"`
	// PaymentPriceTime defines price time of payment
	PaymentPriceTime int64 `gorm:"payment_price_time"`
	// Removed defines the bucket is deleted or not
	Removed bool `gorm:"removed"`
	// Status defines the status of bucket
	Status string `gorm:"column:status"`
	// DeleteAt defines the block number when the bucket deleted.
	DeleteAt int64 `gorm:"delete_at"`
	// DeleteReason defines the deleted reason of bucket
	DeleteReason string `gorm:"delete_reason"`
	// StorageSize storage size of bucket
	StorageSize decimal.Decimal `gorm:"column:storage_size;type:DECIMAL(65, 0);not null"`
	// ChargeSize charge size of bucket
	ChargeSize decimal.Decimal `gorm:"column:charge_size;type:DECIMAL(65, 0);not null"`
	// UpdateAt defines the block number when the bucket update.
	UpdateAt int64 `gorm:"column:update_at"`
	// UpdateTxHash defines the update transaction hash of bucket
	UpdateTxHash common.Hash `gorm:"update_tx_hash"`
	// UpdateTime defines the timestamp when the bucket update.
	UpdateTime int64 `gorm:"column:update_time"`
	// Tags
	Tags datatypes.JSON `gorm:"column:tags;TYPE:json"` // tags
}

Bucket is the structure for user bucket

func (*Bucket) GetResourceTags added in v1.2.0

func (b *Bucket) GetResourceTags() *storagetypes.ResourceTags

GetResourceTags is used to convert the db tags string to *storage_types.ResourceTags type

func (*Bucket) TableName

func (b *Bucket) TableName() string

TableName is used to set Bucket table name in database

type BucketFullMeta added in v0.2.0

type BucketFullMeta struct {
	Bucket
	StreamRecord
}

BucketFullMeta is the structure for user bucket with its related info

type BucketIDs added in v0.2.2

type BucketIDs struct {
	IDs []uint64 `json:"ids"`
}

BucketIDs represents the request of list bucket by ids

type ByUpdateAtAndObjectID added in v0.2.3

type ByUpdateAtAndObjectID []*Object

func (ByUpdateAtAndObjectID) Len added in v0.2.3

func (a ByUpdateAtAndObjectID) Len() int

func (ByUpdateAtAndObjectID) Less added in v0.2.3

func (a ByUpdateAtAndObjectID) Less(i, j int) bool

Less we want to sort as ascending here

func (ByUpdateAtAndObjectID) Swap added in v0.2.3

func (a ByUpdateAtAndObjectID) Swap(i, j int)

type DataMigrationRecord added in v1.1.0

type DataMigrationRecord struct {
	ProcessKey string `gorm:"column:process_key;not null;primaryKey"`
	// IsCompleted defines if corresponding process has been completed.
	IsCompleted bool `gorm:"column:is_completed;"`
}

DataMigrationRecord stores records of data migration processes.

func (*DataMigrationRecord) TableName added in v1.1.0

func (m *DataMigrationRecord) TableName() string

TableName is used to set Master table name in database

type Epoch

type Epoch struct {
	// OneRowID defines if the table only has one row
	OneRowID bool `gorm:"one_row_id;not null;default:true;primaryKey"`
	// BlockHeight defines the latest block number
	BlockHeight int64 `gorm:"block_height;type:bigint(64)"`
	// BlockHash defines the latest block hash
	BlockHash common.Hash `gorm:"block_hash;type:BINARY(32)"`
	// UpdateTime defines the update time of the latest block
	UpdateTime int64 `gorm:"update_time;type:bigint(64)"`
}

Epoch stores current information of the latest block

func (*Epoch) TableName

func (e *Epoch) TableName() string

TableName is used to set Epoch table name in database

type EventCancelMigrationBucket added in v0.2.3

type EventCancelMigrationBucket struct {
	ID         uint64         `gorm:"column:id;primaryKey"`
	BucketID   common.Hash    `gorm:"column:bucket_id;type:BINARY(32);index:idx_bucket_id"`
	Operator   common.Address `gorm:"column:operator;type:BINARY(20)"`
	BucketName string         `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_name"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventCancelMigrationBucket) TableName added in v0.2.3

func (*EventCancelMigrationBucket) TableName() string

TableName is used to set EventCancelMigrationTableName table name in database

type EventCancelSwapOut added in v0.2.3

type EventCancelSwapOut struct {
	ID                         uint64      `gorm:"column:id;primaryKey"`
	StorageProviderId          uint32      `gorm:"column:storage_provider_id;index:idx_sp_id"`
	GlobalVirtualGroupFamilyId uint32      `gorm:"column:global_virtual_group_family_id;index:idx_vgf_id"`
	GlobalVirtualGroupIds      Uint32Array `gorm:"column:global_virtual_group_ids;type:TEXT"`
	SuccessorSpId              uint32      `gorm:"column:successor_sp_id"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventCancelSwapOut) TableName added in v0.2.3

func (*EventCancelSwapOut) TableName() string

type EventCompleteMigrationBucket added in v0.2.3

type EventCompleteMigrationBucket struct {
	ID                         uint64         `gorm:"column:id;primaryKey"`
	BucketID                   common.Hash    `gorm:"column:bucket_id;type:BINARY(32);index:idx_bucket_id"`
	Operator                   common.Address `gorm:"column:operator;type:BINARY(20)"`
	BucketName                 string         `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_name"`
	GlobalVirtualGroupFamilyId uint32         `gorm:"column:global_virtual_group_family_id"`
	SrcPrimarySpId             uint32         `gorm:"column:src_primary_sp_id"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventCompleteMigrationBucket) TableName added in v0.2.3

func (*EventCompleteMigrationBucket) TableName() string

TableName is used to set EventCompleteMigrationTableName table name in database

type EventCompleteStorageProviderExit added in v0.2.3

type EventCompleteStorageProviderExit struct {
	ID                uint64         `gorm:"column:id;primaryKey"`
	StorageProviderId uint32         `gorm:"column:storage_provider_id;index:idx_sp_id"`
	OperatorAddress   common.Address `gorm:"column:operator_address;type:BINARY(20)"`
	TotalDeposit      *common.Big    `gorm:"column:total_deposit"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventCompleteStorageProviderExit) TableName added in v0.2.3

type EventCompleteSwapOut added in v0.2.3

type EventCompleteSwapOut struct {
	ID                         uint64      `gorm:"column:id;primaryKey"`
	StorageProviderId          uint32      `gorm:"column:storage_provider_id;index:idx_sp_id"`
	SrcStorageProviderId       uint32      `gorm:"column:src_storage_provider_id;index:src_idx_sp_id"`
	GlobalVirtualGroupFamilyId uint32      `gorm:"column:global_virtual_group_family_id;index:idx_vgf_id"`
	GlobalVirtualGroupIds      Uint32Array `gorm:"column:global_virtual_group_ids;type:TEXT"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventCompleteSwapOut) TableName added in v0.2.3

func (*EventCompleteSwapOut) TableName() string

type EventMigrationBucket added in v0.2.3

type EventMigrationBucket struct {
	ID             uint64         `gorm:"column:id;primaryKey"`
	BucketID       common.Hash    `gorm:"column:bucket_id;type:BINARY(32);index:idx_bucket_id"`
	Operator       common.Address `gorm:"column:operator;type:BINARY(20)"`
	BucketName     string         `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_name"`
	DstPrimarySpId uint32         `gorm:"column:dst_primary_sp_id"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventMigrationBucket) TableName added in v0.2.3

func (*EventMigrationBucket) TableName() string

type EventRejectMigrateBucket added in v1.1.0

type EventRejectMigrateBucket struct {
	ID         uint64         `gorm:"column:id;primaryKey"`
	BucketID   common.Hash    `gorm:"column:bucket_id;type:BINARY(32);index:idx_bucket_id"`
	Operator   common.Address `gorm:"column:operator;type:BINARY(20)"`
	BucketName string         `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_name"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventRejectMigrateBucket) TableName added in v1.1.0

func (*EventRejectMigrateBucket) TableName() string

type EventStorageProviderExit added in v0.2.3

type EventStorageProviderExit struct {
	ID                uint64         `gorm:"column:id;primaryKey"`
	StorageProviderId uint32         `gorm:"column:storage_provider_id;index:idx_sp_id"`
	OperatorAddress   common.Address `gorm:"column:operator_address;type:BINARY(20)"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventStorageProviderExit) TableName added in v0.2.3

func (*EventStorageProviderExit) TableName() string

type EventSwapOut added in v0.2.3

type EventSwapOut struct {
	ID                         uint64      `gorm:"column:id;primaryKey"`
	StorageProviderId          uint32      `gorm:"column:storage_provider_id;index:idx_sp_id"`
	GlobalVirtualGroupFamilyId uint32      `gorm:"column:global_virtual_group_family_id;index:idx_vgf_id"`
	GlobalVirtualGroupIds      Uint32Array `gorm:"column:global_virtual_group_ids;type:TEXT"`
	SuccessorSpId              uint32      `gorm:"column:successor_sp_id"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
}

func (*EventSwapOut) TableName added in v0.2.3

func (*EventSwapOut) TableName() string

type GlobalVirtualGroup added in v0.2.3

type GlobalVirtualGroup struct {
	ID                    uint64         `gorm:"column:id;primaryKey"`
	GlobalVirtualGroupId  uint32         `gorm:"column:global_virtual_group_id;index:idx_gvg_id"`
	FamilyId              uint32         `gorm:"column:family_id"`
	PrimarySpId           uint32         `gorm:"column:primary_sp_id;index:idx_primary_sp_id"`
	SecondarySpIds        Uint32Array    `gorm:"column:secondary_sp_ids;type:TEXT"`
	StoredSize            uint64         `gorm:"column:stored_size"`
	VirtualPaymentAddress common.Address `gorm:"column:virtual_payment_address;type:BINARY(20)"`
	TotalDeposit          *common.Big    `gorm:"column:total_deposit"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
	UpdateAt     int64       `gorm:"column:update_at"`
	UpdateTxHash common.Hash `gorm:"column:update_tx_hash;type:BINARY(32);not null"`
	UpdateTime   int64       `gorm:"column:update_time"` // seconds
	Removed      bool        `gorm:"column:removed;default:false"`
}

GlobalVirtualGroup is a global virtual group consists of one primary SP (SP) and multiple secondary SP.

func (*GlobalVirtualGroup) TableName added in v0.2.3

func (g *GlobalVirtualGroup) TableName() string

TableName is used to set GlobalVirtualGroup table name in database

type GlobalVirtualGroupFamily added in v0.2.3

type GlobalVirtualGroupFamily struct {
	ID                         uint64         `gorm:"column:id;primaryKey"`
	GlobalVirtualGroupFamilyId uint32         `gorm:"column:global_virtual_group_family_id;index:idx_vgf_id"`
	PrimarySpId                uint32         `gorm:"column:primary_sp_id;index:idx_primary_sp_id"`
	GlobalVirtualGroupIds      Uint32Array    `gorm:"column:global_virtual_group_ids;type:MEDIUMTEXT"`
	VirtualPaymentAddress      common.Address `gorm:"column:virtual_payment_address;type:BINARY(20)"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
	UpdateAt     int64       `gorm:"column:update_at"`
	UpdateTxHash common.Hash `gorm:"column:update_tx_hash;type:BINARY(32);not null"`
	UpdateTime   int64       `gorm:"column:update_time"` // seconds
	Removed      bool        `gorm:"column:removed;default:false"`
}

GlobalVirtualGroupFamily defines a set of physical nodes, which only serve part of the buckets

func (*GlobalVirtualGroupFamily) TableName added in v0.2.3

func (g *GlobalVirtualGroupFamily) TableName() string

TableName is used to set VirtualGroupFamily table name in database

type Group added in v0.1.2

type Group struct {
	// ID defines db auto_increment id of group
	ID uint64 `gorm:"column:id"`
	// Owner is the account address of group creator
	Owner common.Address `gorm:"column:owner"`
	// GroupID is the unique identification for bucket.
	GroupID common.Hash `gorm:"column:group_id"`
	// GroupName defines the name of the group
	GroupName string `gorm:"column:group_name"`
	// SourceType defines which chain the user should send the bucket management transactions to
	SourceType string `gorm:"column:source_type"`
	// Extra defines the extra info for the group to update
	Extra string `gorm:"column:extra"`
	// AccountID defines the group user address
	AccountID common.Address `gorm:"column:account_id"`
	// Operator defines operator address of group
	Operator common.Address `gorm:"column:operator"`
	// ExpirationTime defines the expiration time of group member
	ExpirationTime int64 `gorm:"column:expiration_time"`
	// CreateAt defines the block number when the group created
	CreateAt int64 `gorm:"column:create_at"`
	// CreateTime defines the timestamp when the group created
	CreateTime int64 `gorm:"column:create_time"`
	// UpdateAt defines the block number when the group updated
	UpdateAt int64 `gorm:"column:update_at"`
	// UpdateTime defines the timestamp when the group updated
	UpdateTime int64 `gorm:"column:update_time"`
	// Removed defines the group is deleted or not
	Removed bool `gorm:"column:removed"`
	// Tags
	Tags datatypes.JSON `gorm:"column:tags;TYPE:json"` // tags
}

Group is the structure for group information

func (*Group) GetResourceTags added in v1.2.0

func (g *Group) GetResourceTags() *storagetypes.ResourceTags

GetResourceTags is used to convert the db tags string to *storage_types.ResourceTags type

func (*Group) TableName added in v0.1.2

func (g *Group) TableName() string

TableName is used to set Group table name in database

type GroupCount added in v0.2.5

type GroupCount struct {
	GroupID common.Hash `gorm:"column:group_id"`
	Count   int64       `gorm:"column:count"`
}

type GroupMemberMeta added in v1.2.0

type GroupMemberMeta struct {
	Group
	// SourceType defines which chain the user should send the bucket management transactions to
	SourceType string `gorm:"column:group_source_type"`
	// Extra defines the extra info for the group to update
	Extra string `gorm:"column:group_extra"`
	// Tags
	Tags datatypes.JSON `gorm:"column:group_tags;TYPE:json"`
}

GroupMemberMeta defines the metadata associated with a group member, including information related to the group such as extra data, tags, and source tags.

func (*GroupMemberMeta) GetResourceTags added in v1.2.0

func (g *GroupMemberMeta) GetResourceTags() *storagetypes.ResourceTags

GetResourceTags is used to convert the db tags string to *storage_types.ResourceTags type

type GroupMeta added in v0.2.4

type GroupMeta struct {
	// AccountID defines the group user address
	AccountID common.Address `gorm:"column:account_id"`
	// ExpirationTime defines the expiration time of group member
	ExpirationTime int64 `gorm:"column:expiration_time"`
}

type ListObjectsResult added in v0.2.0

type ListObjectsResult struct {
	PathName   string
	ResultType string
	*Object
}

ListObjectsResult represents the result of a List Objects operation.

type LocalVirtualGroup added in v0.2.3

type LocalVirtualGroup struct {
	ID                   uint64      `gorm:"column:id;primaryKey"`
	LocalVirtualGroupId  uint32      `gorm:"column:local_virtual_group_id;index:idx_lvg_id"`
	GlobalVirtualGroupId uint32      `gorm:"column:global_virtual_group_id;index:idx_gvg_id"`
	BucketID             common.Hash `gorm:"column:bucket_id;type:BINARY(32);index:idx_bucket_id"`
	StoredSize           uint64      `gorm:"column:stored_size"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	CreateTime   int64       `gorm:"column:create_time"` // seconds
	UpdateAt     int64       `gorm:"column:update_at"`
	UpdateTxHash common.Hash `gorm:"column:update_tx_hash;type:BINARY(32);not null"`
	UpdateTime   int64       `gorm:"column:update_time"` // seconds
	Removed      bool        `gorm:"column:removed;default:false"`
}

func (*LocalVirtualGroup) TableName added in v0.2.3

func (g *LocalVirtualGroup) TableName() string

TableName is used to set VirtualGroupFamily table name in database

type MasterDB added in v0.2.0

type MasterDB struct {
	OneRowId bool `gorm:"column:one_row_id;not null;primaryKey"`
	// IsMaster defines if current DB is master DB
	IsMaster bool `gorm:"column:is_master;not null;"`
}

MasterDB stores current master DB

func (*MasterDB) TableName added in v0.2.0

func (m *MasterDB) TableName() string

TableName is used to set Master table name in database

type Metadata

type Metadata interface {
	// GetUserBuckets get buckets info by a user address
	GetUserBuckets(accountID common.Address, includeRemoved bool) ([]*Bucket, error)
	// GetUserBucketsCount get buckets count by a user address
	GetUserBucketsCount(accountID common.Address, includeRemoved bool) (int64, error)
	// GetBucketByName get buckets info by a bucket name
	GetBucketByName(bucketName string, includePrivate bool) (*Bucket, error)
	// GetBucketByID get buckets info by by a bucket id
	GetBucketByID(bucketID int64, includePrivate bool) (*Bucket, error)
	// GetLatestBlockNumber get current latest block number
	GetLatestBlockNumber() (int64, error)
	// GetPaymentByBucketName get bucket payment info by a bucket name
	GetPaymentByBucketName(bucketName string, includePrivate bool) (*StreamRecord, error)
	// GetPaymentByBucketID get bucket payment info by a bucket id
	GetPaymentByBucketID(bucketID int64, includePrivate bool) (*StreamRecord, error)
	// GetPaymentByPaymentAddress get bucket payment info by a payment address
	GetPaymentByPaymentAddress(address common.Address) (*StreamRecord, error)
	// GetPermissionByResourceAndPrincipal get permission info by resource type & id, principal type & value
	GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue string, resourceID common.Hash) (*Permission, error)
	// GetStatementsByPolicyID get statements info by a policy id
	GetStatementsByPolicyID(policyIDList []common.Hash, includeRemoved bool) ([]*Statement, error)
	// GetPermissionsByResourceAndPrincipleType get permissions info by resource type & id, principal type
	GetPermissionsByResourceAndPrincipleType(resourceType, principalType string, resourceID common.Hash, includeRemoved bool) ([]*Permission, error)
	// GetGroupsByGroupIDAndAccount get groups info by group id list and account id
	GetGroupsByGroupIDAndAccount(groupIDList []common.Hash, account common.Address, includeRemoved bool) ([]*Group, error)
	// ListObjectsByBucketName list objects info by a bucket name
	ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter string, maxKeys int, includeRemoved bool) ([]*ListObjectsResult, error)
	// ListDeletedObjectsByBlockNumberRange list deleted objects info by a block number range
	ListDeletedObjectsByBlockNumberRange(startBlockNumber int64, endBlockNumber int64, includePrivate bool) ([]*Object, error)
	// ListExpiredBucketsBySp list expired buckets by sp
	ListExpiredBucketsBySp(createAt int64, primarySpID uint32, limit int64) ([]*Bucket, error)
	// GetObjectByName get object info by an object name
	GetObjectByName(objectName string, bucketName string, includePrivate bool) (*Object, error)
	// GetObjectByID get object info by an object id
	GetObjectByID(objectID int64, includeRemoved bool) (*Object, error)
	// GetLatestObjectID get latest object id
	GetLatestObjectID() (uint64, error)
	// GetSwitchDBSignal check if there is a signal to switch the database
	GetSwitchDBSignal() (*MasterDB, error)
	// GetBucketMetaByName get bucket info with its related info
	GetBucketMetaByName(bucketName string, includePrivate bool) (*BucketFullMeta, error)
	// ListGroupsByNameAndSourceType get groups list by specific parameters
	ListGroupsByNameAndSourceType(name, prefix, sourceType string, limit, offset int, includeRemoved bool) ([]*Group, int64, error)
	// ListObjectsByIDs list objects by object ids
	ListObjectsByIDs(ids []common.Hash, includeRemoved bool) ([]*Object, error)
	// ListBucketsByIDs list buckets by bucket ids
	ListBucketsByIDs(ids []common.Hash, includeRemoved bool) ([]*Bucket, error)
	// GetGroupByID get group info by an object id
	GetGroupByID(groupID int64, includeRemoved bool) (*Group, error)
	// ListVirtualGroupFamiliesBySpID list virtual group families by sp id
	ListVirtualGroupFamiliesBySpID(spID uint32) ([]*GlobalVirtualGroupFamily, error)
	// GetVirtualGroupFamiliesByVgfID get virtual group families by vgf id
	GetVirtualGroupFamiliesByVgfID(vgfID uint32) (*GlobalVirtualGroupFamily, error)
	// GetGlobalVirtualGroupByGvgID get global virtual group by gvg id
	GetGlobalVirtualGroupByGvgID(gvgID uint32) (*GlobalVirtualGroup, error)
	// ListObjectsInGVGAndBucket list objects by gvg and bucket id
	ListObjectsInGVGAndBucket(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)
	// ListObjectsByGVGAndBucketForGC list objects by gvg and bucket for gc
	ListObjectsByGVGAndBucketForGC(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)
	// ListObjectsInGVG list objects by gvg
	ListObjectsInGVG(gvgID uint32, startAfter common.Hash, limit int) ([]*Object, []*Bucket, error)
	// ListGvgByPrimarySpID list gvg by primary sp id
	ListGvgByPrimarySpID(spID uint32) ([]*GlobalVirtualGroup, error)
	// ListGvgBySecondarySpID list gvg by secondary sp id
	ListGvgBySecondarySpID(spID uint32) ([]*GlobalVirtualGroup, error)
	// ListGvgByBucketID list global virtual group by bucket id
	ListGvgByBucketID(bucketID common.Hash) ([]*GlobalVirtualGroup, error)
	// ListVgfByGvgID list vgf by gvg ids
	ListVgfByGvgID(gvgIDs []uint32) ([]*GlobalVirtualGroupFamily, error)
	// ListLvgByGvgAndBucketID list lvg by gvg and bucket ids
	ListLvgByGvgAndBucketID(bucketID common.Hash, gvgIDs []uint32) ([]*LocalVirtualGroup, error)
	// ListLvgByGvgID list lvg by gvg ids
	ListLvgByGvgID(gvgIDs []uint32) ([]*LocalVirtualGroup, error)
	// ListBucketsByVgfID list buckets by vgf ids
	ListBucketsByVgfID(vgfIDs []uint32, startAfter common.Hash, limit int) ([]*Bucket, error)
	// ListObjectsByLVGID list objects by lvg id
	ListObjectsByLVGID(lvgIDs []uint32, bucketID common.Hash, startAfter common.Hash, limit int, filters ...func(*gorm.DB) *gorm.DB) ([]*Object, *Bucket, error)
	// GetGvgByBucketAndLvgID get global virtual group by lvg id and bucket id
	GetGvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*GlobalVirtualGroup, error)
	// GetLvgByBucketAndLvgID get global virtual group by lvg id and bucket id
	GetLvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*LocalVirtualGroup, error)
	// ListMigrateBucketEvents list migrate bucket events
	ListMigrateBucketEvents(spID uint32, filters ...func(*gorm.DB) *gorm.DB) ([]*EventMigrationBucket, []*EventCompleteMigrationBucket, []*EventCancelMigrationBucket, []*EventRejectMigrateBucket, error)
	// GetMigrateBucketEventByBucketID get migrate bucket event by bucket id
	GetMigrateBucketEventByBucketID(bucketID common.Hash) (*EventCompleteMigrationBucket, error)
	// ListSwapOutEvents list swap out events
	ListSwapOutEvents(blockID uint64, spID uint32) ([]*EventSwapOut, []*EventCompleteSwapOut, []*EventCancelSwapOut, error)
	// ListSpExitEvents list sp exit events
	ListSpExitEvents(blockID uint64, spID uint32) (*EventStorageProviderExit, *EventCompleteStorageProviderExit, error)
	// GetSPByAddress get sp info by operator address
	GetSPByAddress(operatorAddress common.Address) (*StorageProvider, error)
	// GetMysqlVersion get currently running mysql version of block syncer
	GetMysqlVersion() (string, error)
	// GetEpoch get current epoch of block syncer
	GetEpoch() (*Epoch, error)
	// GetSpVersion get the system version info of SP
	GetSpVersion() *SpVersion
	// GetDefaultCharacterSet get the current mysql default character set
	GetDefaultCharacterSet() (string, error)
	// GetDefaultCollationName get the current mysql default collation name
	GetDefaultCollationName() (string, error)
	// GetUserGroups get groups info by a user address
	GetUserGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*GroupMemberMeta, error)
	// GetGroupMembers get group members by group id
	GetGroupMembers(groupID common.Hash, startAfter common.Address, limit int) ([]*GroupMemberMeta, error)
	// GetUserOwnedGroups retrieve groups where the user is the owner
	GetUserOwnedGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*Group, error)
	// ListObjectPolicies list policies by object info
	ListObjectPolicies(objectID common.Hash, actionType types.ActionType, startAfter common.Hash, limit int) ([]*PermissionWithStatement, error)
	// GetGroupMembersCount get the count of group members
	GetGroupMembersCount(groupIDs []common.Hash) ([]*GroupCount, error)
	// ListVirtualGroupFamiliesByVgfIDs list virtual group families by vgf ids
	ListVirtualGroupFamiliesByVgfIDs(vgfIDs []uint32) ([]*GlobalVirtualGroupFamily, error)
	// ListUserPaymentAccounts list payment accounts by owner address
	ListUserPaymentAccounts(accountID common.Address) ([]*StreamRecordPaymentAccount, error)
	// ListPaymentAccountStreams list payment account streams
	ListPaymentAccountStreams(paymentAccount common.Address) ([]*Bucket, error)
	// ListGroupsByIDs list groups by ids
	ListGroupsByIDs(ids []common.Hash) ([]*Group, error)
	//GetEventMigrationBucketByBucketID get migration bucket event by bucket id
	GetEventMigrationBucketByBucketID(bucketID common.Hash) (*EventMigrationBucket, error)
	//GetEventSwapOutByGvgID get swap out event by gvg id
	GetEventSwapOutByGvgID(gvgID uint32) (*EventSwapOut, error)
	// GetPrimarySPStreamRecordBySpID return primary SP's stream records
	GetPrimarySPStreamRecordBySpID(spID uint32) ([]*PrimarySpIncomeMeta, error)
	// GetSecondarySPStreamRecordBySpID return secondary SP's stream records
	GetSecondarySPStreamRecordBySpID(spID uint32) ([]*SecondarySpIncomeMeta, error)
	// GetBucketSizeByID get bucket size info by a bucket id
	GetBucketSizeByID(bucketID uint64) (decimal.Decimal, error)
	// GetDataMigrationRecordByProcessKey  get the record of data migration by the given process key
	GetDataMigrationRecordByProcessKey(processKey string) (*DataMigrationRecord, error)
}

Metadata contains all the methods required by block syncer db database

type MockBSDB added in v0.2.0

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

MockBSDB is a mock of BSDB interface.

func NewMockBSDB added in v0.2.0

func NewMockBSDB(ctrl *gomock.Controller) *MockBSDB

NewMockBSDB creates a new mock instance.

func (*MockBSDB) EXPECT added in v0.2.0

func (m *MockBSDB) EXPECT() *MockBSDBMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBSDB) GetBucketByID added in v0.2.0

func (m *MockBSDB) GetBucketByID(bucketID int64, includePrivate bool) (*Bucket, error)

GetBucketByID mocks base method.

func (*MockBSDB) GetBucketByName added in v0.2.0

func (m *MockBSDB) GetBucketByName(bucketName string, includePrivate bool) (*Bucket, error)

GetBucketByName mocks base method.

func (*MockBSDB) GetBucketMetaByName added in v0.2.0

func (m *MockBSDB) GetBucketMetaByName(bucketName string, includePrivate bool) (*BucketFullMeta, error)

GetBucketMetaByName mocks base method.

func (*MockBSDB) GetBucketSizeByID added in v1.1.0

func (m *MockBSDB) GetBucketSizeByID(bucketID uint64) (decimal.Decimal, error)

GetBucketSizeByID mocks base method.

func (*MockBSDB) GetDataMigrationRecordByProcessKey added in v1.1.0

func (m *MockBSDB) GetDataMigrationRecordByProcessKey(processKey string) (*DataMigrationRecord, error)

GetDataMigrationRecordByProcessKey mocks base method.

func (*MockBSDB) GetDefaultCharacterSet added in v0.2.4

func (m *MockBSDB) GetDefaultCharacterSet() (string, error)

GetDefaultCharacterSet mocks base method.

func (*MockBSDB) GetDefaultCollationName added in v0.2.4

func (m *MockBSDB) GetDefaultCollationName() (string, error)

GetDefaultCollationName mocks base method.

func (*MockBSDB) GetEpoch added in v0.2.4

func (m *MockBSDB) GetEpoch() (*Epoch, error)

GetEpoch mocks base method.

func (*MockBSDB) GetEventMigrationBucketByBucketID added in v0.2.6

func (m *MockBSDB) GetEventMigrationBucketByBucketID(bucketID common.Hash) (*EventMigrationBucket, error)

GetEventMigrationBucketByBucketID mocks base method.

func (*MockBSDB) GetEventSwapOutByGvgID added in v0.2.6

func (m *MockBSDB) GetEventSwapOutByGvgID(gvgID uint32) (*EventSwapOut, error)

GetEventSwapOutByGvgID mocks base method.

func (*MockBSDB) GetGlobalVirtualGroupByGvgID added in v0.2.3

func (m *MockBSDB) GetGlobalVirtualGroupByGvgID(gvgID uint32) (*GlobalVirtualGroup, error)

GetGlobalVirtualGroupByGvgID mocks base method.

func (*MockBSDB) GetGroupByID added in v0.2.3

func (m *MockBSDB) GetGroupByID(groupID int64, includeRemoved bool) (*Group, error)

GetGroupByID mocks base method.

func (*MockBSDB) GetGroupMembers added in v0.2.4

func (m *MockBSDB) GetGroupMembers(groupID common.Hash, startAfter common.Address, limit int) ([]*GroupMemberMeta, error)

GetGroupMembers mocks base method.

func (*MockBSDB) GetGroupMembersCount added in v0.2.5

func (m *MockBSDB) GetGroupMembersCount(groupIDs []common.Hash) ([]*GroupCount, error)

GetGroupMembersCount mocks base method.

func (*MockBSDB) GetGroupsByGroupIDAndAccount added in v0.2.0

func (m *MockBSDB) GetGroupsByGroupIDAndAccount(groupIDList []common.Hash, account common.Address, includeRemoved bool) ([]*Group, error)

GetGroupsByGroupIDAndAccount mocks base method.

func (*MockBSDB) GetGvgByBucketAndLvgID added in v0.2.3

func (m *MockBSDB) GetGvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*GlobalVirtualGroup, error)

GetGvgByBucketAndLvgID mocks base method.

func (*MockBSDB) GetLatestBlockNumber added in v0.2.0

func (m *MockBSDB) GetLatestBlockNumber() (int64, error)

GetLatestBlockNumber mocks base method.

func (*MockBSDB) GetLatestObjectID added in v1.2.0

func (m *MockBSDB) GetLatestObjectID() (uint64, error)

GetLatestObjectID mocks base method.

func (*MockBSDB) GetLvgByBucketAndLvgID added in v0.2.3

func (m *MockBSDB) GetLvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*LocalVirtualGroup, error)

GetLvgByBucketAndLvgID mocks base method.

func (*MockBSDB) GetMigrateBucketEventByBucketID added in v0.2.3

func (m *MockBSDB) GetMigrateBucketEventByBucketID(bucketID common.Hash) (*EventCompleteMigrationBucket, error)

GetMigrateBucketEventByBucketID mocks base method.

func (*MockBSDB) GetMysqlVersion added in v0.2.4

func (m *MockBSDB) GetMysqlVersion() (string, error)

GetMysqlVersion mocks base method.

func (*MockBSDB) GetObjectByID added in v0.2.3

func (m *MockBSDB) GetObjectByID(objectID int64, includeRemoved bool) (*Object, error)

GetObjectByID mocks base method.

func (*MockBSDB) GetObjectByName added in v0.2.0

func (m *MockBSDB) GetObjectByName(objectName, bucketName string, includePrivate bool) (*Object, error)

GetObjectByName mocks base method.

func (*MockBSDB) GetPaymentByBucketID added in v0.2.0

func (m *MockBSDB) GetPaymentByBucketID(bucketID int64, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketID mocks base method.

func (*MockBSDB) GetPaymentByBucketName added in v0.2.0

func (m *MockBSDB) GetPaymentByBucketName(bucketName string, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketName mocks base method.

func (*MockBSDB) GetPaymentByPaymentAddress added in v0.2.0

func (m *MockBSDB) GetPaymentByPaymentAddress(address common.Address) (*StreamRecord, error)

GetPaymentByPaymentAddress mocks base method.

func (*MockBSDB) GetPermissionByResourceAndPrincipal added in v0.2.0

func (m *MockBSDB) GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue string, resourceID common.Hash) (*Permission, error)

GetPermissionByResourceAndPrincipal mocks base method.

func (*MockBSDB) GetPermissionsByResourceAndPrincipleType added in v0.2.0

func (m *MockBSDB) GetPermissionsByResourceAndPrincipleType(resourceType, principalType string, resourceID common.Hash, includeRemoved bool) ([]*Permission, error)

GetPermissionsByResourceAndPrincipleType mocks base method.

func (*MockBSDB) GetPrimarySPStreamRecordBySpID added in v1.1.0

func (m *MockBSDB) GetPrimarySPStreamRecordBySpID(spID uint32) ([]*PrimarySpIncomeMeta, error)

GetPrimarySPStreamRecordBySpID mocks base method.

func (*MockBSDB) GetSPByAddress added in v0.2.4

func (m *MockBSDB) GetSPByAddress(operatorAddress common.Address) (*StorageProvider, error)

GetSPByAddress mocks base method.

func (*MockBSDB) GetSecondarySPStreamRecordBySpID added in v1.1.0

func (m *MockBSDB) GetSecondarySPStreamRecordBySpID(spID uint32) ([]*SecondarySpIncomeMeta, error)

GetSecondarySPStreamRecordBySpID mocks base method.

func (*MockBSDB) GetSpVersion added in v0.2.4

func (m *MockBSDB) GetSpVersion() *SpVersion

GetSpVersion mocks base method.

func (*MockBSDB) GetStatementsByPolicyID added in v0.2.0

func (m *MockBSDB) GetStatementsByPolicyID(policyIDList []common.Hash, includeRemoved bool) ([]*Statement, error)

GetStatementsByPolicyID mocks base method.

func (*MockBSDB) GetSwitchDBSignal added in v0.2.0

func (m *MockBSDB) GetSwitchDBSignal() (*MasterDB, error)

GetSwitchDBSignal mocks base method.

func (*MockBSDB) GetUserBuckets added in v0.2.0

func (m *MockBSDB) GetUserBuckets(accountID common.Address, includeRemoved bool) ([]*Bucket, error)

GetUserBuckets mocks base method.

func (*MockBSDB) GetUserBucketsCount added in v0.2.0

func (m *MockBSDB) GetUserBucketsCount(accountID common.Address, includeRemoved bool) (int64, error)

GetUserBucketsCount mocks base method.

func (*MockBSDB) GetUserGroups added in v0.2.4

func (m *MockBSDB) GetUserGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*GroupMemberMeta, error)

GetUserGroups mocks base method.

func (*MockBSDB) GetUserOwnedGroups added in v0.2.4

func (m *MockBSDB) GetUserOwnedGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*Group, error)

GetUserOwnedGroups mocks base method.

func (*MockBSDB) GetVirtualGroupFamiliesByVgfID added in v0.2.3

func (m *MockBSDB) GetVirtualGroupFamiliesByVgfID(vgfID uint32) (*GlobalVirtualGroupFamily, error)

GetVirtualGroupFamiliesByVgfID mocks base method.

func (*MockBSDB) ListBucketsByIDs added in v0.2.4

func (m *MockBSDB) ListBucketsByIDs(ids []common.Hash, includeRemoved bool) ([]*Bucket, error)

ListBucketsByIDs mocks base method.

func (*MockBSDB) ListBucketsByVgfID added in v0.2.3

func (m *MockBSDB) ListBucketsByVgfID(vgfIDs []uint32, startAfter common.Hash, limit int) ([]*Bucket, error)

ListBucketsByVgfID mocks base method.

func (*MockBSDB) ListDeletedObjectsByBlockNumberRange added in v0.2.0

func (m *MockBSDB) ListDeletedObjectsByBlockNumberRange(startBlockNumber, endBlockNumber int64, includePrivate bool) ([]*Object, error)

ListDeletedObjectsByBlockNumberRange mocks base method.

func (*MockBSDB) ListExpiredBucketsBySp added in v0.2.0

func (m *MockBSDB) ListExpiredBucketsBySp(createAt int64, primarySpID uint32, limit int64) ([]*Bucket, error)

ListExpiredBucketsBySp mocks base method.

func (*MockBSDB) ListGroupsByIDs added in v0.2.6

func (m *MockBSDB) ListGroupsByIDs(ids []common.Hash) ([]*Group, error)

ListGroupsByIDs mocks base method.

func (*MockBSDB) ListGroupsByNameAndSourceType added in v0.2.2

func (m *MockBSDB) ListGroupsByNameAndSourceType(name, prefix, sourceType string, limit, offset int, includeRemoved bool) ([]*Group, int64, error)

ListGroupsByNameAndSourceType mocks base method.

func (*MockBSDB) ListGvgByBucketID added in v0.2.3

func (m *MockBSDB) ListGvgByBucketID(bucketID common.Hash) ([]*GlobalVirtualGroup, error)

ListGvgByBucketID mocks base method.

func (*MockBSDB) ListGvgByPrimarySpID added in v0.2.3

func (m *MockBSDB) ListGvgByPrimarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgByPrimarySpID mocks base method.

func (*MockBSDB) ListGvgBySecondarySpID added in v0.2.3

func (m *MockBSDB) ListGvgBySecondarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgBySecondarySpID mocks base method.

func (*MockBSDB) ListLvgByGvgAndBucketID added in v0.2.3

func (m *MockBSDB) ListLvgByGvgAndBucketID(bucketID common.Hash, gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgAndBucketID mocks base method.

func (*MockBSDB) ListLvgByGvgID added in v0.2.3

func (m *MockBSDB) ListLvgByGvgID(gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgID mocks base method.

func (*MockBSDB) ListMigrateBucketEvents added in v0.2.3

func (m *MockBSDB) ListMigrateBucketEvents(spID uint32, filters ...func(*gorm.DB) *gorm.DB) ([]*EventMigrationBucket, []*EventCompleteMigrationBucket, []*EventCancelMigrationBucket, []*EventRejectMigrateBucket, error)

ListMigrateBucketEvents mocks base method.

func (*MockBSDB) ListObjectPolicies added in v0.2.5

func (m *MockBSDB) ListObjectPolicies(objectID common.Hash, actionType types.ActionType, startAfter common.Hash, limit int) ([]*PermissionWithStatement, error)

ListObjectPolicies mocks base method.

func (*MockBSDB) ListObjectsByBucketName added in v0.2.0

func (m *MockBSDB) ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter string, maxKeys int, includeRemoved bool) ([]*ListObjectsResult, error)

ListObjectsByBucketName mocks base method.

func (*MockBSDB) ListObjectsByGVGAndBucketForGC added in v0.2.3

func (m *MockBSDB) ListObjectsByGVGAndBucketForGC(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsByGVGAndBucketForGC mocks base method.

func (*MockBSDB) ListObjectsByIDs added in v0.2.4

func (m *MockBSDB) ListObjectsByIDs(ids []common.Hash, includeRemoved bool) ([]*Object, error)

ListObjectsByIDs mocks base method.

func (*MockBSDB) ListObjectsByLVGID added in v0.2.3

func (m *MockBSDB) ListObjectsByLVGID(lvgIDs []uint32, bucketID, startAfter common.Hash, limit int, filters ...func(*gorm.DB) *gorm.DB) ([]*Object, *Bucket, error)

ListObjectsByLVGID mocks base method.

func (*MockBSDB) ListObjectsInGVG added in v0.2.3

func (m *MockBSDB) ListObjectsInGVG(gvgID uint32, startAfter common.Hash, limit int) ([]*Object, []*Bucket, error)

ListObjectsInGVG mocks base method.

func (*MockBSDB) ListObjectsInGVGAndBucket added in v0.2.3

func (m *MockBSDB) ListObjectsInGVGAndBucket(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsInGVGAndBucket mocks base method.

func (*MockBSDB) ListPaymentAccountStreams added in v0.2.6

func (m *MockBSDB) ListPaymentAccountStreams(paymentAccount common.Address) ([]*Bucket, error)

ListPaymentAccountStreams mocks base method.

func (*MockBSDB) ListSpExitEvents added in v0.2.3

func (m *MockBSDB) ListSpExitEvents(blockID uint64, spID uint32) (*EventStorageProviderExit, *EventCompleteStorageProviderExit, error)

ListSpExitEvents mocks base method.

func (*MockBSDB) ListSwapOutEvents added in v0.2.3

func (m *MockBSDB) ListSwapOutEvents(blockID uint64, spID uint32) ([]*EventSwapOut, []*EventCompleteSwapOut, []*EventCancelSwapOut, error)

ListSwapOutEvents mocks base method.

func (*MockBSDB) ListUserPaymentAccounts added in v0.2.6

func (m *MockBSDB) ListUserPaymentAccounts(accountID common.Address) ([]*StreamRecordPaymentAccount, error)

ListUserPaymentAccounts mocks base method.

func (*MockBSDB) ListVgfByGvgID added in v0.2.3

func (m *MockBSDB) ListVgfByGvgID(gvgIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVgfByGvgID mocks base method.

func (*MockBSDB) ListVirtualGroupFamiliesBySpID added in v0.2.3

func (m *MockBSDB) ListVirtualGroupFamiliesBySpID(spID uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesBySpID mocks base method.

func (*MockBSDB) ListVirtualGroupFamiliesByVgfIDs added in v0.2.6

func (m *MockBSDB) ListVirtualGroupFamiliesByVgfIDs(vgfIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesByVgfIDs mocks base method.

type MockBSDBMockRecorder added in v0.2.0

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

MockBSDBMockRecorder is the mock recorder for MockBSDB.

func (*MockBSDBMockRecorder) GetBucketByID added in v0.2.0

func (mr *MockBSDBMockRecorder) GetBucketByID(bucketID, includePrivate any) *gomock.Call

GetBucketByID indicates an expected call of GetBucketByID.

func (*MockBSDBMockRecorder) GetBucketByName added in v0.2.0

func (mr *MockBSDBMockRecorder) GetBucketByName(bucketName, includePrivate any) *gomock.Call

GetBucketByName indicates an expected call of GetBucketByName.

func (*MockBSDBMockRecorder) GetBucketMetaByName added in v0.2.0

func (mr *MockBSDBMockRecorder) GetBucketMetaByName(bucketName, includePrivate any) *gomock.Call

GetBucketMetaByName indicates an expected call of GetBucketMetaByName.

func (*MockBSDBMockRecorder) GetBucketSizeByID added in v1.1.0

func (mr *MockBSDBMockRecorder) GetBucketSizeByID(bucketID any) *gomock.Call

GetBucketSizeByID indicates an expected call of GetBucketSizeByID.

func (*MockBSDBMockRecorder) GetDataMigrationRecordByProcessKey added in v1.1.0

func (mr *MockBSDBMockRecorder) GetDataMigrationRecordByProcessKey(processKey any) *gomock.Call

GetDataMigrationRecordByProcessKey indicates an expected call of GetDataMigrationRecordByProcessKey.

func (*MockBSDBMockRecorder) GetDefaultCharacterSet added in v0.2.4

func (mr *MockBSDBMockRecorder) GetDefaultCharacterSet() *gomock.Call

GetDefaultCharacterSet indicates an expected call of GetDefaultCharacterSet.

func (*MockBSDBMockRecorder) GetDefaultCollationName added in v0.2.4

func (mr *MockBSDBMockRecorder) GetDefaultCollationName() *gomock.Call

GetDefaultCollationName indicates an expected call of GetDefaultCollationName.

func (*MockBSDBMockRecorder) GetEpoch added in v0.2.4

func (mr *MockBSDBMockRecorder) GetEpoch() *gomock.Call

GetEpoch indicates an expected call of GetEpoch.

func (*MockBSDBMockRecorder) GetEventMigrationBucketByBucketID added in v0.2.6

func (mr *MockBSDBMockRecorder) GetEventMigrationBucketByBucketID(bucketID any) *gomock.Call

GetEventMigrationBucketByBucketID indicates an expected call of GetEventMigrationBucketByBucketID.

func (*MockBSDBMockRecorder) GetEventSwapOutByGvgID added in v0.2.6

func (mr *MockBSDBMockRecorder) GetEventSwapOutByGvgID(gvgID any) *gomock.Call

GetEventSwapOutByGvgID indicates an expected call of GetEventSwapOutByGvgID.

func (*MockBSDBMockRecorder) GetGlobalVirtualGroupByGvgID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetGlobalVirtualGroupByGvgID(gvgID any) *gomock.Call

GetGlobalVirtualGroupByGvgID indicates an expected call of GetGlobalVirtualGroupByGvgID.

func (*MockBSDBMockRecorder) GetGroupByID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetGroupByID(groupID, includeRemoved any) *gomock.Call

GetGroupByID indicates an expected call of GetGroupByID.

func (*MockBSDBMockRecorder) GetGroupMembers added in v0.2.4

func (mr *MockBSDBMockRecorder) GetGroupMembers(groupID, startAfter, limit any) *gomock.Call

GetGroupMembers indicates an expected call of GetGroupMembers.

func (*MockBSDBMockRecorder) GetGroupMembersCount added in v0.2.5

func (mr *MockBSDBMockRecorder) GetGroupMembersCount(groupIDs any) *gomock.Call

GetGroupMembersCount indicates an expected call of GetGroupMembersCount.

func (*MockBSDBMockRecorder) GetGroupsByGroupIDAndAccount added in v0.2.0

func (mr *MockBSDBMockRecorder) GetGroupsByGroupIDAndAccount(groupIDList, account, includeRemoved any) *gomock.Call

GetGroupsByGroupIDAndAccount indicates an expected call of GetGroupsByGroupIDAndAccount.

func (*MockBSDBMockRecorder) GetGvgByBucketAndLvgID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetGvgByBucketAndLvgID(bucketID, lvgID any) *gomock.Call

GetGvgByBucketAndLvgID indicates an expected call of GetGvgByBucketAndLvgID.

func (*MockBSDBMockRecorder) GetLatestBlockNumber added in v0.2.0

func (mr *MockBSDBMockRecorder) GetLatestBlockNumber() *gomock.Call

GetLatestBlockNumber indicates an expected call of GetLatestBlockNumber.

func (*MockBSDBMockRecorder) GetLatestObjectID added in v1.2.0

func (mr *MockBSDBMockRecorder) GetLatestObjectID() *gomock.Call

GetLatestObjectID indicates an expected call of GetLatestObjectID.

func (*MockBSDBMockRecorder) GetLvgByBucketAndLvgID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetLvgByBucketAndLvgID(bucketID, lvgID any) *gomock.Call

GetLvgByBucketAndLvgID indicates an expected call of GetLvgByBucketAndLvgID.

func (*MockBSDBMockRecorder) GetMigrateBucketEventByBucketID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetMigrateBucketEventByBucketID(bucketID any) *gomock.Call

GetMigrateBucketEventByBucketID indicates an expected call of GetMigrateBucketEventByBucketID.

func (*MockBSDBMockRecorder) GetMysqlVersion added in v0.2.4

func (mr *MockBSDBMockRecorder) GetMysqlVersion() *gomock.Call

GetMysqlVersion indicates an expected call of GetMysqlVersion.

func (*MockBSDBMockRecorder) GetObjectByID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetObjectByID(objectID, includeRemoved any) *gomock.Call

GetObjectByID indicates an expected call of GetObjectByID.

func (*MockBSDBMockRecorder) GetObjectByName added in v0.2.0

func (mr *MockBSDBMockRecorder) GetObjectByName(objectName, bucketName, includePrivate any) *gomock.Call

GetObjectByName indicates an expected call of GetObjectByName.

func (*MockBSDBMockRecorder) GetPaymentByBucketID added in v0.2.0

func (mr *MockBSDBMockRecorder) GetPaymentByBucketID(bucketID, includePrivate any) *gomock.Call

GetPaymentByBucketID indicates an expected call of GetPaymentByBucketID.

func (*MockBSDBMockRecorder) GetPaymentByBucketName added in v0.2.0

func (mr *MockBSDBMockRecorder) GetPaymentByBucketName(bucketName, includePrivate any) *gomock.Call

GetPaymentByBucketName indicates an expected call of GetPaymentByBucketName.

func (*MockBSDBMockRecorder) GetPaymentByPaymentAddress added in v0.2.0

func (mr *MockBSDBMockRecorder) GetPaymentByPaymentAddress(address any) *gomock.Call

GetPaymentByPaymentAddress indicates an expected call of GetPaymentByPaymentAddress.

func (*MockBSDBMockRecorder) GetPermissionByResourceAndPrincipal added in v0.2.0

func (mr *MockBSDBMockRecorder) GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue, resourceID any) *gomock.Call

GetPermissionByResourceAndPrincipal indicates an expected call of GetPermissionByResourceAndPrincipal.

func (*MockBSDBMockRecorder) GetPermissionsByResourceAndPrincipleType added in v0.2.0

func (mr *MockBSDBMockRecorder) GetPermissionsByResourceAndPrincipleType(resourceType, principalType, resourceID, includeRemoved any) *gomock.Call

GetPermissionsByResourceAndPrincipleType indicates an expected call of GetPermissionsByResourceAndPrincipleType.

func (*MockBSDBMockRecorder) GetPrimarySPStreamRecordBySpID added in v1.1.0

func (mr *MockBSDBMockRecorder) GetPrimarySPStreamRecordBySpID(spID any) *gomock.Call

GetPrimarySPStreamRecordBySpID indicates an expected call of GetPrimarySPStreamRecordBySpID.

func (*MockBSDBMockRecorder) GetSPByAddress added in v0.2.4

func (mr *MockBSDBMockRecorder) GetSPByAddress(operatorAddress any) *gomock.Call

GetSPByAddress indicates an expected call of GetSPByAddress.

func (*MockBSDBMockRecorder) GetSecondarySPStreamRecordBySpID added in v1.1.0

func (mr *MockBSDBMockRecorder) GetSecondarySPStreamRecordBySpID(spID any) *gomock.Call

GetSecondarySPStreamRecordBySpID indicates an expected call of GetSecondarySPStreamRecordBySpID.

func (*MockBSDBMockRecorder) GetSpVersion added in v0.2.4

func (mr *MockBSDBMockRecorder) GetSpVersion() *gomock.Call

GetSpVersion indicates an expected call of GetSpVersion.

func (*MockBSDBMockRecorder) GetStatementsByPolicyID added in v0.2.0

func (mr *MockBSDBMockRecorder) GetStatementsByPolicyID(policyIDList, includeRemoved any) *gomock.Call

GetStatementsByPolicyID indicates an expected call of GetStatementsByPolicyID.

func (*MockBSDBMockRecorder) GetSwitchDBSignal added in v0.2.0

func (mr *MockBSDBMockRecorder) GetSwitchDBSignal() *gomock.Call

GetSwitchDBSignal indicates an expected call of GetSwitchDBSignal.

func (*MockBSDBMockRecorder) GetUserBuckets added in v0.2.0

func (mr *MockBSDBMockRecorder) GetUserBuckets(accountID, includeRemoved any) *gomock.Call

GetUserBuckets indicates an expected call of GetUserBuckets.

func (*MockBSDBMockRecorder) GetUserBucketsCount added in v0.2.0

func (mr *MockBSDBMockRecorder) GetUserBucketsCount(accountID, includeRemoved any) *gomock.Call

GetUserBucketsCount indicates an expected call of GetUserBucketsCount.

func (*MockBSDBMockRecorder) GetUserGroups added in v0.2.4

func (mr *MockBSDBMockRecorder) GetUserGroups(accountID, startAfter, limit any) *gomock.Call

GetUserGroups indicates an expected call of GetUserGroups.

func (*MockBSDBMockRecorder) GetUserOwnedGroups added in v0.2.4

func (mr *MockBSDBMockRecorder) GetUserOwnedGroups(accountID, startAfter, limit any) *gomock.Call

GetUserOwnedGroups indicates an expected call of GetUserOwnedGroups.

func (*MockBSDBMockRecorder) GetVirtualGroupFamiliesByVgfID added in v0.2.3

func (mr *MockBSDBMockRecorder) GetVirtualGroupFamiliesByVgfID(vgfID any) *gomock.Call

GetVirtualGroupFamiliesByVgfID indicates an expected call of GetVirtualGroupFamiliesByVgfID.

func (*MockBSDBMockRecorder) ListBucketsByIDs added in v0.2.4

func (mr *MockBSDBMockRecorder) ListBucketsByIDs(ids, includeRemoved any) *gomock.Call

ListBucketsByIDs indicates an expected call of ListBucketsByIDs.

func (*MockBSDBMockRecorder) ListBucketsByVgfID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListBucketsByVgfID(vgfIDs, startAfter, limit any) *gomock.Call

ListBucketsByVgfID indicates an expected call of ListBucketsByVgfID.

func (*MockBSDBMockRecorder) ListDeletedObjectsByBlockNumberRange added in v0.2.0

func (mr *MockBSDBMockRecorder) ListDeletedObjectsByBlockNumberRange(startBlockNumber, endBlockNumber, includePrivate any) *gomock.Call

ListDeletedObjectsByBlockNumberRange indicates an expected call of ListDeletedObjectsByBlockNumberRange.

func (*MockBSDBMockRecorder) ListExpiredBucketsBySp added in v0.2.0

func (mr *MockBSDBMockRecorder) ListExpiredBucketsBySp(createAt, primarySpID, limit any) *gomock.Call

ListExpiredBucketsBySp indicates an expected call of ListExpiredBucketsBySp.

func (*MockBSDBMockRecorder) ListGroupsByIDs added in v0.2.6

func (mr *MockBSDBMockRecorder) ListGroupsByIDs(ids any) *gomock.Call

ListGroupsByIDs indicates an expected call of ListGroupsByIDs.

func (*MockBSDBMockRecorder) ListGroupsByNameAndSourceType added in v0.2.2

func (mr *MockBSDBMockRecorder) ListGroupsByNameAndSourceType(name, prefix, sourceType, limit, offset, includeRemoved any) *gomock.Call

ListGroupsByNameAndSourceType indicates an expected call of ListGroupsByNameAndSourceType.

func (*MockBSDBMockRecorder) ListGvgByBucketID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListGvgByBucketID(bucketID any) *gomock.Call

ListGvgByBucketID indicates an expected call of ListGvgByBucketID.

func (*MockBSDBMockRecorder) ListGvgByPrimarySpID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListGvgByPrimarySpID(spID any) *gomock.Call

ListGvgByPrimarySpID indicates an expected call of ListGvgByPrimarySpID.

func (*MockBSDBMockRecorder) ListGvgBySecondarySpID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListGvgBySecondarySpID(spID any) *gomock.Call

ListGvgBySecondarySpID indicates an expected call of ListGvgBySecondarySpID.

func (*MockBSDBMockRecorder) ListLvgByGvgAndBucketID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListLvgByGvgAndBucketID(bucketID, gvgIDs any) *gomock.Call

ListLvgByGvgAndBucketID indicates an expected call of ListLvgByGvgAndBucketID.

func (*MockBSDBMockRecorder) ListLvgByGvgID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListLvgByGvgID(gvgIDs any) *gomock.Call

ListLvgByGvgID indicates an expected call of ListLvgByGvgID.

func (*MockBSDBMockRecorder) ListMigrateBucketEvents added in v0.2.3

func (mr *MockBSDBMockRecorder) ListMigrateBucketEvents(spID any, filters ...any) *gomock.Call

ListMigrateBucketEvents indicates an expected call of ListMigrateBucketEvents.

func (*MockBSDBMockRecorder) ListObjectPolicies added in v0.2.5

func (mr *MockBSDBMockRecorder) ListObjectPolicies(objectID, actionType, startAfter, limit any) *gomock.Call

ListObjectPolicies indicates an expected call of ListObjectPolicies.

func (*MockBSDBMockRecorder) ListObjectsByBucketName added in v0.2.0

func (mr *MockBSDBMockRecorder) ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter, maxKeys, includeRemoved any) *gomock.Call

ListObjectsByBucketName indicates an expected call of ListObjectsByBucketName.

func (*MockBSDBMockRecorder) ListObjectsByGVGAndBucketForGC added in v0.2.3

func (mr *MockBSDBMockRecorder) ListObjectsByGVGAndBucketForGC(bucketID, gvgID, startAfter, limit any) *gomock.Call

ListObjectsByGVGAndBucketForGC indicates an expected call of ListObjectsByGVGAndBucketForGC.

func (*MockBSDBMockRecorder) ListObjectsByIDs added in v0.2.4

func (mr *MockBSDBMockRecorder) ListObjectsByIDs(ids, includeRemoved any) *gomock.Call

ListObjectsByIDs indicates an expected call of ListObjectsByIDs.

func (*MockBSDBMockRecorder) ListObjectsByLVGID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListObjectsByLVGID(lvgIDs, bucketID, startAfter, limit any, filters ...any) *gomock.Call

ListObjectsByLVGID indicates an expected call of ListObjectsByLVGID.

func (*MockBSDBMockRecorder) ListObjectsInGVG added in v0.2.3

func (mr *MockBSDBMockRecorder) ListObjectsInGVG(gvgID, startAfter, limit any) *gomock.Call

ListObjectsInGVG indicates an expected call of ListObjectsInGVG.

func (*MockBSDBMockRecorder) ListObjectsInGVGAndBucket added in v0.2.3

func (mr *MockBSDBMockRecorder) ListObjectsInGVGAndBucket(bucketID, gvgID, startAfter, limit any) *gomock.Call

ListObjectsInGVGAndBucket indicates an expected call of ListObjectsInGVGAndBucket.

func (*MockBSDBMockRecorder) ListPaymentAccountStreams added in v0.2.6

func (mr *MockBSDBMockRecorder) ListPaymentAccountStreams(paymentAccount any) *gomock.Call

ListPaymentAccountStreams indicates an expected call of ListPaymentAccountStreams.

func (*MockBSDBMockRecorder) ListSpExitEvents added in v0.2.3

func (mr *MockBSDBMockRecorder) ListSpExitEvents(blockID, spID any) *gomock.Call

ListSpExitEvents indicates an expected call of ListSpExitEvents.

func (*MockBSDBMockRecorder) ListSwapOutEvents added in v0.2.3

func (mr *MockBSDBMockRecorder) ListSwapOutEvents(blockID, spID any) *gomock.Call

ListSwapOutEvents indicates an expected call of ListSwapOutEvents.

func (*MockBSDBMockRecorder) ListUserPaymentAccounts added in v0.2.6

func (mr *MockBSDBMockRecorder) ListUserPaymentAccounts(accountID any) *gomock.Call

ListUserPaymentAccounts indicates an expected call of ListUserPaymentAccounts.

func (*MockBSDBMockRecorder) ListVgfByGvgID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListVgfByGvgID(gvgIDs any) *gomock.Call

ListVgfByGvgID indicates an expected call of ListVgfByGvgID.

func (*MockBSDBMockRecorder) ListVirtualGroupFamiliesBySpID added in v0.2.3

func (mr *MockBSDBMockRecorder) ListVirtualGroupFamiliesBySpID(spID any) *gomock.Call

ListVirtualGroupFamiliesBySpID indicates an expected call of ListVirtualGroupFamiliesBySpID.

func (*MockBSDBMockRecorder) ListVirtualGroupFamiliesByVgfIDs added in v0.2.6

func (mr *MockBSDBMockRecorder) ListVirtualGroupFamiliesByVgfIDs(vgfIDs any) *gomock.Call

ListVirtualGroupFamiliesByVgfIDs indicates an expected call of ListVirtualGroupFamiliesByVgfIDs.

type MockMetadata added in v0.2.0

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

MockMetadata is a mock of Metadata interface.

func NewMockMetadata added in v0.2.0

func NewMockMetadata(ctrl *gomock.Controller) *MockMetadata

NewMockMetadata creates a new mock instance.

func (*MockMetadata) EXPECT added in v0.2.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMetadata) GetBucketByID added in v0.2.0

func (m *MockMetadata) GetBucketByID(bucketID int64, includePrivate bool) (*Bucket, error)

GetBucketByID mocks base method.

func (*MockMetadata) GetBucketByName added in v0.2.0

func (m *MockMetadata) GetBucketByName(bucketName string, includePrivate bool) (*Bucket, error)

GetBucketByName mocks base method.

func (*MockMetadata) GetBucketMetaByName added in v0.2.0

func (m *MockMetadata) GetBucketMetaByName(bucketName string, includePrivate bool) (*BucketFullMeta, error)

GetBucketMetaByName mocks base method.

func (*MockMetadata) GetBucketSizeByID added in v1.1.0

func (m *MockMetadata) GetBucketSizeByID(bucketID uint64) (decimal.Decimal, error)

GetBucketSizeByID mocks base method.

func (*MockMetadata) GetDataMigrationRecordByProcessKey added in v1.1.0

func (m *MockMetadata) GetDataMigrationRecordByProcessKey(processKey string) (*DataMigrationRecord, error)

GetDataMigrationRecordByProcessKey mocks base method.

func (*MockMetadata) GetDefaultCharacterSet added in v0.2.4

func (m *MockMetadata) GetDefaultCharacterSet() (string, error)

GetDefaultCharacterSet mocks base method.

func (*MockMetadata) GetDefaultCollationName added in v0.2.4

func (m *MockMetadata) GetDefaultCollationName() (string, error)

GetDefaultCollationName mocks base method.

func (*MockMetadata) GetEpoch added in v0.2.4

func (m *MockMetadata) GetEpoch() (*Epoch, error)

GetEpoch mocks base method.

func (*MockMetadata) GetEventMigrationBucketByBucketID added in v0.2.6

func (m *MockMetadata) GetEventMigrationBucketByBucketID(bucketID common.Hash) (*EventMigrationBucket, error)

GetEventMigrationBucketByBucketID mocks base method.

func (*MockMetadata) GetEventSwapOutByGvgID added in v0.2.6

func (m *MockMetadata) GetEventSwapOutByGvgID(gvgID uint32) (*EventSwapOut, error)

GetEventSwapOutByGvgID mocks base method.

func (*MockMetadata) GetGlobalVirtualGroupByGvgID added in v0.2.3

func (m *MockMetadata) GetGlobalVirtualGroupByGvgID(gvgID uint32) (*GlobalVirtualGroup, error)

GetGlobalVirtualGroupByGvgID mocks base method.

func (*MockMetadata) GetGroupByID added in v0.2.3

func (m *MockMetadata) GetGroupByID(groupID int64, includeRemoved bool) (*Group, error)

GetGroupByID mocks base method.

func (*MockMetadata) GetGroupMembers added in v0.2.4

func (m *MockMetadata) GetGroupMembers(groupID common.Hash, startAfter common.Address, limit int) ([]*GroupMemberMeta, error)

GetGroupMembers mocks base method.

func (*MockMetadata) GetGroupMembersCount added in v0.2.5

func (m *MockMetadata) GetGroupMembersCount(groupIDs []common.Hash) ([]*GroupCount, error)

GetGroupMembersCount mocks base method.

func (*MockMetadata) GetGroupsByGroupIDAndAccount added in v0.2.0

func (m *MockMetadata) GetGroupsByGroupIDAndAccount(groupIDList []common.Hash, account common.Address, includeRemoved bool) ([]*Group, error)

GetGroupsByGroupIDAndAccount mocks base method.

func (*MockMetadata) GetGvgByBucketAndLvgID added in v0.2.3

func (m *MockMetadata) GetGvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*GlobalVirtualGroup, error)

GetGvgByBucketAndLvgID mocks base method.

func (*MockMetadata) GetLatestBlockNumber added in v0.2.0

func (m *MockMetadata) GetLatestBlockNumber() (int64, error)

GetLatestBlockNumber mocks base method.

func (*MockMetadata) GetLatestObjectID added in v1.2.0

func (m *MockMetadata) GetLatestObjectID() (uint64, error)

GetLatestObjectID mocks base method.

func (*MockMetadata) GetLvgByBucketAndLvgID added in v0.2.3

func (m *MockMetadata) GetLvgByBucketAndLvgID(bucketID common.Hash, lvgID uint32) (*LocalVirtualGroup, error)

GetLvgByBucketAndLvgID mocks base method.

func (*MockMetadata) GetMigrateBucketEventByBucketID added in v0.2.3

func (m *MockMetadata) GetMigrateBucketEventByBucketID(bucketID common.Hash) (*EventCompleteMigrationBucket, error)

GetMigrateBucketEventByBucketID mocks base method.

func (*MockMetadata) GetMysqlVersion added in v0.2.4

func (m *MockMetadata) GetMysqlVersion() (string, error)

GetMysqlVersion mocks base method.

func (*MockMetadata) GetObjectByID added in v0.2.3

func (m *MockMetadata) GetObjectByID(objectID int64, includeRemoved bool) (*Object, error)

GetObjectByID mocks base method.

func (*MockMetadata) GetObjectByName added in v0.2.0

func (m *MockMetadata) GetObjectByName(objectName, bucketName string, includePrivate bool) (*Object, error)

GetObjectByName mocks base method.

func (*MockMetadata) GetPaymentByBucketID added in v0.2.0

func (m *MockMetadata) GetPaymentByBucketID(bucketID int64, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketID mocks base method.

func (*MockMetadata) GetPaymentByBucketName added in v0.2.0

func (m *MockMetadata) GetPaymentByBucketName(bucketName string, includePrivate bool) (*StreamRecord, error)

GetPaymentByBucketName mocks base method.

func (*MockMetadata) GetPaymentByPaymentAddress added in v0.2.0

func (m *MockMetadata) GetPaymentByPaymentAddress(address common.Address) (*StreamRecord, error)

GetPaymentByPaymentAddress mocks base method.

func (*MockMetadata) GetPermissionByResourceAndPrincipal added in v0.2.0

func (m *MockMetadata) GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue string, resourceID common.Hash) (*Permission, error)

GetPermissionByResourceAndPrincipal mocks base method.

func (*MockMetadata) GetPermissionsByResourceAndPrincipleType added in v0.2.0

func (m *MockMetadata) GetPermissionsByResourceAndPrincipleType(resourceType, principalType string, resourceID common.Hash, includeRemoved bool) ([]*Permission, error)

GetPermissionsByResourceAndPrincipleType mocks base method.

func (*MockMetadata) GetPrimarySPStreamRecordBySpID added in v1.1.0

func (m *MockMetadata) GetPrimarySPStreamRecordBySpID(spID uint32) ([]*PrimarySpIncomeMeta, error)

GetPrimarySPStreamRecordBySpID mocks base method.

func (*MockMetadata) GetSPByAddress added in v0.2.4

func (m *MockMetadata) GetSPByAddress(operatorAddress common.Address) (*StorageProvider, error)

GetSPByAddress mocks base method.

func (*MockMetadata) GetSecondarySPStreamRecordBySpID added in v1.1.0

func (m *MockMetadata) GetSecondarySPStreamRecordBySpID(spID uint32) ([]*SecondarySpIncomeMeta, error)

GetSecondarySPStreamRecordBySpID mocks base method.

func (*MockMetadata) GetSpVersion added in v0.2.4

func (m *MockMetadata) GetSpVersion() *SpVersion

GetSpVersion mocks base method.

func (*MockMetadata) GetStatementsByPolicyID added in v0.2.0

func (m *MockMetadata) GetStatementsByPolicyID(policyIDList []common.Hash, includeRemoved bool) ([]*Statement, error)

GetStatementsByPolicyID mocks base method.

func (*MockMetadata) GetSwitchDBSignal added in v0.2.0

func (m *MockMetadata) GetSwitchDBSignal() (*MasterDB, error)

GetSwitchDBSignal mocks base method.

func (*MockMetadata) GetUserBuckets added in v0.2.0

func (m *MockMetadata) GetUserBuckets(accountID common.Address, includeRemoved bool) ([]*Bucket, error)

GetUserBuckets mocks base method.

func (*MockMetadata) GetUserBucketsCount added in v0.2.0

func (m *MockMetadata) GetUserBucketsCount(accountID common.Address, includeRemoved bool) (int64, error)

GetUserBucketsCount mocks base method.

func (*MockMetadata) GetUserGroups added in v0.2.4

func (m *MockMetadata) GetUserGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*GroupMemberMeta, error)

GetUserGroups mocks base method.

func (*MockMetadata) GetUserOwnedGroups added in v0.2.4

func (m *MockMetadata) GetUserOwnedGroups(accountID common.Address, startAfter common.Hash, limit int) ([]*Group, error)

GetUserOwnedGroups mocks base method.

func (*MockMetadata) GetVirtualGroupFamiliesByVgfID added in v0.2.3

func (m *MockMetadata) GetVirtualGroupFamiliesByVgfID(vgfID uint32) (*GlobalVirtualGroupFamily, error)

GetVirtualGroupFamiliesByVgfID mocks base method.

func (*MockMetadata) ListBucketsByIDs added in v0.2.4

func (m *MockMetadata) ListBucketsByIDs(ids []common.Hash, includeRemoved bool) ([]*Bucket, error)

ListBucketsByIDs mocks base method.

func (*MockMetadata) ListBucketsByVgfID added in v0.2.3

func (m *MockMetadata) ListBucketsByVgfID(vgfIDs []uint32, startAfter common.Hash, limit int) ([]*Bucket, error)

ListBucketsByVgfID mocks base method.

func (*MockMetadata) ListDeletedObjectsByBlockNumberRange added in v0.2.0

func (m *MockMetadata) ListDeletedObjectsByBlockNumberRange(startBlockNumber, endBlockNumber int64, includePrivate bool) ([]*Object, error)

ListDeletedObjectsByBlockNumberRange mocks base method.

func (*MockMetadata) ListExpiredBucketsBySp added in v0.2.0

func (m *MockMetadata) ListExpiredBucketsBySp(createAt int64, primarySpID uint32, limit int64) ([]*Bucket, error)

ListExpiredBucketsBySp mocks base method.

func (*MockMetadata) ListGroupsByIDs added in v0.2.6

func (m *MockMetadata) ListGroupsByIDs(ids []common.Hash) ([]*Group, error)

ListGroupsByIDs mocks base method.

func (*MockMetadata) ListGroupsByNameAndSourceType added in v0.2.2

func (m *MockMetadata) ListGroupsByNameAndSourceType(name, prefix, sourceType string, limit, offset int, includeRemoved bool) ([]*Group, int64, error)

ListGroupsByNameAndSourceType mocks base method.

func (*MockMetadata) ListGvgByBucketID added in v0.2.3

func (m *MockMetadata) ListGvgByBucketID(bucketID common.Hash) ([]*GlobalVirtualGroup, error)

ListGvgByBucketID mocks base method.

func (*MockMetadata) ListGvgByPrimarySpID added in v0.2.3

func (m *MockMetadata) ListGvgByPrimarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgByPrimarySpID mocks base method.

func (*MockMetadata) ListGvgBySecondarySpID added in v0.2.3

func (m *MockMetadata) ListGvgBySecondarySpID(spID uint32) ([]*GlobalVirtualGroup, error)

ListGvgBySecondarySpID mocks base method.

func (*MockMetadata) ListLvgByGvgAndBucketID added in v0.2.3

func (m *MockMetadata) ListLvgByGvgAndBucketID(bucketID common.Hash, gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgAndBucketID mocks base method.

func (*MockMetadata) ListLvgByGvgID added in v0.2.3

func (m *MockMetadata) ListLvgByGvgID(gvgIDs []uint32) ([]*LocalVirtualGroup, error)

ListLvgByGvgID mocks base method.

func (*MockMetadata) ListMigrateBucketEvents added in v0.2.3

func (m *MockMetadata) ListMigrateBucketEvents(spID uint32, filters ...func(*gorm.DB) *gorm.DB) ([]*EventMigrationBucket, []*EventCompleteMigrationBucket, []*EventCancelMigrationBucket, []*EventRejectMigrateBucket, error)

ListMigrateBucketEvents mocks base method.

func (*MockMetadata) ListObjectPolicies added in v0.2.5

func (m *MockMetadata) ListObjectPolicies(objectID common.Hash, actionType types.ActionType, startAfter common.Hash, limit int) ([]*PermissionWithStatement, error)

ListObjectPolicies mocks base method.

func (*MockMetadata) ListObjectsByBucketName added in v0.2.0

func (m *MockMetadata) ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter string, maxKeys int, includeRemoved bool) ([]*ListObjectsResult, error)

ListObjectsByBucketName mocks base method.

func (*MockMetadata) ListObjectsByGVGAndBucketForGC added in v0.2.3

func (m *MockMetadata) ListObjectsByGVGAndBucketForGC(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsByGVGAndBucketForGC mocks base method.

func (*MockMetadata) ListObjectsByIDs added in v0.2.4

func (m *MockMetadata) ListObjectsByIDs(ids []common.Hash, includeRemoved bool) ([]*Object, error)

ListObjectsByIDs mocks base method.

func (*MockMetadata) ListObjectsByLVGID added in v0.2.3

func (m *MockMetadata) ListObjectsByLVGID(lvgIDs []uint32, bucketID, startAfter common.Hash, limit int, filters ...func(*gorm.DB) *gorm.DB) ([]*Object, *Bucket, error)

ListObjectsByLVGID mocks base method.

func (*MockMetadata) ListObjectsInGVG added in v0.2.3

func (m *MockMetadata) ListObjectsInGVG(gvgID uint32, startAfter common.Hash, limit int) ([]*Object, []*Bucket, error)

ListObjectsInGVG mocks base method.

func (*MockMetadata) ListObjectsInGVGAndBucket added in v0.2.3

func (m *MockMetadata) ListObjectsInGVGAndBucket(bucketID common.Hash, gvgID uint32, startAfter common.Hash, limit int) ([]*Object, *Bucket, error)

ListObjectsInGVGAndBucket mocks base method.

func (*MockMetadata) ListPaymentAccountStreams added in v0.2.6

func (m *MockMetadata) ListPaymentAccountStreams(paymentAccount common.Address) ([]*Bucket, error)

ListPaymentAccountStreams mocks base method.

func (*MockMetadata) ListSpExitEvents added in v0.2.3

ListSpExitEvents mocks base method.

func (*MockMetadata) ListSwapOutEvents added in v0.2.3

func (m *MockMetadata) ListSwapOutEvents(blockID uint64, spID uint32) ([]*EventSwapOut, []*EventCompleteSwapOut, []*EventCancelSwapOut, error)

ListSwapOutEvents mocks base method.

func (*MockMetadata) ListUserPaymentAccounts added in v0.2.6

func (m *MockMetadata) ListUserPaymentAccounts(accountID common.Address) ([]*StreamRecordPaymentAccount, error)

ListUserPaymentAccounts mocks base method.

func (*MockMetadata) ListVgfByGvgID added in v0.2.3

func (m *MockMetadata) ListVgfByGvgID(gvgIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVgfByGvgID mocks base method.

func (*MockMetadata) ListVirtualGroupFamiliesBySpID added in v0.2.3

func (m *MockMetadata) ListVirtualGroupFamiliesBySpID(spID uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesBySpID mocks base method.

func (*MockMetadata) ListVirtualGroupFamiliesByVgfIDs added in v0.2.6

func (m *MockMetadata) ListVirtualGroupFamiliesByVgfIDs(vgfIDs []uint32) ([]*GlobalVirtualGroupFamily, error)

ListVirtualGroupFamiliesByVgfIDs mocks base method.

type MockMetadataMockRecorder added in v0.2.0

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

MockMetadataMockRecorder is the mock recorder for MockMetadata.

func (*MockMetadataMockRecorder) GetBucketByID added in v0.2.0

func (mr *MockMetadataMockRecorder) GetBucketByID(bucketID, includePrivate any) *gomock.Call

GetBucketByID indicates an expected call of GetBucketByID.

func (*MockMetadataMockRecorder) GetBucketByName added in v0.2.0

func (mr *MockMetadataMockRecorder) GetBucketByName(bucketName, includePrivate any) *gomock.Call

GetBucketByName indicates an expected call of GetBucketByName.

func (*MockMetadataMockRecorder) GetBucketMetaByName added in v0.2.0

func (mr *MockMetadataMockRecorder) GetBucketMetaByName(bucketName, includePrivate any) *gomock.Call

GetBucketMetaByName indicates an expected call of GetBucketMetaByName.

func (*MockMetadataMockRecorder) GetBucketSizeByID added in v1.1.0

func (mr *MockMetadataMockRecorder) GetBucketSizeByID(bucketID any) *gomock.Call

GetBucketSizeByID indicates an expected call of GetBucketSizeByID.

func (*MockMetadataMockRecorder) GetDataMigrationRecordByProcessKey added in v1.1.0

func (mr *MockMetadataMockRecorder) GetDataMigrationRecordByProcessKey(processKey any) *gomock.Call

GetDataMigrationRecordByProcessKey indicates an expected call of GetDataMigrationRecordByProcessKey.

func (*MockMetadataMockRecorder) GetDefaultCharacterSet added in v0.2.4

func (mr *MockMetadataMockRecorder) GetDefaultCharacterSet() *gomock.Call

GetDefaultCharacterSet indicates an expected call of GetDefaultCharacterSet.

func (*MockMetadataMockRecorder) GetDefaultCollationName added in v0.2.4

func (mr *MockMetadataMockRecorder) GetDefaultCollationName() *gomock.Call

GetDefaultCollationName indicates an expected call of GetDefaultCollationName.

func (*MockMetadataMockRecorder) GetEpoch added in v0.2.4

func (mr *MockMetadataMockRecorder) GetEpoch() *gomock.Call

GetEpoch indicates an expected call of GetEpoch.

func (*MockMetadataMockRecorder) GetEventMigrationBucketByBucketID added in v0.2.6

func (mr *MockMetadataMockRecorder) GetEventMigrationBucketByBucketID(bucketID any) *gomock.Call

GetEventMigrationBucketByBucketID indicates an expected call of GetEventMigrationBucketByBucketID.

func (*MockMetadataMockRecorder) GetEventSwapOutByGvgID added in v0.2.6

func (mr *MockMetadataMockRecorder) GetEventSwapOutByGvgID(gvgID any) *gomock.Call

GetEventSwapOutByGvgID indicates an expected call of GetEventSwapOutByGvgID.

func (*MockMetadataMockRecorder) GetGlobalVirtualGroupByGvgID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetGlobalVirtualGroupByGvgID(gvgID any) *gomock.Call

GetGlobalVirtualGroupByGvgID indicates an expected call of GetGlobalVirtualGroupByGvgID.

func (*MockMetadataMockRecorder) GetGroupByID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetGroupByID(groupID, includeRemoved any) *gomock.Call

GetGroupByID indicates an expected call of GetGroupByID.

func (*MockMetadataMockRecorder) GetGroupMembers added in v0.2.4

func (mr *MockMetadataMockRecorder) GetGroupMembers(groupID, startAfter, limit any) *gomock.Call

GetGroupMembers indicates an expected call of GetGroupMembers.

func (*MockMetadataMockRecorder) GetGroupMembersCount added in v0.2.5

func (mr *MockMetadataMockRecorder) GetGroupMembersCount(groupIDs any) *gomock.Call

GetGroupMembersCount indicates an expected call of GetGroupMembersCount.

func (*MockMetadataMockRecorder) GetGroupsByGroupIDAndAccount added in v0.2.0

func (mr *MockMetadataMockRecorder) GetGroupsByGroupIDAndAccount(groupIDList, account, includeRemoved any) *gomock.Call

GetGroupsByGroupIDAndAccount indicates an expected call of GetGroupsByGroupIDAndAccount.

func (*MockMetadataMockRecorder) GetGvgByBucketAndLvgID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetGvgByBucketAndLvgID(bucketID, lvgID any) *gomock.Call

GetGvgByBucketAndLvgID indicates an expected call of GetGvgByBucketAndLvgID.

func (*MockMetadataMockRecorder) GetLatestBlockNumber added in v0.2.0

func (mr *MockMetadataMockRecorder) GetLatestBlockNumber() *gomock.Call

GetLatestBlockNumber indicates an expected call of GetLatestBlockNumber.

func (*MockMetadataMockRecorder) GetLatestObjectID added in v1.2.0

func (mr *MockMetadataMockRecorder) GetLatestObjectID() *gomock.Call

GetLatestObjectID indicates an expected call of GetLatestObjectID.

func (*MockMetadataMockRecorder) GetLvgByBucketAndLvgID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetLvgByBucketAndLvgID(bucketID, lvgID any) *gomock.Call

GetLvgByBucketAndLvgID indicates an expected call of GetLvgByBucketAndLvgID.

func (*MockMetadataMockRecorder) GetMigrateBucketEventByBucketID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetMigrateBucketEventByBucketID(bucketID any) *gomock.Call

GetMigrateBucketEventByBucketID indicates an expected call of GetMigrateBucketEventByBucketID.

func (*MockMetadataMockRecorder) GetMysqlVersion added in v0.2.4

func (mr *MockMetadataMockRecorder) GetMysqlVersion() *gomock.Call

GetMysqlVersion indicates an expected call of GetMysqlVersion.

func (*MockMetadataMockRecorder) GetObjectByID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetObjectByID(objectID, includeRemoved any) *gomock.Call

GetObjectByID indicates an expected call of GetObjectByID.

func (*MockMetadataMockRecorder) GetObjectByName added in v0.2.0

func (mr *MockMetadataMockRecorder) GetObjectByName(objectName, bucketName, includePrivate any) *gomock.Call

GetObjectByName indicates an expected call of GetObjectByName.

func (*MockMetadataMockRecorder) GetPaymentByBucketID added in v0.2.0

func (mr *MockMetadataMockRecorder) GetPaymentByBucketID(bucketID, includePrivate any) *gomock.Call

GetPaymentByBucketID indicates an expected call of GetPaymentByBucketID.

func (*MockMetadataMockRecorder) GetPaymentByBucketName added in v0.2.0

func (mr *MockMetadataMockRecorder) GetPaymentByBucketName(bucketName, includePrivate any) *gomock.Call

GetPaymentByBucketName indicates an expected call of GetPaymentByBucketName.

func (*MockMetadataMockRecorder) GetPaymentByPaymentAddress added in v0.2.0

func (mr *MockMetadataMockRecorder) GetPaymentByPaymentAddress(address any) *gomock.Call

GetPaymentByPaymentAddress indicates an expected call of GetPaymentByPaymentAddress.

func (*MockMetadataMockRecorder) GetPermissionByResourceAndPrincipal added in v0.2.0

func (mr *MockMetadataMockRecorder) GetPermissionByResourceAndPrincipal(resourceType, principalType, principalValue, resourceID any) *gomock.Call

GetPermissionByResourceAndPrincipal indicates an expected call of GetPermissionByResourceAndPrincipal.

func (*MockMetadataMockRecorder) GetPermissionsByResourceAndPrincipleType added in v0.2.0

func (mr *MockMetadataMockRecorder) GetPermissionsByResourceAndPrincipleType(resourceType, principalType, resourceID, includeRemoved any) *gomock.Call

GetPermissionsByResourceAndPrincipleType indicates an expected call of GetPermissionsByResourceAndPrincipleType.

func (*MockMetadataMockRecorder) GetPrimarySPStreamRecordBySpID added in v1.1.0

func (mr *MockMetadataMockRecorder) GetPrimarySPStreamRecordBySpID(spID any) *gomock.Call

GetPrimarySPStreamRecordBySpID indicates an expected call of GetPrimarySPStreamRecordBySpID.

func (*MockMetadataMockRecorder) GetSPByAddress added in v0.2.4

func (mr *MockMetadataMockRecorder) GetSPByAddress(operatorAddress any) *gomock.Call

GetSPByAddress indicates an expected call of GetSPByAddress.

func (*MockMetadataMockRecorder) GetSecondarySPStreamRecordBySpID added in v1.1.0

func (mr *MockMetadataMockRecorder) GetSecondarySPStreamRecordBySpID(spID any) *gomock.Call

GetSecondarySPStreamRecordBySpID indicates an expected call of GetSecondarySPStreamRecordBySpID.

func (*MockMetadataMockRecorder) GetSpVersion added in v0.2.4

func (mr *MockMetadataMockRecorder) GetSpVersion() *gomock.Call

GetSpVersion indicates an expected call of GetSpVersion.

func (*MockMetadataMockRecorder) GetStatementsByPolicyID added in v0.2.0

func (mr *MockMetadataMockRecorder) GetStatementsByPolicyID(policyIDList, includeRemoved any) *gomock.Call

GetStatementsByPolicyID indicates an expected call of GetStatementsByPolicyID.

func (*MockMetadataMockRecorder) GetSwitchDBSignal added in v0.2.0

func (mr *MockMetadataMockRecorder) GetSwitchDBSignal() *gomock.Call

GetSwitchDBSignal indicates an expected call of GetSwitchDBSignal.

func (*MockMetadataMockRecorder) GetUserBuckets added in v0.2.0

func (mr *MockMetadataMockRecorder) GetUserBuckets(accountID, includeRemoved any) *gomock.Call

GetUserBuckets indicates an expected call of GetUserBuckets.

func (*MockMetadataMockRecorder) GetUserBucketsCount added in v0.2.0

func (mr *MockMetadataMockRecorder) GetUserBucketsCount(accountID, includeRemoved any) *gomock.Call

GetUserBucketsCount indicates an expected call of GetUserBucketsCount.

func (*MockMetadataMockRecorder) GetUserGroups added in v0.2.4

func (mr *MockMetadataMockRecorder) GetUserGroups(accountID, startAfter, limit any) *gomock.Call

GetUserGroups indicates an expected call of GetUserGroups.

func (*MockMetadataMockRecorder) GetUserOwnedGroups added in v0.2.4

func (mr *MockMetadataMockRecorder) GetUserOwnedGroups(accountID, startAfter, limit any) *gomock.Call

GetUserOwnedGroups indicates an expected call of GetUserOwnedGroups.

func (*MockMetadataMockRecorder) GetVirtualGroupFamiliesByVgfID added in v0.2.3

func (mr *MockMetadataMockRecorder) GetVirtualGroupFamiliesByVgfID(vgfID any) *gomock.Call

GetVirtualGroupFamiliesByVgfID indicates an expected call of GetVirtualGroupFamiliesByVgfID.

func (*MockMetadataMockRecorder) ListBucketsByIDs added in v0.2.4

func (mr *MockMetadataMockRecorder) ListBucketsByIDs(ids, includeRemoved any) *gomock.Call

ListBucketsByIDs indicates an expected call of ListBucketsByIDs.

func (*MockMetadataMockRecorder) ListBucketsByVgfID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListBucketsByVgfID(vgfIDs, startAfter, limit any) *gomock.Call

ListBucketsByVgfID indicates an expected call of ListBucketsByVgfID.

func (*MockMetadataMockRecorder) ListDeletedObjectsByBlockNumberRange added in v0.2.0

func (mr *MockMetadataMockRecorder) ListDeletedObjectsByBlockNumberRange(startBlockNumber, endBlockNumber, includePrivate any) *gomock.Call

ListDeletedObjectsByBlockNumberRange indicates an expected call of ListDeletedObjectsByBlockNumberRange.

func (*MockMetadataMockRecorder) ListExpiredBucketsBySp added in v0.2.0

func (mr *MockMetadataMockRecorder) ListExpiredBucketsBySp(createAt, primarySpID, limit any) *gomock.Call

ListExpiredBucketsBySp indicates an expected call of ListExpiredBucketsBySp.

func (*MockMetadataMockRecorder) ListGroupsByIDs added in v0.2.6

func (mr *MockMetadataMockRecorder) ListGroupsByIDs(ids any) *gomock.Call

ListGroupsByIDs indicates an expected call of ListGroupsByIDs.

func (*MockMetadataMockRecorder) ListGroupsByNameAndSourceType added in v0.2.2

func (mr *MockMetadataMockRecorder) ListGroupsByNameAndSourceType(name, prefix, sourceType, limit, offset, includeRemoved any) *gomock.Call

ListGroupsByNameAndSourceType indicates an expected call of ListGroupsByNameAndSourceType.

func (*MockMetadataMockRecorder) ListGvgByBucketID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListGvgByBucketID(bucketID any) *gomock.Call

ListGvgByBucketID indicates an expected call of ListGvgByBucketID.

func (*MockMetadataMockRecorder) ListGvgByPrimarySpID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListGvgByPrimarySpID(spID any) *gomock.Call

ListGvgByPrimarySpID indicates an expected call of ListGvgByPrimarySpID.

func (*MockMetadataMockRecorder) ListGvgBySecondarySpID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListGvgBySecondarySpID(spID any) *gomock.Call

ListGvgBySecondarySpID indicates an expected call of ListGvgBySecondarySpID.

func (*MockMetadataMockRecorder) ListLvgByGvgAndBucketID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListLvgByGvgAndBucketID(bucketID, gvgIDs any) *gomock.Call

ListLvgByGvgAndBucketID indicates an expected call of ListLvgByGvgAndBucketID.

func (*MockMetadataMockRecorder) ListLvgByGvgID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListLvgByGvgID(gvgIDs any) *gomock.Call

ListLvgByGvgID indicates an expected call of ListLvgByGvgID.

func (*MockMetadataMockRecorder) ListMigrateBucketEvents added in v0.2.3

func (mr *MockMetadataMockRecorder) ListMigrateBucketEvents(spID any, filters ...any) *gomock.Call

ListMigrateBucketEvents indicates an expected call of ListMigrateBucketEvents.

func (*MockMetadataMockRecorder) ListObjectPolicies added in v0.2.5

func (mr *MockMetadataMockRecorder) ListObjectPolicies(objectID, actionType, startAfter, limit any) *gomock.Call

ListObjectPolicies indicates an expected call of ListObjectPolicies.

func (*MockMetadataMockRecorder) ListObjectsByBucketName added in v0.2.0

func (mr *MockMetadataMockRecorder) ListObjectsByBucketName(bucketName, continuationToken, prefix, delimiter, maxKeys, includeRemoved any) *gomock.Call

ListObjectsByBucketName indicates an expected call of ListObjectsByBucketName.

func (*MockMetadataMockRecorder) ListObjectsByGVGAndBucketForGC added in v0.2.3

func (mr *MockMetadataMockRecorder) ListObjectsByGVGAndBucketForGC(bucketID, gvgID, startAfter, limit any) *gomock.Call

ListObjectsByGVGAndBucketForGC indicates an expected call of ListObjectsByGVGAndBucketForGC.

func (*MockMetadataMockRecorder) ListObjectsByIDs added in v0.2.4

func (mr *MockMetadataMockRecorder) ListObjectsByIDs(ids, includeRemoved any) *gomock.Call

ListObjectsByIDs indicates an expected call of ListObjectsByIDs.

func (*MockMetadataMockRecorder) ListObjectsByLVGID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListObjectsByLVGID(lvgIDs, bucketID, startAfter, limit any, filters ...any) *gomock.Call

ListObjectsByLVGID indicates an expected call of ListObjectsByLVGID.

func (*MockMetadataMockRecorder) ListObjectsInGVG added in v0.2.3

func (mr *MockMetadataMockRecorder) ListObjectsInGVG(gvgID, startAfter, limit any) *gomock.Call

ListObjectsInGVG indicates an expected call of ListObjectsInGVG.

func (*MockMetadataMockRecorder) ListObjectsInGVGAndBucket added in v0.2.3

func (mr *MockMetadataMockRecorder) ListObjectsInGVGAndBucket(bucketID, gvgID, startAfter, limit any) *gomock.Call

ListObjectsInGVGAndBucket indicates an expected call of ListObjectsInGVGAndBucket.

func (*MockMetadataMockRecorder) ListPaymentAccountStreams added in v0.2.6

func (mr *MockMetadataMockRecorder) ListPaymentAccountStreams(paymentAccount any) *gomock.Call

ListPaymentAccountStreams indicates an expected call of ListPaymentAccountStreams.

func (*MockMetadataMockRecorder) ListSpExitEvents added in v0.2.3

func (mr *MockMetadataMockRecorder) ListSpExitEvents(blockID, spID any) *gomock.Call

ListSpExitEvents indicates an expected call of ListSpExitEvents.

func (*MockMetadataMockRecorder) ListSwapOutEvents added in v0.2.3

func (mr *MockMetadataMockRecorder) ListSwapOutEvents(blockID, spID any) *gomock.Call

ListSwapOutEvents indicates an expected call of ListSwapOutEvents.

func (*MockMetadataMockRecorder) ListUserPaymentAccounts added in v0.2.6

func (mr *MockMetadataMockRecorder) ListUserPaymentAccounts(accountID any) *gomock.Call

ListUserPaymentAccounts indicates an expected call of ListUserPaymentAccounts.

func (*MockMetadataMockRecorder) ListVgfByGvgID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListVgfByGvgID(gvgIDs any) *gomock.Call

ListVgfByGvgID indicates an expected call of ListVgfByGvgID.

func (*MockMetadataMockRecorder) ListVirtualGroupFamiliesBySpID added in v0.2.3

func (mr *MockMetadataMockRecorder) ListVirtualGroupFamiliesBySpID(spID any) *gomock.Call

ListVirtualGroupFamiliesBySpID indicates an expected call of ListVirtualGroupFamiliesBySpID.

func (*MockMetadataMockRecorder) ListVirtualGroupFamiliesByVgfIDs added in v0.2.6

func (mr *MockMetadataMockRecorder) ListVirtualGroupFamiliesByVgfIDs(vgfIDs any) *gomock.Call

ListVirtualGroupFamiliesByVgfIDs indicates an expected call of ListVirtualGroupFamiliesByVgfIDs.

type Object

type Object struct {
	// ID defines db auto_increment id of object
	ID uint64 `gorm:"id"`
	// Creator defines the account address of object creator
	Creator common.Address `gorm:"creator"`
	// Operator defines the operator address of object
	Operator common.Address `gorm:"operator"`
	// Owner defines the account address of object owner
	Owner common.Address `gorm:"owner"`
	// LocalVirtualGroupId defines the local virtual group id of object
	LocalVirtualGroupId uint32 `gorm:"local_virtual_group_id"`
	// BucketName is the name of the bucket
	BucketName string `gorm:"bucket_name"`
	// ObjectName is the name of object
	ObjectName string `gorm:"object_name"`
	// ObjectID is the unique identifier of object
	ObjectID common.Hash `gorm:"object_id"`
	// BucketID is the unique identifier of bucket
	BucketID common.Hash `gorm:"bucket_id"`
	// PayloadSize is the total size of the object payload
	PayloadSize uint64 `gorm:"payload_size"`
	// Visibility defines the highest permissions for bucket. When a bucket is public, everyone can get storage obj
	Visibility string `gorm:"visibility"`
	// ContentType defines the format of the object which should be a standard MIME type
	ContentType string `gorm:"content_type"`
	// CreateAt defines the block number when the object created
	CreateAt int64 `gorm:"create_at"`
	// CreateTime defines the timestamp when the object created
	CreateTime int64 `gorm:"create_time"`
	// ObjectStatus defines the upload status of the object.
	ObjectStatus string `gorm:"column:status"`
	// RedundancyType defines the type of the redundancy which can be multi-replication or EC
	RedundancyType string `gorm:"redundancy_type"`
	// SourceType defines the source of the object.
	SourceType string `gorm:"source_type"`
	// CheckSums defines the root hash of the pieces which stored in a SP
	Checksums pq.ByteaArray `gorm:"check_sums;type:text"`
	// LockedBalance defines locked balance of object
	LockedBalance common.Hash `gorm:"locked_balance"`
	// Removed defines the object is deleted or not
	Removed bool `gorm:"removed"`
	// UpdateTime defines the time when the object updated
	UpdateTime int64 `gorm:"update_time"`
	// UpdateAt defines the block number when the object updated
	UpdateAt int64 `gorm:"update_at;index:idx_update_at"`
	// DeleteAt defines the block number when the object deleted
	DeleteAt int64 `gorm:"delete_at"`
	// DeleteReason defines the deleted reason of object
	DeleteReason string `gorm:"delete_reason"`
	// CreateTxHash defines the creation transaction hash of object
	CreateTxHash common.Hash `gorm:"create_tx_hash"`
	// UpdateTxHash defines the update transaction hash of object
	UpdateTxHash common.Hash `gorm:"update_tx_hash"`
	// SealTxHash defines the sealed transaction hash of object
	SealTxHash common.Hash `gorm:"column:sealed_tx_hash"`
	// Tags
	Tags datatypes.JSON `gorm:"column:tags;TYPE:json"` // tags
}

Object is the structure for user object

func (*Object) GetResourceTags added in v1.2.0

func (o *Object) GetResourceTags() *storagetypes.ResourceTags

GetResourceTags is used to convert the db tags string to *storage_types.ResourceTags type

func (*Object) TableName

func (o *Object) TableName() string

TableName is used to set Object table name in database

type ObjectIDMap added in v0.2.3

type ObjectIDMap struct {
	ObjectID   common.Hash `gorm:"column:object_id;type:BINARY(32);index:idx_object_id;primaryKey"`
	BucketName string      `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_full_object,priority:1;index:idx_bucket_path,priority:1"`
}

ObjectIDMap is a mapping table for objectID and bucketName

func (*ObjectIDMap) TableName added in v0.2.3

func (*ObjectIDMap) TableName() string

TableName is used to set ObjectIDMap table name in database

type ObjectIDs added in v0.2.2

type ObjectIDs struct {
	IDs []uint64 `json:"ids"`
}

ObjectIDs represents the request of list object by ids

type PaymentAccount added in v0.2.5

type PaymentAccount struct {
	ID uint64 `gorm:"column:id;primaryKey"`

	Addr       common.Address `gorm:"column:addr;type:BINARY(20);not null;uniqueIndex:idx_addr"`
	Owner      common.Address `gorm:"column:owner;type:BINARY(20);not null;index:idx_owner"`
	Refundable bool           `gorm:"column:refundable;not null;default:true"`

	UpdateAt   int64 `gorm:"column:update_at;type:bigint(64)"`
	UpdateTime int64 `gorm:"column:update_time;type:bigint(64)"`
}

func (*PaymentAccount) TableName added in v0.2.5

func (*PaymentAccount) TableName() string

type Permission added in v0.1.2

type Permission struct {
	// ID defines db auto_increment id of permission
	ID uint64 `gorm:"id"`
	// PrincipalType defines the type of principal
	PrincipalType int32 `gorm:"principal_type"`
	// PrincipalValue defines the value of principal
	// When the type is an account, its value is sdk.AccAddress().String();
	// when the type is a group, its value is math.Uint().String()
	PrincipalValue string `gorm:"principal_value"`
	// ResourceType defines the type of resource that grants permission for
	ResourceType string `gorm:"resource_type"`
	// ResourceID defines the bucket/object/group id of the resource that grants permission for
	ResourceID common.Hash `gorm:"resource_id"`
	// PolicyID is a unique u256 sequence for each policy. It also is used as NFT tokenID
	PolicyID common.Hash `gorm:"policy_id"`
	// CreateTimestamp defines the create time of permission
	CreateTimestamp int64 `gorm:"create_timestamp"`
	// UpdateTimestamp defines the update time of permission
	UpdateTimestamp int64 `gorm:"update_timestamp"`
	// ExpirationTime defines the expiration time of permission
	ExpirationTime int64 `gorm:"expiration_time;type:bigint(64)"`
	// Removed defines the permission is deleted or not
	Removed bool `gorm:"removed"`
}

Permission is the structure to verify action permission

func (Permission) Eval added in v0.1.2

func (p Permission) Eval(action permtypes.ActionType, blockTime time.Time, opts *permtypes.VerifyOptions, statements []*Statement) permtypes.Effect

Eval is used to evaluate the execution results of permission policies.

func (*Permission) TableName added in v0.1.2

func (p *Permission) TableName() string

TableName is used to set Permission table name in database

type PermissionWithStatement added in v1.1.0

type PermissionWithStatement struct {
	Permission
	Statement
}

type PrimarySpIncomeMeta added in v1.1.0

type PrimarySpIncomeMeta struct {
	GlobalVirtualGroupFamilyId uint32 `gorm:"column:global_virtual_group_family_id"`
	StreamRecord
}

PrimarySpIncomeMeta is the structure for primary sp income details

type SecondarySpIncomeMeta added in v1.1.0

type SecondarySpIncomeMeta struct {
	GlobalVirtualGroupId uint32 `gorm:"column:global_virtual_group_id;index:idx_gvg_id"`
	StreamRecord
}

SecondarySpIncomeMeta is the structure for primary sp income details

type SlashPrefixTreeNode added in v0.2.2

type SlashPrefixTreeNode struct {
	ID uint64 `gorm:"column:id;primaryKey"`

	PathName string `gorm:"column:path_name;type:varchar(1024);index:idx_bucket_path,priority:2,length:512"`
	FullName string `gorm:"column:full_name;type:varchar(1024);index:idx_bucket_full_object,priority:2,length:512"`
	Name     string `gorm:"column:name;type:varchar(1024)"`
	IsObject bool   `gorm:"column:is_object;default:false;index:idx_bucket_full_object,priority:3"`
	IsFolder bool   `gorm:"column:is_folder;default:false"`

	BucketName string      `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_full_object,priority:1;index:idx_bucket_path,priority:1"`
	ObjectID   common.Hash `gorm:"column:object_id;type:BINARY(32);index:idx_object_id"`
	ObjectName string      `gorm:"column:object_name;type:varchar(1024)"`
}

SlashPrefixTreeNode A tree structure based on prefixes

func (*SlashPrefixTreeNode) TableName added in v0.2.2

func (*SlashPrefixTreeNode) TableName() string

TableName is used to set SlashPrefixTreeNode table name in database

type SpVersion added in v0.2.4

type SpVersion struct {
	SpCodeVersion     string
	SpCodeCommit      string
	SpGoVersion       string
	SpArchitecture    string
	SpOperatingSystem string
}

type Statement added in v0.1.2

type Statement struct {
	// ID defines db auto_increment id of statement
	ID uint64 `gorm:"id"`
	// PolicyID is a unique u256 sequence for each policy. It also is used as NFT tokenID
	PolicyID common.Hash `gorm:"policy_id"`
	// Effect define the impact of permissions, which is Allow/Deny
	Effect string `gorm:"effect"`
	// ActionValue define the operation type you can act. greenfield defines a set of permission
	// that you can specify in a permissionInfo
	ActionValue int `gorm:"action_value"`
	// Resources CAN ONLY BE USED IN bucket level. Support fuzzy match and limit to 5
	// If no sub-resource is specified in a statement, then all objects in the bucket are accessible by the principal.
	// However, if the sub-resource is defined as 'bucket/test_*,' in the statement, then only objects with a 'test_'
	// prefix can be accessed by the principal.
	Resources pq.StringArray `gorm:"resources;type:text"`
	// ExpirationTime defines how long the permission is valid. If not explicitly specified, it means it will not expire.
	ExpirationTime int64 `gorm:"expiration_time"`
	// LimitSize defines the total data size that is allowed to operate. If not explicitly specified, it means it will not limit.
	LimitSize uint64 `gorm:"limit_size"`
	// Removed defines the statement is deleted or not
	Removed bool `gorm:"removed"`
}

Statement defines the details content of the permission, include effect/actions/sub-resources

func (*Statement) Eval added in v0.1.2

Eval is used to evaluate the execution results of statement policies.

func (*Statement) TableName added in v0.1.2

func (s *Statement) TableName() string

TableName is used to set Statements table name in database

type StorageProvider added in v0.2.3

type StorageProvider struct {
	ID uint64 `gorm:"column:id;primaryKey"`

	SpId            uint32         `gorm:"column:sp_id;index:idx_sp_id"`
	OperatorAddress common.Address `gorm:"column:operator_address;type:BINARY(20);uniqueIndex:idx_operator_address"`
	FundingAddress  common.Address `gorm:"column:funding_address;type:BINARY(20)"`
	SealAddress     common.Address `gorm:"column:seal_address;;type:BINARY(20)"`
	ApprovalAddress common.Address `gorm:"column:approval_address;;type:BINARY(20)"`
	GcAddress       common.Address `gorm:"column:gc_address;type:BINARY(20)"`
	TotalDeposit    *common.Big    `gorm:"column:total_deposit"`
	Status          string         `gorm:"column:status;type:VARCHAR(50)"`
	Endpoint        string         `gorm:"column:endpoint;type:VARCHAR(256)"`
	Moniker         string         `gorm:"column:moniker;type:VARCHAR(128)"`
	Identity        string         `gorm:"column:identity;type:VARCHAR(256)"`
	Website         string         `gorm:"column:website;type:VARCHAR(128)"`
	SecurityContact string         `gorm:"column:security_contact;type:VARCHAR(128)"`
	Details         string         `gorm:"column:details;type:VARCHAR(256)"`
	BlsKey          string         `gorm:"column:bls_key;type:VARCHAR(64)"`

	UpdateTimeSec int64       `gorm:"column:update_time_sec"`
	ReadPrice     *common.Big `gorm:"column:read_price"`
	FreeReadQuota uint64      `gorm:"column:free_read_quota"`
	StorePrice    *common.Big `gorm:"column:store_price"`

	CreateAt     int64       `gorm:"column:create_at"`
	CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
	UpdateAt     int64       `gorm:"column:update_at"`
	UpdateTxHash common.Hash `gorm:"column:update_tx_hash;type:BINARY(32);not null"`
	Removed      bool        `gorm:"column:removed;default:false"`
}

func (*StorageProvider) TableName added in v0.2.3

func (*StorageProvider) TableName() string

type StreamRecord

type StreamRecord struct {
	// ID defines db auto_increment id of stream record
	ID uint64 `gorm:"id"`
	// Account defines the account address
	Account common.Address `gorm:"account"`
	// CrudTimestamp defines the latest update timestamp of the stream record
	CrudTimestamp int64 `gorm:"crud_timestamp"`
	// NetflowRate defines the per-second rate that an account's balance is changing.
	// It is the sum of the account's inbound and outbound flow rates.
	NetflowRate *common.Big `gorm:"netflow_rate"`
	// StaticBalance defines the balance of the stream account at the latest CRUD timestamp.
	StaticBalance *common.Big `gorm:"static_balance"`
	// BufferBalance defines reserved balance of the stream account
	// If the netflow rate is negative, the reserved balance is `netflow_rate * reserve_time`
	BufferBalance *common.Big `gorm:"buffer_balance"`
	// LockBalance defines the locked balance of the stream account after it puts a new object and before the object is sealed
	LockBalance *common.Big `gorm:"lock_balance"`
	// Status defines the status of the stream account
	Status string `gorm:"status"`
	// SettleTimestamp defines the unix timestamp when the stream account will be settled
	SettleTimestamp   int64       `gorm:"column:settle_timestamp"`
	OutFlowCount      uint64      `gorm:"column:out_flow_count"`
	FrozenNetflowRate *common.Big `gorm:"column:frozen_netflow_rate"`
}

func (*StreamRecord) TableName

func (s *StreamRecord) TableName() string

TableName is used to set StreamRecord table name in database

type StreamRecordPaymentAccount added in v0.2.5

type StreamRecordPaymentAccount struct {
	PaymentAccount
	StreamRecord
}

type Uint32Array added in v0.2.3

type Uint32Array []uint32

func (*Uint32Array) Scan added in v0.2.3

func (a *Uint32Array) Scan(value interface{}) error

func (Uint32Array) Value added in v0.2.3

func (a Uint32Array) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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