spdb

package
v0.2.2-test.27 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package spdb is a generated GoMock package.

Index

Constants

View Source
const (
	GatewayBeginReceiveUpload           = "gateway_begin_receive_upload"
	GatewayEndReceiveUpload             = "gateway_end_receive_upload"
	UploaderBeginReceiveData            = "uploader_begin_receive_data"
	UploaderEndReceiveData              = "uploader_end_receive_data"
	ManagerReceiveAndWaitSchedulingTask = "manager_receive_and_wait_scheduling_task"
	ManagerSchedulingTask               = "manager_scheduling_task"
	ExecutorBeginTask                   = "executor_begin_task"
	ExecutorEndTask                     = "executor_end_task"
	ExecutorBeginP2P                    = "executor_begin_p2p"
	ExecutorEndP2P                      = "executor_end_p2p"
	ExecutorBeginReplicateOnePiece      = "executor_begin_replicate_one_piece"
	ExecutorEndReplicateOnePiece        = "executor_end_replicate_one_piece"
	ExecutorBeginReplicateAllPiece      = "executor_begin_replicate_all_piece"
	ExecutorEndReplicateAllPiece        = "executor_end_replicate_all_piece"
	ExecutorBeginDoneReplicatePiece     = "executor_begin_done_replicate_piece"
	ExecutorEndDoneReplicatePiece       = "executor_end_done_replicate_piece"
	ExecutorBeginSealTx                 = "executor_begin_seal_tx"
	ExecutorEndSealTx                   = "executor_end_seal_tx"
	ExecutorBeginConfirmSeal            = "executor_begin_confirm_seal"
	ExecutorEndConfirmSeal              = "executor_end_confirm_seal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketQuota

type BucketQuota struct {
	ReadQuotaSize uint64
}

BucketQuota defines read quota of a bucket.

type BucketTraffic

type BucketTraffic struct {
	BucketID         uint64
	YearMonth        string // YearMonth is traffic's YearMonth, format "2023-02".
	BucketName       string
	ReadConsumedSize uint64
	ReadQuotaSize    uint64
	ModifyTime       int64
}

BucketTraffic is record traffic by year and month.

type GCObjectMeta

type GCObjectMeta struct {
	TaskKey             string
	StartBlockHeight    uint64
	EndBlockHeight      uint64
	CurrentBlockHeight  uint64
	LastDeletedObjectID uint64
}

GCObjectMeta defines the gc object range progress info.

type GCObjectProgressDB

type GCObjectProgressDB interface {
	// InsertGCObjectProgress inserts a new gc object progress.
	InsertGCObjectProgress(taskKey string, gcMeta *GCObjectMeta) error
	// DeleteGCObjectProgress deletes the gc object progress.
	DeleteGCObjectProgress(taskKey string) error
	// UpdateGCObjectProgress updates the gc object progress.
	UpdateGCObjectProgress(gcMeta *GCObjectMeta) error
	// GetGCMetasToGC queries the latest gc meta to continue gc.
	// It is only used in startup.
	GetGCMetasToGC(limit int) ([]*GCObjectMeta, error)
}

GCObjectProgressDB interface which records gc object related progress.

type IntegrityMeta

type IntegrityMeta struct {
	ObjectID          uint64
	IntegrityChecksum []byte
	PieceChecksumList [][]byte
	Signature         []byte
}

IntegrityMeta defines the payload integrity hash and piece checksum with objectID.

type MockGCObjectProgressDB

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

MockGCObjectProgressDB is a mock of GCObjectProgressDB interface.

func NewMockGCObjectProgressDB

func NewMockGCObjectProgressDB(ctrl *gomock.Controller) *MockGCObjectProgressDB

NewMockGCObjectProgressDB creates a new mock instance.

func (*MockGCObjectProgressDB) DeleteGCObjectProgress

func (m *MockGCObjectProgressDB) DeleteGCObjectProgress(taskKey string) error

DeleteGCObjectProgress mocks base method.

func (*MockGCObjectProgressDB) EXPECT

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

func (*MockGCObjectProgressDB) GetAllGCObjectTask

func (m *MockGCObjectProgressDB) GetAllGCObjectTask(taskKey string) []task.GCObjectTask

GetAllGCObjectTask mocks base method.

func (*MockGCObjectProgressDB) SetGCObjectProgress

func (m *MockGCObjectProgressDB) SetGCObjectProgress(taskKey string, deletingBlockID, deletedObjectID uint64) error

SetGCObjectProgress mocks base method.

type MockGCObjectProgressDBMockRecorder

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

MockGCObjectProgressDBMockRecorder is the mock recorder for MockGCObjectProgressDB.

func (*MockGCObjectProgressDBMockRecorder) DeleteGCObjectProgress

func (mr *MockGCObjectProgressDBMockRecorder) DeleteGCObjectProgress(taskKey interface{}) *gomock.Call

DeleteGCObjectProgress indicates an expected call of DeleteGCObjectProgress.

func (*MockGCObjectProgressDBMockRecorder) GetAllGCObjectTask

func (mr *MockGCObjectProgressDBMockRecorder) GetAllGCObjectTask(taskKey interface{}) *gomock.Call

GetAllGCObjectTask indicates an expected call of GetAllGCObjectTask.

func (*MockGCObjectProgressDBMockRecorder) SetGCObjectProgress

func (mr *MockGCObjectProgressDBMockRecorder) SetGCObjectProgress(taskKey, deletingBlockID, deletedObjectID interface{}) *gomock.Call

SetGCObjectProgress indicates an expected call of SetGCObjectProgress.

type MockObjectIntegrityDB

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

MockObjectIntegrityDB is a mock of ObjectIntegrityDB interface.

func NewMockObjectIntegrityDB

func NewMockObjectIntegrityDB(ctrl *gomock.Controller) *MockObjectIntegrityDB

NewMockObjectIntegrityDB creates a new mock instance.

func (*MockObjectIntegrityDB) DeleteAllReplicatePieceChecksum

func (m *MockObjectIntegrityDB) DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) error

DeleteAllReplicatePieceChecksum mocks base method.

func (*MockObjectIntegrityDB) DeleteObjectIntegrity

func (m *MockObjectIntegrityDB) DeleteObjectIntegrity(objectID uint64) error

DeleteObjectIntegrity mocks base method.

func (*MockObjectIntegrityDB) DeleteReplicatePieceChecksum

func (m *MockObjectIntegrityDB) DeleteReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) error

DeleteReplicatePieceChecksum mocks base method.

func (*MockObjectIntegrityDB) EXPECT

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

func (*MockObjectIntegrityDB) GetAllReplicatePieceChecksum

func (m *MockObjectIntegrityDB) GetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) ([][]byte, error)

GetAllReplicatePieceChecksum mocks base method.

func (*MockObjectIntegrityDB) GetObjectIntegrity

func (m *MockObjectIntegrityDB) GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error)

GetObjectIntegrity mocks base method.

func (*MockObjectIntegrityDB) GetReplicatePieceChecksum

func (m *MockObjectIntegrityDB) GetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) ([]byte, error)

GetReplicatePieceChecksum mocks base method.

func (*MockObjectIntegrityDB) SetAllReplicatePieceChecksum

func (m *MockObjectIntegrityDB) SetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32, checksum [][]byte) error

SetAllReplicatePieceChecksum mocks base method.

func (*MockObjectIntegrityDB) SetObjectIntegrity

func (m *MockObjectIntegrityDB) SetObjectIntegrity(integrity *IntegrityMeta) error

SetObjectIntegrity mocks base method.

func (*MockObjectIntegrityDB) SetReplicatePieceChecksum

func (m *MockObjectIntegrityDB) SetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32, checksum []byte) error

SetReplicatePieceChecksum mocks base method.

type MockObjectIntegrityDBMockRecorder

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

MockObjectIntegrityDBMockRecorder is the mock recorder for MockObjectIntegrityDB.

func (*MockObjectIntegrityDBMockRecorder) DeleteAllReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) DeleteAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call

DeleteAllReplicatePieceChecksum indicates an expected call of DeleteAllReplicatePieceChecksum.

func (*MockObjectIntegrityDBMockRecorder) DeleteObjectIntegrity

func (mr *MockObjectIntegrityDBMockRecorder) DeleteObjectIntegrity(objectID interface{}) *gomock.Call

DeleteObjectIntegrity indicates an expected call of DeleteObjectIntegrity.

func (*MockObjectIntegrityDBMockRecorder) DeleteReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) DeleteReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call

DeleteReplicatePieceChecksum indicates an expected call of DeleteReplicatePieceChecksum.

func (*MockObjectIntegrityDBMockRecorder) GetAllReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) GetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call

GetAllReplicatePieceChecksum indicates an expected call of GetAllReplicatePieceChecksum.

func (*MockObjectIntegrityDBMockRecorder) GetObjectIntegrity

func (mr *MockObjectIntegrityDBMockRecorder) GetObjectIntegrity(objectID interface{}) *gomock.Call

GetObjectIntegrity indicates an expected call of GetObjectIntegrity.

func (*MockObjectIntegrityDBMockRecorder) GetReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) GetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call

GetReplicatePieceChecksum indicates an expected call of GetReplicatePieceChecksum.

func (*MockObjectIntegrityDBMockRecorder) SetAllReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) SetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount, checksum interface{}) *gomock.Call

SetAllReplicatePieceChecksum indicates an expected call of SetAllReplicatePieceChecksum.

func (*MockObjectIntegrityDBMockRecorder) SetObjectIntegrity

func (mr *MockObjectIntegrityDBMockRecorder) SetObjectIntegrity(integrity interface{}) *gomock.Call

SetObjectIntegrity indicates an expected call of SetObjectIntegrity.

func (*MockObjectIntegrityDBMockRecorder) SetReplicatePieceChecksum

func (mr *MockObjectIntegrityDBMockRecorder) SetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx, checksum interface{}) *gomock.Call

SetReplicatePieceChecksum indicates an expected call of SetReplicatePieceChecksum.

type MockOffChainAuthKeyDB

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

MockOffChainAuthKeyDB is a mock of OffChainAuthKeyDB interface.

func NewMockOffChainAuthKeyDB

func NewMockOffChainAuthKeyDB(ctrl *gomock.Controller) *MockOffChainAuthKeyDB

NewMockOffChainAuthKeyDB creates a new mock instance.

func (*MockOffChainAuthKeyDB) EXPECT

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

func (*MockOffChainAuthKeyDB) GetAuthKey

func (m *MockOffChainAuthKeyDB) GetAuthKey(userAddress, domain string) (*OffChainAuthKey, error)

GetAuthKey mocks base method.

func (*MockOffChainAuthKeyDB) InsertAuthKey

func (m *MockOffChainAuthKeyDB) InsertAuthKey(newRecord *OffChainAuthKey) error

InsertAuthKey mocks base method.

func (*MockOffChainAuthKeyDB) UpdateAuthKey

func (m *MockOffChainAuthKeyDB) UpdateAuthKey(userAddress, domain string, oldNonce, newNonce int32, newPublicKey string, newExpiryDate time.Time) error

UpdateAuthKey mocks base method.

type MockOffChainAuthKeyDBMockRecorder

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

MockOffChainAuthKeyDBMockRecorder is the mock recorder for MockOffChainAuthKeyDB.

func (*MockOffChainAuthKeyDBMockRecorder) GetAuthKey

func (mr *MockOffChainAuthKeyDBMockRecorder) GetAuthKey(userAddress, domain interface{}) *gomock.Call

GetAuthKey indicates an expected call of GetAuthKey.

func (*MockOffChainAuthKeyDBMockRecorder) InsertAuthKey

func (mr *MockOffChainAuthKeyDBMockRecorder) InsertAuthKey(newRecord interface{}) *gomock.Call

InsertAuthKey indicates an expected call of InsertAuthKey.

func (*MockOffChainAuthKeyDBMockRecorder) UpdateAuthKey

func (mr *MockOffChainAuthKeyDBMockRecorder) UpdateAuthKey(userAddress, domain, oldNonce, newNonce, newPublicKey, newExpiryDate interface{}) *gomock.Call

UpdateAuthKey indicates an expected call of UpdateAuthKey.

type MockSPDB

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

MockSPDB is a mock of SPDB interface.

func NewMockSPDB

func NewMockSPDB(ctrl *gomock.Controller) *MockSPDB

NewMockSPDB creates a new mock instance.

func (*MockSPDB) CheckQuotaAndAddReadRecord

func (m *MockSPDB) CheckQuotaAndAddReadRecord(record *ReadRecord, quota *BucketQuota) error

CheckQuotaAndAddReadRecord mocks base method.

func (*MockSPDB) CreateUploadProgress

func (m *MockSPDB) CreateUploadProgress(objectID uint64) error

CreateUploadProgress mocks base method.

func (*MockSPDB) DeleteAllReplicatePieceChecksum

func (m *MockSPDB) DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) error

DeleteAllReplicatePieceChecksum mocks base method.

func (*MockSPDB) DeleteGCObjectProgress

func (m *MockSPDB) DeleteGCObjectProgress(taskKey string) error

DeleteGCObjectProgress mocks base method.

func (*MockSPDB) DeleteObjectIntegrity

func (m *MockSPDB) DeleteObjectIntegrity(objectID uint64) error

DeleteObjectIntegrity mocks base method.

func (*MockSPDB) DeleteReplicatePieceChecksum

func (m *MockSPDB) DeleteReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) error

DeleteReplicatePieceChecksum mocks base method.

func (*MockSPDB) EXPECT

func (m *MockSPDB) EXPECT() *MockSPDBMockRecorder

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

func (*MockSPDB) FetchAllSp

func (m *MockSPDB) FetchAllSp(status ...types0.Status) ([]*types0.StorageProvider, error)

FetchAllSp mocks base method.

func (*MockSPDB) FetchAllSpWithoutOwnSp

func (m *MockSPDB) FetchAllSpWithoutOwnSp(status ...types0.Status) ([]*types0.StorageProvider, error)

FetchAllSpWithoutOwnSp mocks base method.

func (*MockSPDB) GetAllGCObjectTask

func (m *MockSPDB) GetAllGCObjectTask(taskKey string) []task.GCObjectTask

GetAllGCObjectTask mocks base method.

func (*MockSPDB) GetAllReplicatePieceChecksum

func (m *MockSPDB) GetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) ([][]byte, error)

GetAllReplicatePieceChecksum mocks base method.

func (*MockSPDB) GetAuthKey

func (m *MockSPDB) GetAuthKey(userAddress, domain string) (*OffChainAuthKey, error)

GetAuthKey mocks base method.

func (*MockSPDB) GetBucketReadRecord

func (m *MockSPDB) GetBucketReadRecord(bucketID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetBucketReadRecord mocks base method.

func (*MockSPDB) GetBucketTraffic

func (m *MockSPDB) GetBucketTraffic(bucketID uint64, yearMonth string) (*BucketTraffic, error)

GetBucketTraffic mocks base method.

func (*MockSPDB) GetObjectIntegrity

func (m *MockSPDB) GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error)

GetObjectIntegrity mocks base method.

func (*MockSPDB) GetObjectReadRecord

func (m *MockSPDB) GetObjectReadRecord(objectID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetObjectReadRecord mocks base method.

func (*MockSPDB) GetOwnSpInfo

func (m *MockSPDB) GetOwnSpInfo() (*types0.StorageProvider, error)

GetOwnSpInfo mocks base method.

func (*MockSPDB) GetReadRecord

func (m *MockSPDB) GetReadRecord(timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetReadRecord mocks base method.

func (*MockSPDB) GetReplicatePieceChecksum

func (m *MockSPDB) GetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) ([]byte, error)

GetReplicatePieceChecksum mocks base method.

func (*MockSPDB) GetSpByAddress

func (m *MockSPDB) GetSpByAddress(address string, addressType SpAddressType) (*types0.StorageProvider, error)

GetSpByAddress mocks base method.

func (*MockSPDB) GetSpByEndpoint

func (m *MockSPDB) GetSpByEndpoint(endpoint string) (*types0.StorageProvider, error)

GetSpByEndpoint mocks base method.

func (*MockSPDB) GetUserReadRecord

func (m *MockSPDB) GetUserReadRecord(userAddress string, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetUserReadRecord mocks base method.

func (*MockSPDB) InsertAuthKey

func (m *MockSPDB) InsertAuthKey(newRecord *OffChainAuthKey) error

InsertAuthKey mocks base method.

func (*MockSPDB) QueryUploadState

func (m *MockSPDB) QueryUploadState(objectID uint64) (types.TaskState, error)

QueryUploadState mocks base method.

func (*MockSPDB) SetAllReplicatePieceChecksum

func (m *MockSPDB) SetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32, checksum [][]byte) error

SetAllReplicatePieceChecksum mocks base method.

func (*MockSPDB) SetGCObjectProgress

func (m *MockSPDB) SetGCObjectProgress(taskKey string, deletingBlockID, deletedObjectID uint64) error

SetGCObjectProgress mocks base method.

func (*MockSPDB) SetObjectIntegrity

func (m *MockSPDB) SetObjectIntegrity(integrity *IntegrityMeta) error

SetObjectIntegrity mocks base method.

func (*MockSPDB) SetOwnSpInfo

func (m *MockSPDB) SetOwnSpInfo(sp *types0.StorageProvider) error

SetOwnSpInfo mocks base method.

func (*MockSPDB) SetReplicatePieceChecksum

func (m *MockSPDB) SetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32, checksum []byte) error

SetReplicatePieceChecksum mocks base method.

func (*MockSPDB) UpdateAllSp

func (m *MockSPDB) UpdateAllSp(spList []*types0.StorageProvider) error

UpdateAllSp mocks base method.

func (*MockSPDB) UpdateAuthKey

func (m *MockSPDB) UpdateAuthKey(userAddress, domain string, oldNonce, newNonce int32, newPublicKey string, newExpiryDate time.Time) error

UpdateAuthKey mocks base method.

func (*MockSPDB) UpdateUploadProgress

func (m *MockSPDB) UpdateUploadProgress(objectID uint64, taskState types.TaskState, errorDescription string) error

UpdateUploadProgress mocks base method.

type MockSPDBMockRecorder

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

MockSPDBMockRecorder is the mock recorder for MockSPDB.

func (*MockSPDBMockRecorder) CheckQuotaAndAddReadRecord

func (mr *MockSPDBMockRecorder) CheckQuotaAndAddReadRecord(record, quota interface{}) *gomock.Call

CheckQuotaAndAddReadRecord indicates an expected call of CheckQuotaAndAddReadRecord.

func (*MockSPDBMockRecorder) CreateUploadProgress

func (mr *MockSPDBMockRecorder) CreateUploadProgress(objectID interface{}) *gomock.Call

CreateUploadProgress indicates an expected call of CreateUploadProgress.

func (*MockSPDBMockRecorder) DeleteAllReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) DeleteAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call

DeleteAllReplicatePieceChecksum indicates an expected call of DeleteAllReplicatePieceChecksum.

func (*MockSPDBMockRecorder) DeleteGCObjectProgress

func (mr *MockSPDBMockRecorder) DeleteGCObjectProgress(taskKey interface{}) *gomock.Call

DeleteGCObjectProgress indicates an expected call of DeleteGCObjectProgress.

func (*MockSPDBMockRecorder) DeleteObjectIntegrity

func (mr *MockSPDBMockRecorder) DeleteObjectIntegrity(objectID interface{}) *gomock.Call

DeleteObjectIntegrity indicates an expected call of DeleteObjectIntegrity.

func (*MockSPDBMockRecorder) DeleteReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) DeleteReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call

DeleteReplicatePieceChecksum indicates an expected call of DeleteReplicatePieceChecksum.

func (*MockSPDBMockRecorder) FetchAllSp

func (mr *MockSPDBMockRecorder) FetchAllSp(status ...interface{}) *gomock.Call

FetchAllSp indicates an expected call of FetchAllSp.

func (*MockSPDBMockRecorder) FetchAllSpWithoutOwnSp

func (mr *MockSPDBMockRecorder) FetchAllSpWithoutOwnSp(status ...interface{}) *gomock.Call

FetchAllSpWithoutOwnSp indicates an expected call of FetchAllSpWithoutOwnSp.

func (*MockSPDBMockRecorder) GetAllGCObjectTask

func (mr *MockSPDBMockRecorder) GetAllGCObjectTask(taskKey interface{}) *gomock.Call

GetAllGCObjectTask indicates an expected call of GetAllGCObjectTask.

func (*MockSPDBMockRecorder) GetAllReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) GetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call

GetAllReplicatePieceChecksum indicates an expected call of GetAllReplicatePieceChecksum.

func (*MockSPDBMockRecorder) GetAuthKey

func (mr *MockSPDBMockRecorder) GetAuthKey(userAddress, domain interface{}) *gomock.Call

GetAuthKey indicates an expected call of GetAuthKey.

func (*MockSPDBMockRecorder) GetBucketReadRecord

func (mr *MockSPDBMockRecorder) GetBucketReadRecord(bucketID, timeRange interface{}) *gomock.Call

GetBucketReadRecord indicates an expected call of GetBucketReadRecord.

func (*MockSPDBMockRecorder) GetBucketTraffic

func (mr *MockSPDBMockRecorder) GetBucketTraffic(bucketID, yearMonth interface{}) *gomock.Call

GetBucketTraffic indicates an expected call of GetBucketTraffic.

func (*MockSPDBMockRecorder) GetObjectIntegrity

func (mr *MockSPDBMockRecorder) GetObjectIntegrity(objectID interface{}) *gomock.Call

GetObjectIntegrity indicates an expected call of GetObjectIntegrity.

func (*MockSPDBMockRecorder) GetObjectReadRecord

func (mr *MockSPDBMockRecorder) GetObjectReadRecord(objectID, timeRange interface{}) *gomock.Call

GetObjectReadRecord indicates an expected call of GetObjectReadRecord.

func (*MockSPDBMockRecorder) GetOwnSpInfo

func (mr *MockSPDBMockRecorder) GetOwnSpInfo() *gomock.Call

GetOwnSpInfo indicates an expected call of GetOwnSpInfo.

func (*MockSPDBMockRecorder) GetReadRecord

func (mr *MockSPDBMockRecorder) GetReadRecord(timeRange interface{}) *gomock.Call

GetReadRecord indicates an expected call of GetReadRecord.

func (*MockSPDBMockRecorder) GetReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) GetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call

GetReplicatePieceChecksum indicates an expected call of GetReplicatePieceChecksum.

func (*MockSPDBMockRecorder) GetSpByAddress

func (mr *MockSPDBMockRecorder) GetSpByAddress(address, addressType interface{}) *gomock.Call

GetSpByAddress indicates an expected call of GetSpByAddress.

func (*MockSPDBMockRecorder) GetSpByEndpoint

func (mr *MockSPDBMockRecorder) GetSpByEndpoint(endpoint interface{}) *gomock.Call

GetSpByEndpoint indicates an expected call of GetSpByEndpoint.

func (*MockSPDBMockRecorder) GetUserReadRecord

func (mr *MockSPDBMockRecorder) GetUserReadRecord(userAddress, timeRange interface{}) *gomock.Call

GetUserReadRecord indicates an expected call of GetUserReadRecord.

func (*MockSPDBMockRecorder) InsertAuthKey

func (mr *MockSPDBMockRecorder) InsertAuthKey(newRecord interface{}) *gomock.Call

InsertAuthKey indicates an expected call of InsertAuthKey.

func (*MockSPDBMockRecorder) QueryUploadState

func (mr *MockSPDBMockRecorder) QueryUploadState(objectID interface{}) *gomock.Call

QueryUploadState indicates an expected call of QueryUploadState.

func (*MockSPDBMockRecorder) SetAllReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) SetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount, checksum interface{}) *gomock.Call

SetAllReplicatePieceChecksum indicates an expected call of SetAllReplicatePieceChecksum.

func (*MockSPDBMockRecorder) SetGCObjectProgress

func (mr *MockSPDBMockRecorder) SetGCObjectProgress(taskKey, deletingBlockID, deletedObjectID interface{}) *gomock.Call

SetGCObjectProgress indicates an expected call of SetGCObjectProgress.

func (*MockSPDBMockRecorder) SetObjectIntegrity

func (mr *MockSPDBMockRecorder) SetObjectIntegrity(integrity interface{}) *gomock.Call

SetObjectIntegrity indicates an expected call of SetObjectIntegrity.

func (*MockSPDBMockRecorder) SetOwnSpInfo

func (mr *MockSPDBMockRecorder) SetOwnSpInfo(sp interface{}) *gomock.Call

SetOwnSpInfo indicates an expected call of SetOwnSpInfo.

func (*MockSPDBMockRecorder) SetReplicatePieceChecksum

func (mr *MockSPDBMockRecorder) SetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx, checksum interface{}) *gomock.Call

SetReplicatePieceChecksum indicates an expected call of SetReplicatePieceChecksum.

func (*MockSPDBMockRecorder) UpdateAllSp

func (mr *MockSPDBMockRecorder) UpdateAllSp(spList interface{}) *gomock.Call

UpdateAllSp indicates an expected call of UpdateAllSp.

func (*MockSPDBMockRecorder) UpdateAuthKey

func (mr *MockSPDBMockRecorder) UpdateAuthKey(userAddress, domain, oldNonce, newNonce, newPublicKey, newExpiryDate interface{}) *gomock.Call

UpdateAuthKey indicates an expected call of UpdateAuthKey.

func (*MockSPDBMockRecorder) UpdateUploadProgress

func (mr *MockSPDBMockRecorder) UpdateUploadProgress(objectID, taskState, errorDescription interface{}) *gomock.Call

UpdateUploadProgress indicates an expected call of UpdateUploadProgress.

type MockSPInfoDB

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

MockSPInfoDB is a mock of SPInfoDB interface.

func NewMockSPInfoDB

func NewMockSPInfoDB(ctrl *gomock.Controller) *MockSPInfoDB

NewMockSPInfoDB creates a new mock instance.

func (*MockSPInfoDB) EXPECT

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

func (*MockSPInfoDB) FetchAllSp

func (m *MockSPInfoDB) FetchAllSp(status ...types0.Status) ([]*types0.StorageProvider, error)

FetchAllSp mocks base method.

func (*MockSPInfoDB) FetchAllSpWithoutOwnSp

func (m *MockSPInfoDB) FetchAllSpWithoutOwnSp(status ...types0.Status) ([]*types0.StorageProvider, error)

FetchAllSpWithoutOwnSp mocks base method.

func (*MockSPInfoDB) GetOwnSpInfo

func (m *MockSPInfoDB) GetOwnSpInfo() (*types0.StorageProvider, error)

GetOwnSpInfo mocks base method.

func (*MockSPInfoDB) GetSpByAddress

func (m *MockSPInfoDB) GetSpByAddress(address string, addressType SpAddressType) (*types0.StorageProvider, error)

GetSpByAddress mocks base method.

func (*MockSPInfoDB) GetSpByEndpoint

func (m *MockSPInfoDB) GetSpByEndpoint(endpoint string) (*types0.StorageProvider, error)

GetSpByEndpoint mocks base method.

func (*MockSPInfoDB) SetOwnSpInfo

func (m *MockSPInfoDB) SetOwnSpInfo(sp *types0.StorageProvider) error

SetOwnSpInfo mocks base method.

func (*MockSPInfoDB) UpdateAllSp

func (m *MockSPInfoDB) UpdateAllSp(spList []*types0.StorageProvider) error

UpdateAllSp mocks base method.

type MockSPInfoDBMockRecorder

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

MockSPInfoDBMockRecorder is the mock recorder for MockSPInfoDB.

func (*MockSPInfoDBMockRecorder) FetchAllSp

func (mr *MockSPInfoDBMockRecorder) FetchAllSp(status ...interface{}) *gomock.Call

FetchAllSp indicates an expected call of FetchAllSp.

func (*MockSPInfoDBMockRecorder) FetchAllSpWithoutOwnSp

func (mr *MockSPInfoDBMockRecorder) FetchAllSpWithoutOwnSp(status ...interface{}) *gomock.Call

FetchAllSpWithoutOwnSp indicates an expected call of FetchAllSpWithoutOwnSp.

func (*MockSPInfoDBMockRecorder) GetOwnSpInfo

func (mr *MockSPInfoDBMockRecorder) GetOwnSpInfo() *gomock.Call

GetOwnSpInfo indicates an expected call of GetOwnSpInfo.

func (*MockSPInfoDBMockRecorder) GetSpByAddress

func (mr *MockSPInfoDBMockRecorder) GetSpByAddress(address, addressType interface{}) *gomock.Call

GetSpByAddress indicates an expected call of GetSpByAddress.

func (*MockSPInfoDBMockRecorder) GetSpByEndpoint

func (mr *MockSPInfoDBMockRecorder) GetSpByEndpoint(endpoint interface{}) *gomock.Call

GetSpByEndpoint indicates an expected call of GetSpByEndpoint.

func (*MockSPInfoDBMockRecorder) SetOwnSpInfo

func (mr *MockSPInfoDBMockRecorder) SetOwnSpInfo(sp interface{}) *gomock.Call

SetOwnSpInfo indicates an expected call of SetOwnSpInfo.

func (*MockSPInfoDBMockRecorder) UpdateAllSp

func (mr *MockSPInfoDBMockRecorder) UpdateAllSp(spList interface{}) *gomock.Call

UpdateAllSp indicates an expected call of UpdateAllSp.

type MockStorageParamDB

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

MockStorageParamDB is a mock of StorageParamDB interface.

func NewMockStorageParamDB

func NewMockStorageParamDB(ctrl *gomock.Controller) *MockStorageParamDB

NewMockStorageParamDB creates a new mock instance.

func (*MockStorageParamDB) EXPECT

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

func (*MockStorageParamDB) GetStorageParams

func (m *MockStorageParamDB) GetStorageParams() (*types1.Params, error)

GetStorageParams mocks base method.

func (*MockStorageParamDB) SetStorageParams

func (m *MockStorageParamDB) SetStorageParams(params *types1.Params) error

SetStorageParams mocks base method.

type MockStorageParamDBMockRecorder

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

MockStorageParamDBMockRecorder is the mock recorder for MockStorageParamDB.

func (*MockStorageParamDBMockRecorder) GetStorageParams

func (mr *MockStorageParamDBMockRecorder) GetStorageParams() *gomock.Call

GetStorageParams indicates an expected call of GetStorageParams.

func (*MockStorageParamDBMockRecorder) SetStorageParams

func (mr *MockStorageParamDBMockRecorder) SetStorageParams(params interface{}) *gomock.Call

SetStorageParams indicates an expected call of SetStorageParams.

type MockTrafficDB

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

MockTrafficDB is a mock of TrafficDB interface.

func NewMockTrafficDB

func NewMockTrafficDB(ctrl *gomock.Controller) *MockTrafficDB

NewMockTrafficDB creates a new mock instance.

func (*MockTrafficDB) CheckQuotaAndAddReadRecord

func (m *MockTrafficDB) CheckQuotaAndAddReadRecord(record *ReadRecord, quota *BucketQuota) error

CheckQuotaAndAddReadRecord mocks base method.

func (*MockTrafficDB) EXPECT

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

func (*MockTrafficDB) GetBucketReadRecord

func (m *MockTrafficDB) GetBucketReadRecord(bucketID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetBucketReadRecord mocks base method.

func (*MockTrafficDB) GetBucketTraffic

func (m *MockTrafficDB) GetBucketTraffic(bucketID uint64, yearMonth string) (*BucketTraffic, error)

GetBucketTraffic mocks base method.

func (*MockTrafficDB) GetObjectReadRecord

func (m *MockTrafficDB) GetObjectReadRecord(objectID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetObjectReadRecord mocks base method.

func (*MockTrafficDB) GetReadRecord

func (m *MockTrafficDB) GetReadRecord(timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetReadRecord mocks base method.

func (*MockTrafficDB) GetUserReadRecord

func (m *MockTrafficDB) GetUserReadRecord(userAddress string, timeRange *TrafficTimeRange) ([]*ReadRecord, error)

GetUserReadRecord mocks base method.

type MockTrafficDBMockRecorder

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

MockTrafficDBMockRecorder is the mock recorder for MockTrafficDB.

func (*MockTrafficDBMockRecorder) CheckQuotaAndAddReadRecord

func (mr *MockTrafficDBMockRecorder) CheckQuotaAndAddReadRecord(record, quota interface{}) *gomock.Call

CheckQuotaAndAddReadRecord indicates an expected call of CheckQuotaAndAddReadRecord.

func (*MockTrafficDBMockRecorder) GetBucketReadRecord

func (mr *MockTrafficDBMockRecorder) GetBucketReadRecord(bucketID, timeRange interface{}) *gomock.Call

GetBucketReadRecord indicates an expected call of GetBucketReadRecord.

func (*MockTrafficDBMockRecorder) GetBucketTraffic

func (mr *MockTrafficDBMockRecorder) GetBucketTraffic(bucketID, yearMonth interface{}) *gomock.Call

GetBucketTraffic indicates an expected call of GetBucketTraffic.

func (*MockTrafficDBMockRecorder) GetObjectReadRecord

func (mr *MockTrafficDBMockRecorder) GetObjectReadRecord(objectID, timeRange interface{}) *gomock.Call

GetObjectReadRecord indicates an expected call of GetObjectReadRecord.

func (*MockTrafficDBMockRecorder) GetReadRecord

func (mr *MockTrafficDBMockRecorder) GetReadRecord(timeRange interface{}) *gomock.Call

GetReadRecord indicates an expected call of GetReadRecord.

func (*MockTrafficDBMockRecorder) GetUserReadRecord

func (mr *MockTrafficDBMockRecorder) GetUserReadRecord(userAddress, timeRange interface{}) *gomock.Call

GetUserReadRecord indicates an expected call of GetUserReadRecord.

type MockUploadObjectProgressDB

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

MockUploadObjectProgressDB is a mock of UploadObjectProgressDB interface.

func NewMockUploadObjectProgressDB

func NewMockUploadObjectProgressDB(ctrl *gomock.Controller) *MockUploadObjectProgressDB

NewMockUploadObjectProgressDB creates a new mock instance.

func (*MockUploadObjectProgressDB) CreateUploadProgress

func (m *MockUploadObjectProgressDB) CreateUploadProgress(objectID uint64) error

CreateUploadProgress mocks base method.

func (*MockUploadObjectProgressDB) EXPECT

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

func (*MockUploadObjectProgressDB) QueryUploadState

func (m *MockUploadObjectProgressDB) QueryUploadState(objectID uint64) (types.TaskState, error)

QueryUploadState mocks base method.

func (*MockUploadObjectProgressDB) UpdateUploadProgress

func (m *MockUploadObjectProgressDB) UpdateUploadProgress(objectID uint64, taskState types.TaskState, errorDescription string) error

UpdateUploadProgress mocks base method.

type MockUploadObjectProgressDBMockRecorder

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

MockUploadObjectProgressDBMockRecorder is the mock recorder for MockUploadObjectProgressDB.

func (*MockUploadObjectProgressDBMockRecorder) CreateUploadProgress

func (mr *MockUploadObjectProgressDBMockRecorder) CreateUploadProgress(objectID interface{}) *gomock.Call

CreateUploadProgress indicates an expected call of CreateUploadProgress.

func (*MockUploadObjectProgressDBMockRecorder) QueryUploadState

func (mr *MockUploadObjectProgressDBMockRecorder) QueryUploadState(objectID interface{}) *gomock.Call

QueryUploadState indicates an expected call of QueryUploadState.

func (*MockUploadObjectProgressDBMockRecorder) UpdateUploadProgress

func (mr *MockUploadObjectProgressDBMockRecorder) UpdateUploadProgress(objectID, taskState, errorDescription interface{}) *gomock.Call

UpdateUploadProgress indicates an expected call of UpdateUploadProgress.

type OffChainAuthKey

type OffChainAuthKey struct {
	UserAddress string
	Domain      string

	CurrentNonce     int32
	CurrentPublicKey string
	NextNonce        int32
	ExpiryDate       time.Time

	CreatedTime  time.Time
	ModifiedTime time.Time
}

type OffChainAuthKeyDB

type OffChainAuthKeyDB interface {
	GetAuthKey(userAddress string, domain string) (*OffChainAuthKey, error)
	UpdateAuthKey(userAddress string, domain string, oldNonce int32, newNonce int32, newPublicKey string, newExpiryDate time.Time) error
	InsertAuthKey(newRecord *OffChainAuthKey) error
}

OffChainAuthKeyDB interface.

type ReadRecord

type ReadRecord struct {
	BucketID        uint64
	ObjectID        uint64
	UserAddress     string
	BucketName      string
	ObjectName      string
	ReadSize        uint64
	ReadTimestampUs int64
}

ReadRecord defines a read request record, will decrease the bucket read quota.

type SPInfoDB

type SPInfoDB interface {
	// UpdateAllSp update all sp info, delete old sp info.
	UpdateAllSp(spList []*sptypes.StorageProvider) error
	// FetchAllSp if status is nil return all sp info; otherwise return sp info by status.
	FetchAllSp(status ...sptypes.Status) ([]*sptypes.StorageProvider, error)
	// FetchAllSpWithoutOwnSp if status is nil return all sp info without own sp;
	// otherwise return sp info by status without own sp.
	FetchAllSpWithoutOwnSp(status ...sptypes.Status) ([]*sptypes.StorageProvider, error)
	// GetSpByAddress return sp info by address and addressType.
	GetSpByAddress(address string, addressType SpAddressType) (*sptypes.StorageProvider, error)
	// GetSpByEndpoint return sp info by endpoint.
	GetSpByEndpoint(endpoint string) (*sptypes.StorageProvider, error)
	// GetOwnSpInfo return own sp info.
	GetOwnSpInfo() (*sptypes.StorageProvider, error)
	// SetOwnSpInfo set(maybe overwrite) own sp info.
	SetOwnSpInfo(sp *sptypes.StorageProvider) error
}

SPInfoDB defines a series of sp interfaces.

type SignatureDB

type SignatureDB interface {
	/*
		Object Signature is used to get challenge info.
	*/
	// GetObjectIntegrity gets integrity meta info by object id.
	GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error)
	// SetObjectIntegrity sets(maybe overwrite) integrity hash info to db.
	SetObjectIntegrity(integrity *IntegrityMeta) error
	// DeleteObjectIntegrity deletes the integrity hash.
	DeleteObjectIntegrity(objectID uint64) error
	/*
		Piece Signature is used to help replicate object's piece data to secondary sps, which is temporary.
	*/
	// SetReplicatePieceChecksum sets(maybe overwrite) the piece hash.
	SetReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceIdx uint32, checksum []byte) error
	// GetAllReplicatePieceChecksum gets all piece hashes.
	GetAllReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceCount uint32) ([][]byte, error)
	// DeleteAllReplicatePieceChecksum deletes all piece hashes.
	DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceCount uint32) error
}

SignatureDB abstract object integrity interface.

type SpAddressType

type SpAddressType int32

SpAddressType identify address type of SP.

const (
	OperatorAddressType SpAddressType = iota + 1
	FundingAddressType
	SealAddressType
	ApprovalAddressType
)

type TrafficDB

type TrafficDB interface {
	// CheckQuotaAndAddReadRecord create bucket traffic firstly if bucket is not existed,
	// and check whether the added traffic record exceeds the quota, if it exceeds the quota,
	// it will return error, Otherwise, add a record and return nil.
	CheckQuotaAndAddReadRecord(record *ReadRecord, quota *BucketQuota) error
	// GetBucketTraffic return bucket traffic info,
	// notice maybe return (nil, nil) while there is no bucket traffic.
	GetBucketTraffic(bucketID uint64, yearMonth string) (*BucketTraffic, error)
	// GetReadRecord return record list by time range.
	GetReadRecord(timeRange *TrafficTimeRange) ([]*ReadRecord, error)
	// GetBucketReadRecord return bucket record list by time range.
	GetBucketReadRecord(bucketID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
	// GetObjectReadRecord return object record list by time range.
	GetObjectReadRecord(objectID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
	// GetUserReadRecord return user record list by time range.
	GetUserReadRecord(userAddress string, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
}

TrafficDB defines a series of traffic interfaces.

type TrafficTimeRange

type TrafficTimeRange struct {
	StartTimestampUs int64
	EndTimestampUs   int64
	LimitNum         int // is unlimited if LimitNum <= 0.
}

TrafficTimeRange is used by query, return records in [StartTimestampUs, EndTimestampUs).

type UploadObjectMeta

type UploadObjectMeta struct {
	ObjectID            uint64
	TaskState           storetypes.TaskState
	SecondaryAddresses  []string
	SecondarySignatures [][]byte
	ErrorDescription    string
}

UploadObjectMeta defines the upload object state and related seal info, etc.

type UploadObjectProgressDB

type UploadObjectProgressDB interface {
	// InsertUploadProgress inserts a new upload object progress.
	InsertUploadProgress(objectID uint64) error
	// DeleteUploadProgress deletes the upload object progress.
	DeleteUploadProgress(objectID uint64) error
	// UpdateUploadProgress updates the upload object progress state.
	UpdateUploadProgress(uploadMeta *UploadObjectMeta) error
	// GetUploadState queries the task state by object id.
	GetUploadState(objectID uint64) (storetypes.TaskState, error)
	// GetUploadMetasToReplicate queries the latest upload_done/replicate_doing object to continue replicate.
	// It is only used in startup.
	GetUploadMetasToReplicate(limit int) ([]*UploadObjectMeta, error)
	// GetUploadMetasToSeal queries the latest replicate_done/seal_doing object to continue seal.
	// It is only used in startup.
	GetUploadMetasToSeal(limit int) ([]*UploadObjectMeta, error)
	// InsertUploadEvent inserts a new upload event progress.
	InsertUploadEvent(objectID uint64, state string, description string) error
}

UploadObjectProgressDB interface which records upload object related progress(includes foreground and background) and state.

Jump to

Keyboard shortcuts

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