Documentation ¶
Overview ¶
Package spdb is a generated GoMock package.
Index ¶
- type BucketQuota
- type BucketTraffic
- type GCObjectInfoDB
- type IntegrityMeta
- type JobDB
- type MockGCObjectInfoDB
- func (m *MockGCObjectInfoDB) DeleteGCObjectProgress(taskKey string) error
- func (m *MockGCObjectInfoDB) EXPECT() *MockGCObjectInfoDBMockRecorder
- func (m *MockGCObjectInfoDB) GetAllGCObjectTask(taskKey string) []task.GCObjectTask
- func (m *MockGCObjectInfoDB) SetGCObjectProgress(taskKey string, deletingBlockID, deletedObjectID uint64) error
- type MockGCObjectInfoDBMockRecorder
- func (mr *MockGCObjectInfoDBMockRecorder) DeleteGCObjectProgress(taskKey interface{}) *gomock.Call
- func (mr *MockGCObjectInfoDBMockRecorder) GetAllGCObjectTask(taskKey interface{}) *gomock.Call
- func (mr *MockGCObjectInfoDBMockRecorder) SetGCObjectProgress(taskKey, deletingBlockID, deletedObjectID interface{}) *gomock.Call
- type MockJobDB
- func (m *MockJobDB) CreateUploadJob(objectInfo *types1.ObjectInfo) (*types.JobContext, error)
- func (m *MockJobDB) EXPECT() *MockJobDBMockRecorder
- func (m *MockJobDB) GetJobByID(jobID uint64) (*types.JobContext, error)
- func (m *MockJobDB) GetJobByObjectID(objectID uint64) (*types.JobContext, error)
- func (m *MockJobDB) UpdateJobState(objectID uint64, state types.JobState) error
- type MockJobDBMockRecorder
- func (mr *MockJobDBMockRecorder) CreateUploadJob(objectInfo interface{}) *gomock.Call
- func (mr *MockJobDBMockRecorder) GetJobByID(jobID interface{}) *gomock.Call
- func (mr *MockJobDBMockRecorder) GetJobByObjectID(objectID interface{}) *gomock.Call
- func (mr *MockJobDBMockRecorder) UpdateJobState(objectID, state interface{}) *gomock.Call
- type MockObjectDB
- type MockObjectDBMockRecorder
- type MockObjectIntegrityDB
- func (m *MockObjectIntegrityDB) DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) error
- func (m *MockObjectIntegrityDB) DeleteObjectIntegrity(objectID uint64) error
- func (m *MockObjectIntegrityDB) DeleteReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) error
- func (m *MockObjectIntegrityDB) EXPECT() *MockObjectIntegrityDBMockRecorder
- func (m *MockObjectIntegrityDB) GetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) ([][]byte, error)
- func (m *MockObjectIntegrityDB) GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error)
- func (m *MockObjectIntegrityDB) GetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) ([]byte, error)
- func (m *MockObjectIntegrityDB) SetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32, checksum [][]byte) error
- func (m *MockObjectIntegrityDB) SetObjectIntegrity(integrity *IntegrityMeta) error
- func (m *MockObjectIntegrityDB) SetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32, checksum []byte) error
- type MockObjectIntegrityDBMockRecorder
- func (mr *MockObjectIntegrityDBMockRecorder) DeleteAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) DeleteObjectIntegrity(objectID interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) DeleteReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) GetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) GetObjectIntegrity(objectID interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) GetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) SetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount, checksum interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) SetObjectIntegrity(integrity interface{}) *gomock.Call
- func (mr *MockObjectIntegrityDBMockRecorder) SetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx, checksum interface{}) *gomock.Call
- type MockOffChainAuthKeyDB
- func (m *MockOffChainAuthKeyDB) EXPECT() *MockOffChainAuthKeyDBMockRecorder
- func (m *MockOffChainAuthKeyDB) GetAuthKey(userAddress, domain string) (*OffChainAuthKey, error)
- func (m *MockOffChainAuthKeyDB) InsertAuthKey(newRecord *OffChainAuthKey) error
- func (m *MockOffChainAuthKeyDB) UpdateAuthKey(userAddress, domain string, oldNonce, newNonce int32, newPublicKey string, ...) error
- type MockOffChainAuthKeyDBMockRecorder
- type MockSPDB
- func (m *MockSPDB) CheckQuotaAndAddReadRecord(record *ReadRecord, quota *BucketQuota) error
- func (m *MockSPDB) CreateUploadJob(objectInfo *types1.ObjectInfo) (*types.JobContext, error)
- func (m *MockSPDB) DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) error
- func (m *MockSPDB) DeleteGCObjectProgress(taskKey string) error
- func (m *MockSPDB) DeleteObjectIntegrity(objectID uint64) error
- func (m *MockSPDB) DeleteReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) error
- func (m *MockSPDB) EXPECT() *MockSPDBMockRecorder
- func (m *MockSPDB) FetchAllSp(status ...types0.Status) ([]*types0.StorageProvider, error)
- func (m *MockSPDB) FetchAllSpWithoutOwnSp(status ...types0.Status) ([]*types0.StorageProvider, error)
- func (m *MockSPDB) GetAllGCObjectTask(taskKey string) []task.GCObjectTask
- func (m *MockSPDB) GetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) ([][]byte, error)
- func (m *MockSPDB) GetAuthKey(userAddress, domain string) (*OffChainAuthKey, error)
- func (m *MockSPDB) GetBucketReadRecord(bucketID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockSPDB) GetBucketTraffic(bucketID uint64, yearMonth string) (*BucketTraffic, error)
- func (m *MockSPDB) GetJobByID(jobID uint64) (*types.JobContext, error)
- func (m *MockSPDB) GetJobByObjectID(objectID uint64) (*types.JobContext, error)
- func (m *MockSPDB) GetObjectInfo(objectID uint64) (*types1.ObjectInfo, error)
- func (m *MockSPDB) GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error)
- func (m *MockSPDB) GetObjectReadRecord(objectID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockSPDB) GetOwnSpInfo() (*types0.StorageProvider, error)
- func (m *MockSPDB) GetReadRecord(timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockSPDB) GetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32) ([]byte, error)
- func (m *MockSPDB) GetSpByAddress(address string, addressType SpAddressType) (*types0.StorageProvider, error)
- func (m *MockSPDB) GetSpByEndpoint(endpoint string) (*types0.StorageProvider, error)
- func (m *MockSPDB) GetStorageParams() (*types1.Params, error)
- func (m *MockSPDB) GetUserReadRecord(userAddress string, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockSPDB) InsertAuthKey(newRecord *OffChainAuthKey) error
- func (m *MockSPDB) SetAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32, checksum [][]byte) error
- func (m *MockSPDB) SetGCObjectProgress(taskKey string, deletingBlockID, deletedObjectID uint64) error
- func (m *MockSPDB) SetObjectInfo(objectID uint64, objectInfo *types1.ObjectInfo) error
- func (m *MockSPDB) SetObjectIntegrity(integrity *IntegrityMeta) error
- func (m *MockSPDB) SetOwnSpInfo(sp *types0.StorageProvider) error
- func (m *MockSPDB) SetReplicatePieceChecksum(objectID uint64, replicateIdx, pieceIdx uint32, checksum []byte) error
- func (m *MockSPDB) SetStorageParams(params *types1.Params) error
- func (m *MockSPDB) UpdateAllSp(spList []*types0.StorageProvider) error
- func (m *MockSPDB) UpdateAuthKey(userAddress, domain string, oldNonce, newNonce int32, newPublicKey string, ...) error
- func (m *MockSPDB) UpdateJobState(objectID uint64, state types.JobState) error
- type MockSPDBMockRecorder
- func (mr *MockSPDBMockRecorder) CheckQuotaAndAddReadRecord(record, quota interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) CreateUploadJob(objectInfo interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) DeleteAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) DeleteGCObjectProgress(taskKey interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) DeleteObjectIntegrity(objectID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) DeleteReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) FetchAllSp(status ...interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) FetchAllSpWithoutOwnSp(status ...interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetAllGCObjectTask(taskKey interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetAuthKey(userAddress, domain interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetBucketReadRecord(bucketID, timeRange interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetBucketTraffic(bucketID, yearMonth interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetJobByID(jobID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetJobByObjectID(objectID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetObjectInfo(objectID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetObjectIntegrity(objectID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetObjectReadRecord(objectID, timeRange interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetOwnSpInfo() *gomock.Call
- func (mr *MockSPDBMockRecorder) GetReadRecord(timeRange interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetSpByAddress(address, addressType interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetSpByEndpoint(endpoint interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) GetStorageParams() *gomock.Call
- func (mr *MockSPDBMockRecorder) GetUserReadRecord(userAddress, timeRange interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) InsertAuthKey(newRecord interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetAllReplicatePieceChecksum(objectID, replicateIdx, pieceCount, checksum interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetGCObjectProgress(taskKey, deletingBlockID, deletedObjectID interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetObjectInfo(objectID, objectInfo interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetObjectIntegrity(integrity interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetOwnSpInfo(sp interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetReplicatePieceChecksum(objectID, replicateIdx, pieceIdx, checksum interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) SetStorageParams(params interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) UpdateAllSp(spList interface{}) *gomock.Call
- func (mr *MockSPDBMockRecorder) UpdateAuthKey(...) *gomock.Call
- func (mr *MockSPDBMockRecorder) UpdateJobState(objectID, state interface{}) *gomock.Call
- type MockSPInfoDB
- func (m *MockSPInfoDB) EXPECT() *MockSPInfoDBMockRecorder
- func (m *MockSPInfoDB) FetchAllSp(status ...types0.Status) ([]*types0.StorageProvider, error)
- func (m *MockSPInfoDB) FetchAllSpWithoutOwnSp(status ...types0.Status) ([]*types0.StorageProvider, error)
- func (m *MockSPInfoDB) GetOwnSpInfo() (*types0.StorageProvider, error)
- func (m *MockSPInfoDB) GetSpByAddress(address string, addressType SpAddressType) (*types0.StorageProvider, error)
- func (m *MockSPInfoDB) GetSpByEndpoint(endpoint string) (*types0.StorageProvider, error)
- func (m *MockSPInfoDB) SetOwnSpInfo(sp *types0.StorageProvider) error
- func (m *MockSPInfoDB) UpdateAllSp(spList []*types0.StorageProvider) error
- type MockSPInfoDBMockRecorder
- func (mr *MockSPInfoDBMockRecorder) FetchAllSp(status ...interface{}) *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) FetchAllSpWithoutOwnSp(status ...interface{}) *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) GetOwnSpInfo() *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) GetSpByAddress(address, addressType interface{}) *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) GetSpByEndpoint(endpoint interface{}) *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) SetOwnSpInfo(sp interface{}) *gomock.Call
- func (mr *MockSPInfoDBMockRecorder) UpdateAllSp(spList interface{}) *gomock.Call
- type MockStorageParamDB
- type MockStorageParamDBMockRecorder
- type MockTrafficDB
- func (m *MockTrafficDB) CheckQuotaAndAddReadRecord(record *ReadRecord, quota *BucketQuota) error
- func (m *MockTrafficDB) EXPECT() *MockTrafficDBMockRecorder
- func (m *MockTrafficDB) GetBucketReadRecord(bucketID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockTrafficDB) GetBucketTraffic(bucketID uint64, yearMonth string) (*BucketTraffic, error)
- func (m *MockTrafficDB) GetObjectReadRecord(objectID uint64, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockTrafficDB) GetReadRecord(timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- func (m *MockTrafficDB) GetUserReadRecord(userAddress string, timeRange *TrafficTimeRange) ([]*ReadRecord, error)
- type MockTrafficDBMockRecorder
- func (mr *MockTrafficDBMockRecorder) CheckQuotaAndAddReadRecord(record, quota interface{}) *gomock.Call
- func (mr *MockTrafficDBMockRecorder) GetBucketReadRecord(bucketID, timeRange interface{}) *gomock.Call
- func (mr *MockTrafficDBMockRecorder) GetBucketTraffic(bucketID, yearMonth interface{}) *gomock.Call
- func (mr *MockTrafficDBMockRecorder) GetObjectReadRecord(objectID, timeRange interface{}) *gomock.Call
- func (mr *MockTrafficDBMockRecorder) GetReadRecord(timeRange interface{}) *gomock.Call
- func (mr *MockTrafficDBMockRecorder) GetUserReadRecord(userAddress, timeRange interface{}) *gomock.Call
- type ObjectDB
- type ObjectIntegrityDB
- type OffChainAuthKey
- type OffChainAuthKeyDB
- type ReadRecord
- type SPDB
- type SPInfoDB
- type SpAddressType
- type StorageParamDB
- type TrafficDB
- type TrafficTimeRange
Constants ¶
This section is empty.
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 GCObjectInfoDB ¶
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 JobDB ¶
type JobDB interface { // CreateUploadJob create upload job and return job context CreateUploadJob(objectInfo *storagetypes.ObjectInfo) (*servicetypes.JobContext, error) // UpdateJobState update the state of a job by object id UpdateJobState(objectID uint64, state servicetypes.JobState) error // GetJobByID get job context by job id and return job context GetJobByID(jobID uint64) (*servicetypes.JobContext, error) // GetJobByObjectID get job context by object id GetJobByObjectID(objectID uint64) (*servicetypes.JobContext, error) }
JobDB interface which contains job related to object id interface
type MockGCObjectInfoDB ¶
type MockGCObjectInfoDB struct {
// contains filtered or unexported fields
}
MockGCObjectInfoDB is a mock of GCObjectInfoDB interface.
func NewMockGCObjectInfoDB ¶
func NewMockGCObjectInfoDB(ctrl *gomock.Controller) *MockGCObjectInfoDB
NewMockGCObjectInfoDB creates a new mock instance.
func (*MockGCObjectInfoDB) DeleteGCObjectProgress ¶
func (m *MockGCObjectInfoDB) DeleteGCObjectProgress(taskKey string) error
DeleteGCObjectProgress mocks base method.
func (*MockGCObjectInfoDB) EXPECT ¶
func (m *MockGCObjectInfoDB) EXPECT() *MockGCObjectInfoDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGCObjectInfoDB) GetAllGCObjectTask ¶
func (m *MockGCObjectInfoDB) GetAllGCObjectTask(taskKey string) []task.GCObjectTask
GetAllGCObjectTask mocks base method.
func (*MockGCObjectInfoDB) SetGCObjectProgress ¶
func (m *MockGCObjectInfoDB) SetGCObjectProgress(taskKey string, deletingBlockID, deletedObjectID uint64) error
SetGCObjectProgress mocks base method.
type MockGCObjectInfoDBMockRecorder ¶
type MockGCObjectInfoDBMockRecorder struct {
// contains filtered or unexported fields
}
MockGCObjectInfoDBMockRecorder is the mock recorder for MockGCObjectInfoDB.
func (*MockGCObjectInfoDBMockRecorder) DeleteGCObjectProgress ¶
func (mr *MockGCObjectInfoDBMockRecorder) DeleteGCObjectProgress(taskKey interface{}) *gomock.Call
DeleteGCObjectProgress indicates an expected call of DeleteGCObjectProgress.
func (*MockGCObjectInfoDBMockRecorder) GetAllGCObjectTask ¶
func (mr *MockGCObjectInfoDBMockRecorder) GetAllGCObjectTask(taskKey interface{}) *gomock.Call
GetAllGCObjectTask indicates an expected call of GetAllGCObjectTask.
func (*MockGCObjectInfoDBMockRecorder) SetGCObjectProgress ¶
func (mr *MockGCObjectInfoDBMockRecorder) SetGCObjectProgress(taskKey, deletingBlockID, deletedObjectID interface{}) *gomock.Call
SetGCObjectProgress indicates an expected call of SetGCObjectProgress.
type MockJobDB ¶
type MockJobDB struct {
// contains filtered or unexported fields
}
MockJobDB is a mock of JobDB interface.
func NewMockJobDB ¶
func NewMockJobDB(ctrl *gomock.Controller) *MockJobDB
NewMockJobDB creates a new mock instance.
func (*MockJobDB) CreateUploadJob ¶
func (m *MockJobDB) CreateUploadJob(objectInfo *types1.ObjectInfo) (*types.JobContext, error)
CreateUploadJob mocks base method.
func (*MockJobDB) EXPECT ¶
func (m *MockJobDB) EXPECT() *MockJobDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJobDB) GetJobByID ¶
func (m *MockJobDB) GetJobByID(jobID uint64) (*types.JobContext, error)
GetJobByID mocks base method.
func (*MockJobDB) GetJobByObjectID ¶
func (m *MockJobDB) GetJobByObjectID(objectID uint64) (*types.JobContext, error)
GetJobByObjectID mocks base method.
type MockJobDBMockRecorder ¶
type MockJobDBMockRecorder struct {
// contains filtered or unexported fields
}
MockJobDBMockRecorder is the mock recorder for MockJobDB.
func (*MockJobDBMockRecorder) CreateUploadJob ¶
func (mr *MockJobDBMockRecorder) CreateUploadJob(objectInfo interface{}) *gomock.Call
CreateUploadJob indicates an expected call of CreateUploadJob.
func (*MockJobDBMockRecorder) GetJobByID ¶
func (mr *MockJobDBMockRecorder) GetJobByID(jobID interface{}) *gomock.Call
GetJobByID indicates an expected call of GetJobByID.
func (*MockJobDBMockRecorder) GetJobByObjectID ¶
func (mr *MockJobDBMockRecorder) GetJobByObjectID(objectID interface{}) *gomock.Call
GetJobByObjectID indicates an expected call of GetJobByObjectID.
func (*MockJobDBMockRecorder) UpdateJobState ¶
func (mr *MockJobDBMockRecorder) UpdateJobState(objectID, state interface{}) *gomock.Call
UpdateJobState indicates an expected call of UpdateJobState.
type MockObjectDB ¶
type MockObjectDB struct {
// contains filtered or unexported fields
}
MockObjectDB is a mock of ObjectDB interface.
func NewMockObjectDB ¶
func NewMockObjectDB(ctrl *gomock.Controller) *MockObjectDB
NewMockObjectDB creates a new mock instance.
func (*MockObjectDB) EXPECT ¶
func (m *MockObjectDB) EXPECT() *MockObjectDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockObjectDB) GetObjectInfo ¶
func (m *MockObjectDB) GetObjectInfo(objectID uint64) (*types1.ObjectInfo, error)
GetObjectInfo mocks base method.
func (*MockObjectDB) SetObjectInfo ¶
func (m *MockObjectDB) SetObjectInfo(objectID uint64, objectInfo *types1.ObjectInfo) error
SetObjectInfo mocks base method.
type MockObjectDBMockRecorder ¶
type MockObjectDBMockRecorder struct {
// contains filtered or unexported fields
}
MockObjectDBMockRecorder is the mock recorder for MockObjectDB.
func (*MockObjectDBMockRecorder) GetObjectInfo ¶
func (mr *MockObjectDBMockRecorder) GetObjectInfo(objectID interface{}) *gomock.Call
GetObjectInfo indicates an expected call of GetObjectInfo.
func (*MockObjectDBMockRecorder) SetObjectInfo ¶
func (mr *MockObjectDBMockRecorder) SetObjectInfo(objectID, objectInfo interface{}) *gomock.Call
SetObjectInfo indicates an expected call of SetObjectInfo.
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 ¶
func (m *MockObjectIntegrityDB) EXPECT() *MockObjectIntegrityDBMockRecorder
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 ¶
func (m *MockOffChainAuthKeyDB) EXPECT() *MockOffChainAuthKeyDBMockRecorder
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) CreateUploadJob ¶
func (m *MockSPDB) CreateUploadJob(objectInfo *types1.ObjectInfo) (*types.JobContext, error)
CreateUploadJob mocks base method.
func (*MockSPDB) DeleteAllReplicatePieceChecksum ¶
func (m *MockSPDB) DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx, pieceCount uint32) error
DeleteAllReplicatePieceChecksum mocks base method.
func (*MockSPDB) DeleteGCObjectProgress ¶
DeleteGCObjectProgress mocks base method.
func (*MockSPDB) DeleteObjectIntegrity ¶
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 ¶
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) GetJobByID ¶
func (m *MockSPDB) GetJobByID(jobID uint64) (*types.JobContext, error)
GetJobByID mocks base method.
func (*MockSPDB) GetJobByObjectID ¶
func (m *MockSPDB) GetJobByObjectID(objectID uint64) (*types.JobContext, error)
GetJobByObjectID mocks base method.
func (*MockSPDB) GetObjectInfo ¶
func (m *MockSPDB) GetObjectInfo(objectID uint64) (*types1.ObjectInfo, error)
GetObjectInfo 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) GetStorageParams ¶
GetStorageParams 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) 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) SetObjectInfo ¶
func (m *MockSPDB) SetObjectInfo(objectID uint64, objectInfo *types1.ObjectInfo) error
SetObjectInfo 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) SetStorageParams ¶
SetStorageParams mocks base method.
func (*MockSPDB) UpdateAllSp ¶
func (m *MockSPDB) UpdateAllSp(spList []*types0.StorageProvider) error
UpdateAllSp 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) CreateUploadJob ¶
func (mr *MockSPDBMockRecorder) CreateUploadJob(objectInfo interface{}) *gomock.Call
CreateUploadJob indicates an expected call of CreateUploadJob.
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) GetJobByID ¶
func (mr *MockSPDBMockRecorder) GetJobByID(jobID interface{}) *gomock.Call
GetJobByID indicates an expected call of GetJobByID.
func (*MockSPDBMockRecorder) GetJobByObjectID ¶
func (mr *MockSPDBMockRecorder) GetJobByObjectID(objectID interface{}) *gomock.Call
GetJobByObjectID indicates an expected call of GetJobByObjectID.
func (*MockSPDBMockRecorder) GetObjectInfo ¶
func (mr *MockSPDBMockRecorder) GetObjectInfo(objectID interface{}) *gomock.Call
GetObjectInfo indicates an expected call of GetObjectInfo.
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) GetStorageParams ¶
func (mr *MockSPDBMockRecorder) GetStorageParams() *gomock.Call
GetStorageParams indicates an expected call of GetStorageParams.
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) 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) SetObjectInfo ¶
func (mr *MockSPDBMockRecorder) SetObjectInfo(objectID, objectInfo interface{}) *gomock.Call
SetObjectInfo indicates an expected call of SetObjectInfo.
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) SetStorageParams ¶
func (mr *MockSPDBMockRecorder) SetStorageParams(params interface{}) *gomock.Call
SetStorageParams indicates an expected call of SetStorageParams.
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) UpdateJobState ¶
func (mr *MockSPDBMockRecorder) UpdateJobState(objectID, state interface{}) *gomock.Call
UpdateJobState indicates an expected call of UpdateJobState.
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 ¶
func (m *MockSPInfoDB) EXPECT() *MockSPInfoDBMockRecorder
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 ¶
func (m *MockStorageParamDB) EXPECT() *MockStorageParamDBMockRecorder
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 ¶
func (m *MockTrafficDB) EXPECT() *MockTrafficDBMockRecorder
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 ObjectDB ¶
type ObjectDB interface { // GetObjectInfo get object info by object id GetObjectInfo(objectID uint64) (*storagetypes.ObjectInfo, error) // SetObjectInfo set(maybe overwrite) object info by object id SetObjectInfo(objectID uint64, objectInfo *storagetypes.ObjectInfo) error }
ObjectDB interface which contains get and set object info interface
type ObjectIntegrityDB ¶
type ObjectIntegrityDB interface { // GetObjectIntegrity get integrity meta info by object id GetObjectIntegrity(objectID uint64) (*IntegrityMeta, error) // SetObjectIntegrity set(maybe overwrite) integrity hash info to db SetObjectIntegrity(integrity *IntegrityMeta) error DeleteObjectIntegrity(objectID uint64) error GetReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceIdx uint32) ([]byte, error) SetReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceIdx uint32, checksum []byte) error DeleteReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceIdx uint32) error GetAllReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceCount uint32) ([][]byte, error) SetAllReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceCount uint32, checksum [][]byte) error DeleteAllReplicatePieceChecksum(objectID uint64, replicateIdx uint32, pieceCount uint32) error }
ObjectIntegrityDB abstract object integrity interface
type OffChainAuthKey ¶
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 SPDB ¶
type SPDB interface { JobDB ObjectDB ObjectIntegrityDB TrafficDB SPInfoDB GCObjectInfoDB StorageParamDB OffChainAuthKeyDB }
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 }
type SpAddressType ¶
type SpAddressType int32
SpAddressType identify address type of SP
const ( OperatorAddressType SpAddressType = iota + 1 FundingAddressType SealAddressType ApprovalAddressType )
type StorageParamDB ¶
type StorageParamDB interface { // GetStorageParams return storage params GetStorageParams() (*storagetypes.Params, error) // SetStorageParams set(maybe overwrite) storage params SetStorageParams(params *storagetypes.Params) error }
StorageParamDB interface
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 define 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)