Documentation ¶
Overview ¶
Package gfspclient is a generated GoMock package.
Index ¶
- Constants
- Variables
- func DefaultClientOptions() []grpc.DialOption
- type ApproverAPI
- type AuthenticatorAPI
- type DownloaderAPI
- type GaterAPI
- type GfSpClient
- func (s *GfSpClient) ApproverConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *GfSpClient) AskCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) (bool, coretask.ApprovalCreateBucketTask, error)
- func (s *GfSpClient) AskCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask) (bool, coretask.ApprovalCreateObjectTask, error)
- func (s *GfSpClient) AskMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask) (bool, coretask.ApprovalMigrateBucketTask, error)
- func (s *GfSpClient) AskSecondaryReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask, low, high int, ...) ([]*gfsptask.GfSpReplicatePieceApprovalTask, error)
- func (s *GfSpClient) AskTask(ctx context.Context, limit corercmgr.Limit) (coretask.Task, error)
- func (s *GfSpClient) Close() error
- func (s *GfSpClient) CompleteMigrateBucket(ctx context.Context, migrateBucket *storagetypes.MsgCompleteMigrateBucket) (string, error)
- func (s *GfSpClient) CompleteSPExit(ctx context.Context, ...) (string, error)
- func (s *GfSpClient) CompleteSwapOut(ctx context.Context, completeSwapOut *virtualgrouptypes.MsgCompleteSwapOut) (string, error)
- func (s *GfSpClient) Connection(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *GfSpClient) CreateGlobalVirtualGroup(ctx context.Context, group *gfspserver.GfSpCreateGlobalVirtualGroup) error
- func (s *GfSpClient) CreateResumableUploadObject(ctx context.Context, task coretask.ResumableUploadObjectTask) error
- func (s *GfSpClient) CreateUploadObject(ctx context.Context, task coretask.UploadObjectTask) error
- func (s *GfSpClient) DiscontinueBucket(ctx context.Context, bucket *storagetypes.MsgDiscontinueBucket) (string, error)
- func (s *GfSpClient) DoneReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, opts ...grpc.DialOption) ([]byte, []byte, error)
- func (s *GfSpClient) DoneReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask) ([]byte, error)
- func (s *GfSpClient) GetAuthNonce(ctx context.Context, account string, domain string, opts ...grpc.CallOption) (currentNonce int32, nextNonce int32, currentPublicKey string, expiryDate int64, ...)
- func (s *GfSpClient) GetBucketByBucketID(ctx context.Context, bucketID int64, includePrivate bool, ...) (*types.Bucket, error)
- func (s *GfSpClient) GetBucketByBucketName(ctx context.Context, bucketName string, includePrivate bool, ...) (*types.Bucket, error)
- func (s *GfSpClient) GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool, ...) (*types.Bucket, *payment_types.StreamRecord, error)
- func (s *GfSpClient) GetBucketReadQuota(ctx context.Context, bucket *storage_types.BucketInfo, opts ...grpc.DialOption) (uint64, uint64, uint64, error)
- func (s *GfSpClient) GetChallengeInfo(ctx context.Context, challengePieceTask coretask.ChallengePieceTask, ...) ([]byte, [][]byte, []byte, error)
- func (s *GfSpClient) GetEndpointBySpID(ctx context.Context, spId uint32, opts ...grpc.DialOption) (string, error)
- func (s *GfSpClient) GetGlobalVirtualGroup(ctx context.Context, bucketID uint64, lvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error)
- func (s *GfSpClient) GetGlobalVirtualGroupByGvgID(ctx context.Context, gvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error)
- func (s *GfSpClient) GetGroupList(ctx context.Context, name string, prefix string, sourceType string, ...) ([]*types.Group, int64, error)
- func (s *GfSpClient) GetGroupMembers(ctx context.Context, groupID uint64, startAfter string, limit uint32, ...) ([]*types.GroupMember, error)
- func (s *GfSpClient) GetObject(ctx context.Context, downloadObjectTask coretask.DownloadObjectTask, ...) ([]byte, error)
- func (s *GfSpClient) GetObjectByID(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (*storage_types.ObjectInfo, error)
- func (s *GfSpClient) GetObjectMeta(ctx context.Context, objectName string, bucketName string, includePrivate bool, ...) (*types.Object, error)
- func (s *GfSpClient) GetPaymentByBucketID(ctx context.Context, bucketID int64, includePrivate bool, ...) (*payment_types.StreamRecord, error)
- func (s *GfSpClient) GetPaymentByBucketName(ctx context.Context, bucketName string, includePrivate bool, ...) (*payment_types.StreamRecord, error)
- func (s *GfSpClient) GetPiece(ctx context.Context, downloadPieceTask coretask.DownloadPieceTask, ...) ([]byte, error)
- func (s *GfSpClient) GetPieceFromECChunks(ctx context.Context, endpoint string, task coretask.RecoveryPieceTask) (io.ReadCloser, error)
- func (s *GfSpClient) GetSPInfo(ctx context.Context, operatorAddress string, opts ...grpc.DialOption) (*sptypes.StorageProvider, error)
- func (s *GfSpClient) GetSecondarySPMigrationBucketApproval(ctx context.Context, secondarySPEndpoint string, ...) ([]byte, error)
- func (s *GfSpClient) GetStatus(ctx context.Context, opts ...grpc.DialOption) (*types.Status, error)
- func (s *GfSpClient) GetSwapOutApproval(ctx context.Context, destSPEndpoint string, ...) (*virtualgrouptypes.MsgSwapOut, error)
- func (s *GfSpClient) GetUploadObjectSegment(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (uint32, error)
- func (s *GfSpClient) GetUploadObjectState(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (int32, string, error)
- func (s *GfSpClient) GetUserBuckets(ctx context.Context, account string, includeRemoved bool, ...) ([]*types.Bucket, error)
- func (s *GfSpClient) GetUserBucketsCount(ctx context.Context, account string, includeRemoved bool, ...) (int64, error)
- func (s *GfSpClient) GetUserGroups(ctx context.Context, accountID string, startAfter uint64, limit uint32, ...) ([]*types.GroupMember, error)
- func (s *GfSpClient) GetVirtualGroupFamily(ctx context.Context, vgfID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroupFamily, error)
- func (s *GfSpClient) HTTPClient(ctx context.Context) *http.Client
- func (s *GfSpClient) ListBucketReadRecord(ctx context.Context, bucket *storage_types.BucketInfo, ...) ([]*types.ReadRecord, int64, error)
- func (s *GfSpClient) ListBucketsByBucketID(ctx context.Context, bucketIDs []uint64, includeRemoved bool, ...) (map[uint64]*types.Bucket, error)
- func (s *GfSpClient) ListDeletedObjectsByBlockNumberRange(ctx context.Context, spOperatorAddress string, startBlockNumber uint64, ...) ([]*types.Object, uint64, error)
- func (s *GfSpClient) ListExpiredBucketsBySp(ctx context.Context, createAt int64, primarySpID uint32, limit int64, ...) ([]*types.Bucket, error)
- func (s *GfSpClient) ListGlobalVirtualGroupsByBucket(ctx context.Context, bucketID uint64, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error)
- func (s *GfSpClient) ListGlobalVirtualGroupsBySecondarySP(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error)
- func (s *GfSpClient) ListMigrateBucketEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListMigrateBucketEvents, error)
- func (s *GfSpClient) ListObjectsByBucketName(ctx context.Context, bucketName string, accountId string, maxKeys uint64, ...) (objects []*types.Object, KeyCount uint64, MaxKeys uint64, IsTruncated bool, ...)
- func (s *GfSpClient) ListObjectsByGVGAndBucketForGC(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, ...) ([]*types.ObjectDetails, error)
- func (s *GfSpClient) ListObjectsByObjectID(ctx context.Context, objectIDs []uint64, includeRemoved bool, ...) (map[uint64]*types.Object, error)
- func (s *GfSpClient) ListObjectsInGVG(ctx context.Context, gvgID uint32, startAfter uint64, limit uint32, ...) ([]*types.ObjectDetails, error)
- func (s *GfSpClient) ListObjectsInGVGAndBucket(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, ...) ([]*types.ObjectDetails, error)
- func (s *GfSpClient) ListSpExitEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) (*types.ListSpExitEvents, error)
- func (s *GfSpClient) ListSwapOutEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListSwapOutEvents, error)
- func (s *GfSpClient) ListVirtualGroupFamiliesSpID(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroupFamily, error)
- func (s *GfSpClient) ManagerConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *GfSpClient) MigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error)
- func (s *GfSpClient) NotifyDestSPMigrateSwapOut(ctx context.Context, destEndpoint string, ...) error
- func (s *GfSpClient) NotifyMigrateSwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) error
- func (s *GfSpClient) P2PConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *GfSpClient) PickVirtualGroupFamilyID(ctx context.Context, task coretask.ApprovalCreateBucketTask) (uint32, error)
- func (s *GfSpClient) QueryBucketMigrate(ctx context.Context, endpoint string) (string, error)
- func (s *GfSpClient) QueryP2PBootstrap(ctx context.Context) ([]string, error)
- func (s *GfSpClient) QuerySPExit(ctx context.Context, endpoint string) (string, error)
- func (s *GfSpClient) QueryTasks(ctx context.Context, endpoint string, subKey string) ([]string, error)
- func (s *GfSpClient) RejectUnSealObject(ctx context.Context, object *storagetypes.MsgRejectSealObject) (string, error)
- func (s *GfSpClient) ReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, data []byte, ...) error
- func (s *GfSpClient) ReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask, ...) error
- func (s *GfSpClient) ReportTask(ctx context.Context, report coretask.Task) error
- func (s *GfSpClient) ResumableUploadObject(ctx context.Context, task coretask.ResumableUploadObjectTask, stream io.Reader) error
- func (s *GfSpClient) SPExit(ctx context.Context, spExit *virtualgrouptypes.MsgStorageProviderExit) (string, error)
- func (s *GfSpClient) SealObject(ctx context.Context, object *storagetypes.MsgSealObject) (string, error)
- func (s *GfSpClient) SignCreateBucketApproval(ctx context.Context, bucket *storagetypes.MsgCreateBucket) ([]byte, error)
- func (s *GfSpClient) SignCreateObjectApproval(ctx context.Context, object *storagetypes.MsgCreateObject) ([]byte, error)
- func (s *GfSpClient) SignMigrateBucketApproval(ctx context.Context, bucket *storagetypes.MsgMigrateBucket) ([]byte, error)
- func (s *GfSpClient) SignMigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error)
- func (s *GfSpClient) SignP2PPingMsg(ctx context.Context, ping *gfspp2p.GfSpPing) ([]byte, error)
- func (s *GfSpClient) SignP2PPongMsg(ctx context.Context, pong *gfspp2p.GfSpPong) ([]byte, error)
- func (s *GfSpClient) SignReceiveTask(ctx context.Context, receiveTask coretask.ReceivePieceTask) ([]byte, error)
- func (s *GfSpClient) SignRecoveryTask(ctx context.Context, recoveryTask coretask.RecoveryPieceTask) ([]byte, error)
- func (s *GfSpClient) SignReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask) ([]byte, error)
- func (s *GfSpClient) SignSecondarySPMigrationBucket(ctx context.Context, signDoc *storagetypes.SecondarySpMigrationBucketSignDoc) ([]byte, error)
- func (s *GfSpClient) SignSecondarySealBls(ctx context.Context, objectID uint64, gvgId uint32, checksums [][]byte) ([]byte, error)
- func (s *GfSpClient) SignSwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) ([]byte, error)
- func (s *GfSpClient) SignerConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *GfSpClient) SwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) (string, error)
- func (s *GfSpClient) UpdateSPPrice(ctx context.Context, price *sptypes.MsgUpdateSpStoragePrice) (string, error)
- func (s *GfSpClient) UpdateUserPublicKey(ctx context.Context, account string, domain string, currentNonce int32, ...) (bool, error)
- func (s *GfSpClient) UploadObject(ctx context.Context, task coretask.UploadObjectTask, stream io.Reader) error
- func (s *GfSpClient) VerifyAuthentication(ctx context.Context, auth coremodule.AuthOpType, ...) (bool, error)
- func (s *GfSpClient) VerifyGNFD1EddsaSignature(ctx context.Context, account string, domain string, offChainSig string, ...) (bool, error)
- func (s *GfSpClient) VerifyPermission(ctx context.Context, Operator string, bucketName string, objectName string, ...) (*permission_types.Effect, error)
- func (s *GfSpClient) VerifyPermissionByID(ctx context.Context, Operator string, resourceType resource.ResourceType, ...) (*permission_types.Effect, error)
- type GfSpClientAPI
- type ManagerAPI
- type MetadataAPI
- type MockApproverAPI
- func (m *MockApproverAPI) AskCreateBucketApproval(ctx context.Context, t task.ApprovalCreateBucketTask) (bool, task.ApprovalCreateBucketTask, error)
- func (m *MockApproverAPI) AskCreateObjectApproval(ctx context.Context, t task.ApprovalCreateObjectTask) (bool, task.ApprovalCreateObjectTask, error)
- func (m *MockApproverAPI) AskMigrateBucketApproval(ctx context.Context, t task.ApprovalMigrateBucketTask) (bool, task.ApprovalMigrateBucketTask, error)
- func (m *MockApproverAPI) EXPECT() *MockApproverAPIMockRecorder
- type MockApproverAPIMockRecorder
- type P2PAPI
- type QueryAPI
- type ReceiverAPI
- type SignerAPI
- type UploaderAPI
Constants ¶
const ( // MaxClientCallMsgSize defines the max message size for grpc client MaxClientCallMsgSize = 3 * 1024 * 1024 * 1024 // ClientCodeSpace defines the code space for gfsp client ClientCodeSpace = "GfSpClient" // HTTPMaxIdleConns defines the max idle connections for HTTP server HTTPMaxIdleConns = 20 // HTTPIdleConnTimout defines the idle time of connection for closing HTTPIdleConnTimout = 60 * time.Second // DefaultStreamBufSize defines gateway stream forward payload buf size DefaultStreamBufSize = 16 * 1024 * 1024 )
const ( // ReplicateObjectPiecePath defines replicate-object path style ReplicateObjectPiecePath = "/greenfield/receiver/v1/replicate-piece" // GnfdReplicatePieceApprovalHeader defines secondary approved msg for replicating piece GnfdReplicatePieceApprovalHeader = "X-Gnfd-Replicate-Piece-Approval-Msg" // GnfdReceiveMsgHeader defines receive piece data meta GnfdReceiveMsgHeader = "X-Gnfd-Receive-Msg" // GnfdIntegrityHashHeader defines integrity hash, which is used by challenge and receiver GnfdIntegrityHashHeader = "X-Gnfd-Integrity-Hash" // GnfdIntegrityHashSignatureHeader defines integrity hash signature, which is used by receiver GnfdIntegrityHashSignatureHeader = "X-Gnfd-Integrity-Hash-Signature" // RecoveryObjectPiecePath defines recovery-object path style RecoveryObjectPiecePath = "/greenfield/recovery/v1/get-piece" // GnfdRecoveryMsgHeader defines receive piece data meta GnfdRecoveryMsgHeader = "X-Gnfd-Recovery-Msg" // MigratePiecePath defines migrate piece path which is used in SP exiting case MigratePiecePath = "/greenfield/migrate/v1/migrate-piece" // GnfdMigratePieceMsgHeader defines migrate piece msg header GnfdMigratePieceMsgHeader = "X-Gnfd-Migrate-Piece-Msg" // NotifyMigrateSwapOutTaskPath defines dispatch migrate gvg task from src sp to dest sp. NotifyMigrateSwapOutTaskPath = "/greenfield/migrate/v1/notify-migrate-swap-out-task" // GnfdMigrateSwapOutMsgHeader defines migrate swap out msg header GnfdMigrateSwapOutMsgHeader = "X-Gnfd-Migrate-Swap-Out-Msg" // SecondarySPMigrationBucketApprovalPath defines secondary sp sign migration bucket approval SecondarySPMigrationBucketApprovalPath = "/greenfield/migrate/v1/migration-bucket-approval" // SwapOutApprovalPath defines get swap out approval path SwapOutApprovalPath = "/greenfield/migrate/v1/get-swap-out-approval" // GnfdSecondarySPMigrationBucketMsgHeader defines secondary sp migration bucket sign doc header. GnfdSecondarySPMigrationBucketMsgHeader = "X-Gnfd-Secondary-Migration-Bucket-Msg" // GnfdSecondarySPMigrationBucketApprovalHeader defines secondary sp migration bucket bls approval header. GnfdSecondarySPMigrationBucketApprovalHeader = "X-Gnfd-Secondary-Migration-Bucket-Approval" // GnfdUnsignedApprovalMsgHeader defines unsigned msg, which is used by get-approval GnfdUnsignedApprovalMsgHeader = "X-Gnfd-Unsigned-Msg" // GnfdSignedApprovalMsgHeader defines signed msg, which is used by get-approval GnfdSignedApprovalMsgHeader = "X-Gnfd-Signed-Msg" )
spilt server and client const definition avoids circular references TODO:: extract the common parts of http to the gfsp app layer
Variables ¶
var ( ErrRPCUnknown = gfsperrors.Register(ClientCodeSpace, http.StatusNotFound, 98001, "server slipped away, try again later") ErrExceptionsStream = gfsperrors.Register(ClientCodeSpace, http.StatusBadRequest, 98002, "stream closed abnormally") ErrTypeMismatch = gfsperrors.Register(ClientCodeSpace, http.StatusBadRequest, 98101, "response type mismatch") ErrNoSuchObject = gfsperrors.Register(ClientCodeSpace, http.StatusBadRequest, 98093, "no such object from metadata") )
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []grpc.DialOption
Types ¶
type ApproverAPI ¶ added in v0.2.4
type ApproverAPI interface { AskCreateBucketApproval(ctx context.Context, t coretask.ApprovalCreateBucketTask) (bool, coretask.ApprovalCreateBucketTask, error) AskMigrateBucketApproval(ctx context.Context, t coretask.ApprovalMigrateBucketTask) (bool, coretask.ApprovalMigrateBucketTask, error) AskCreateObjectApproval(ctx context.Context, t coretask.ApprovalCreateObjectTask) (bool, coretask.ApprovalCreateObjectTask, error) }
ApproverAPI for mock use
type AuthenticatorAPI ¶ added in v0.2.4
type AuthenticatorAPI interface { VerifyAuthentication(ctx context.Context, auth coremodule.AuthOpType, account, bucket, object string) (bool, error) GetAuthNonce(ctx context.Context, account string, domain string, opts ...grpc.CallOption) (currentNonce int32, nextNonce int32, currentPublicKey string, expiryDate int64, err error) UpdateUserPublicKey(ctx context.Context, account string, domain string, currentNonce int32, nonce int32, userPublicKey string, expiryDate int64, opts ...grpc.CallOption) (bool, error) VerifyGNFD1EddsaSignature(ctx context.Context, account string, domain string, offChainSig string, realMsgToSign []byte, opts ...grpc.CallOption) (bool, error) }
AuthenticatorAPI for mock use
type DownloaderAPI ¶ added in v0.2.4
type DownloaderAPI interface { GetObject(ctx context.Context, downloadObjectTask coretask.DownloadObjectTask, opts ...grpc.DialOption) ([]byte, error) GetPiece(ctx context.Context, downloadPieceTask coretask.DownloadPieceTask, opts ...grpc.DialOption) ([]byte, error) GetChallengeInfo(ctx context.Context, challengePieceTask coretask.ChallengePieceTask, opts ...grpc.DialOption) ([]byte, [][]byte, []byte, error) }
DownloaderAPI for mock use
type GaterAPI ¶ added in v0.2.4
type GaterAPI interface { ReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask, data []byte) error GetPieceFromECChunks(ctx context.Context, endpoint string, task coretask.RecoveryPieceTask) (io.ReadCloser, error) DoneReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask) ([]byte, error) MigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error) NotifyDestSPMigrateSwapOut(ctx context.Context, destEndpoint string, swapOut *virtualgrouptypes.MsgSwapOut) error GetSecondarySPMigrationBucketApproval(ctx context.Context, secondarySPEndpoint string, signDoc *storagetypes.SecondarySpMigrationBucketSignDoc) ([]byte, error) GetSwapOutApproval(ctx context.Context, destSPEndpoint string, swapOutApproval *virtualgrouptypes.MsgSwapOut) (*virtualgrouptypes.MsgSwapOut, error) }
GaterAPI for mock use
type GfSpClient ¶
type GfSpClient struct {
// contains filtered or unexported fields
}
func NewGfSpClient ¶
func (*GfSpClient) ApproverConn ¶
func (s *GfSpClient) ApproverConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GfSpClient) AskCreateBucketApproval ¶
func (s *GfSpClient) AskCreateBucketApproval(ctx context.Context, task coretask.ApprovalCreateBucketTask) ( bool, coretask.ApprovalCreateBucketTask, error)
func (*GfSpClient) AskCreateObjectApproval ¶
func (s *GfSpClient) AskCreateObjectApproval(ctx context.Context, task coretask.ApprovalCreateObjectTask) ( bool, coretask.ApprovalCreateObjectTask, error)
func (*GfSpClient) AskMigrateBucketApproval ¶ added in v0.2.3
func (s *GfSpClient) AskMigrateBucketApproval(ctx context.Context, task coretask.ApprovalMigrateBucketTask) ( bool, coretask.ApprovalMigrateBucketTask, error)
func (*GfSpClient) AskSecondaryReplicatePieceApproval ¶
func (s *GfSpClient) AskSecondaryReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask, low, high int, timeout int64) ([]*gfsptask.GfSpReplicatePieceApprovalTask, error)
func (*GfSpClient) Close ¶
func (s *GfSpClient) Close() error
func (*GfSpClient) CompleteMigrateBucket ¶ added in v0.2.3
func (s *GfSpClient) CompleteMigrateBucket(ctx context.Context, migrateBucket *storagetypes.MsgCompleteMigrateBucket) (string, error)
func (*GfSpClient) CompleteSPExit ¶ added in v0.2.3
func (s *GfSpClient) CompleteSPExit(ctx context.Context, completeSPExit *virtualgrouptypes.MsgCompleteStorageProviderExit) (string, error)
func (*GfSpClient) CompleteSwapOut ¶ added in v0.2.3
func (s *GfSpClient) CompleteSwapOut(ctx context.Context, completeSwapOut *virtualgrouptypes.MsgCompleteSwapOut) (string, error)
func (*GfSpClient) Connection ¶
func (s *GfSpClient) Connection(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GfSpClient) CreateGlobalVirtualGroup ¶ added in v0.2.3
func (s *GfSpClient) CreateGlobalVirtualGroup(ctx context.Context, group *gfspserver.GfSpCreateGlobalVirtualGroup) error
func (*GfSpClient) CreateResumableUploadObject ¶ added in v0.2.3
func (s *GfSpClient) CreateResumableUploadObject(ctx context.Context, task coretask.ResumableUploadObjectTask) error
func (*GfSpClient) CreateUploadObject ¶
func (s *GfSpClient) CreateUploadObject(ctx context.Context, task coretask.UploadObjectTask) error
func (*GfSpClient) DiscontinueBucket ¶
func (s *GfSpClient) DiscontinueBucket(ctx context.Context, bucket *storagetypes.MsgDiscontinueBucket) (string, error)
func (*GfSpClient) DoneReplicatePiece ¶
func (s *GfSpClient) DoneReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, opts ...grpc.DialOption) ( []byte, []byte, error)
func (*GfSpClient) DoneReplicatePieceToSecondary ¶
func (s *GfSpClient) DoneReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask) ([]byte, error)
func (*GfSpClient) GetAuthNonce ¶
func (s *GfSpClient) GetAuthNonce(ctx context.Context, account string, domain string, opts ...grpc.CallOption) (currentNonce int32, nextNonce int32, currentPublicKey string, expiryDate int64, err error)
GetAuthNonce get the auth nonce for which the Dapp or client can generate EDDSA key pairs.
func (*GfSpClient) GetBucketByBucketID ¶
func (s *GfSpClient) GetBucketByBucketID(ctx context.Context, bucketID int64, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, error)
GetBucketByBucketID get bucket info by a bucket id
func (*GfSpClient) GetBucketByBucketName ¶
func (s *GfSpClient) GetBucketByBucketName(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, error)
GetBucketByBucketName get bucket info by a bucket name
func (*GfSpClient) GetBucketMeta ¶
func (s *GfSpClient) GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, *payment_types.StreamRecord, error)
GetBucketMeta get bucket info along with its related info such as payment
func (*GfSpClient) GetBucketReadQuota ¶
func (s *GfSpClient) GetBucketReadQuota(ctx context.Context, bucket *storage_types.BucketInfo, opts ...grpc.DialOption) ( uint64, uint64, uint64, error)
func (*GfSpClient) GetChallengeInfo ¶
func (s *GfSpClient) GetChallengeInfo(ctx context.Context, challengePieceTask coretask.ChallengePieceTask, opts ...grpc.DialOption) ( []byte, [][]byte, []byte, error)
func (*GfSpClient) GetEndpointBySpID ¶ added in v0.2.4
func (s *GfSpClient) GetEndpointBySpID(ctx context.Context, spId uint32, opts ...grpc.DialOption) (string, error)
GetEndpointBySpID get endpoint by sp id
func (*GfSpClient) GetGlobalVirtualGroup ¶ added in v0.2.3
func (s *GfSpClient) GetGlobalVirtualGroup(ctx context.Context, bucketID uint64, lvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error)
func (*GfSpClient) GetGlobalVirtualGroupByGvgID ¶ added in v0.2.3
func (s *GfSpClient) GetGlobalVirtualGroupByGvgID(ctx context.Context, gvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error)
func (*GfSpClient) GetGroupList ¶
func (*GfSpClient) GetGroupMembers ¶ added in v0.2.4
func (s *GfSpClient) GetGroupMembers(ctx context.Context, groupID uint64, startAfter string, limit uint32, opts ...grpc.DialOption) ([]*types.GroupMember, error)
func (*GfSpClient) GetObject ¶
func (s *GfSpClient) GetObject(ctx context.Context, downloadObjectTask coretask.DownloadObjectTask, opts ...grpc.DialOption) ( []byte, error)
func (*GfSpClient) GetObjectByID ¶ added in v0.2.3
func (s *GfSpClient) GetObjectByID(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (*storage_types.ObjectInfo, error)
func (*GfSpClient) GetObjectMeta ¶
func (s *GfSpClient) GetObjectMeta(ctx context.Context, objectName string, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Object, error)
GetObjectMeta get object metadata
func (*GfSpClient) GetPaymentByBucketID ¶
func (s *GfSpClient) GetPaymentByBucketID(ctx context.Context, bucketID int64, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error)
GetPaymentByBucketID get bucket payment info by a bucket id
func (*GfSpClient) GetPaymentByBucketName ¶
func (s *GfSpClient) GetPaymentByBucketName(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error)
GetPaymentByBucketName get bucket payment info by a bucket name
func (*GfSpClient) GetPiece ¶
func (s *GfSpClient) GetPiece(ctx context.Context, downloadPieceTask coretask.DownloadPieceTask, opts ...grpc.DialOption) ( []byte, error)
func (*GfSpClient) GetPieceFromECChunks ¶ added in v0.2.3
func (s *GfSpClient) GetPieceFromECChunks(ctx context.Context, endpoint string, task coretask.RecoveryPieceTask) (io.ReadCloser, error)
func (*GfSpClient) GetSPInfo ¶ added in v0.2.3
func (s *GfSpClient) GetSPInfo(ctx context.Context, operatorAddress string, opts ...grpc.DialOption) (*sptypes.StorageProvider, error)
func (*GfSpClient) GetSecondarySPMigrationBucketApproval ¶ added in v0.2.3
func (s *GfSpClient) GetSecondarySPMigrationBucketApproval(ctx context.Context, secondarySPEndpoint string, signDoc *storagetypes.SecondarySpMigrationBucketSignDoc) ([]byte, error)
func (*GfSpClient) GetStatus ¶ added in v0.2.4
func (s *GfSpClient) GetStatus(ctx context.Context, opts ...grpc.DialOption) (*types.Status, error)
func (*GfSpClient) GetSwapOutApproval ¶ added in v0.2.3
func (s *GfSpClient) GetSwapOutApproval(ctx context.Context, destSPEndpoint string, swapOutApproval *virtualgrouptypes.MsgSwapOut) ( *virtualgrouptypes.MsgSwapOut, error)
func (*GfSpClient) GetUploadObjectSegment ¶ added in v0.2.3
func (s *GfSpClient) GetUploadObjectSegment(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (uint32, error)
func (*GfSpClient) GetUploadObjectState ¶
func (s *GfSpClient) GetUploadObjectState(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (int32, string, error)
func (*GfSpClient) GetUserBuckets ¶
func (s *GfSpClient) GetUserBuckets(ctx context.Context, account string, includeRemoved bool, opts ...grpc.DialOption) ([]*types.Bucket, error)
func (*GfSpClient) GetUserBucketsCount ¶
func (s *GfSpClient) GetUserBucketsCount(ctx context.Context, account string, includeRemoved bool, opts ...grpc.DialOption) (int64, error)
func (*GfSpClient) GetUserGroups ¶ added in v0.2.4
func (s *GfSpClient) GetUserGroups(ctx context.Context, accountID string, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.GroupMember, error)
func (*GfSpClient) GetVirtualGroupFamily ¶ added in v0.2.3
func (s *GfSpClient) GetVirtualGroupFamily(ctx context.Context, vgfID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroupFamily, error)
func (*GfSpClient) HTTPClient ¶
func (s *GfSpClient) HTTPClient(ctx context.Context) *http.Client
func (*GfSpClient) ListBucketReadRecord ¶
func (s *GfSpClient) ListBucketReadRecord(ctx context.Context, bucket *storage_types.BucketInfo, startTimestampUs, endTimestampUs, maxRecordNum int64, opts ...grpc.DialOption) ([]*types.ReadRecord, int64, error)
func (*GfSpClient) ListBucketsByBucketID ¶
func (*GfSpClient) ListDeletedObjectsByBlockNumberRange ¶
func (*GfSpClient) ListExpiredBucketsBySp ¶
func (s *GfSpClient) ListExpiredBucketsBySp(ctx context.Context, createAt int64, primarySpID uint32, limit int64, opts ...grpc.DialOption) ([]*types.Bucket, error)
ListExpiredBucketsBySp list buckets that are expired by specific sp
func (*GfSpClient) ListGlobalVirtualGroupsByBucket ¶ added in v0.2.3
func (s *GfSpClient) ListGlobalVirtualGroupsByBucket(ctx context.Context, bucketID uint64, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error)
func (*GfSpClient) ListGlobalVirtualGroupsBySecondarySP ¶ added in v0.2.3
func (s *GfSpClient) ListGlobalVirtualGroupsBySecondarySP(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error)
func (*GfSpClient) ListMigrateBucketEvents ¶ added in v0.2.3
func (s *GfSpClient) ListMigrateBucketEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListMigrateBucketEvents, error)
func (*GfSpClient) ListObjectsByBucketName ¶
func (s *GfSpClient) ListObjectsByBucketName(ctx context.Context, bucketName string, accountId string, maxKeys uint64, startAfter string, continuationToken string, delimiter string, prefix string, includeRemoved bool, opts ...grpc.DialOption) ( objects []*types.Object, KeyCount uint64, MaxKeys uint64, IsTruncated bool, NextContinuationToken string, Name string, Prefix string, Delimiter string, CommonPrefixes []string, ContinuationToken string, err error)
ListObjectsByBucketName list objects info by a bucket name
func (*GfSpClient) ListObjectsByGVGAndBucketForGC ¶ added in v0.2.3
func (s *GfSpClient) ListObjectsByGVGAndBucketForGC(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error)
func (*GfSpClient) ListObjectsByObjectID ¶
func (*GfSpClient) ListObjectsInGVG ¶ added in v0.2.3
func (s *GfSpClient) ListObjectsInGVG(ctx context.Context, gvgID uint32, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error)
func (*GfSpClient) ListObjectsInGVGAndBucket ¶ added in v0.2.3
func (s *GfSpClient) ListObjectsInGVGAndBucket(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error)
func (*GfSpClient) ListSpExitEvents ¶ added in v0.2.3
func (s *GfSpClient) ListSpExitEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) (*types.ListSpExitEvents, error)
func (*GfSpClient) ListSwapOutEvents ¶ added in v0.2.3
func (s *GfSpClient) ListSwapOutEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListSwapOutEvents, error)
func (*GfSpClient) ListVirtualGroupFamiliesSpID ¶ added in v0.2.3
func (s *GfSpClient) ListVirtualGroupFamiliesSpID(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroupFamily, error)
func (*GfSpClient) ManagerConn ¶
func (s *GfSpClient) ManagerConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GfSpClient) MigratePiece ¶ added in v0.2.3
func (s *GfSpClient) MigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error)
func (*GfSpClient) NotifyDestSPMigrateSwapOut ¶ added in v0.2.3
func (s *GfSpClient) NotifyDestSPMigrateSwapOut(ctx context.Context, destEndpoint string, swapOut *virtualgrouptypes.MsgSwapOut) error
NotifyDestSPMigrateSwapOut is used to notify dest sp start migrate swap out task.
func (*GfSpClient) NotifyMigrateSwapOut ¶ added in v0.2.3
func (s *GfSpClient) NotifyMigrateSwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) error
func (*GfSpClient) P2PConn ¶
func (s *GfSpClient) P2PConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GfSpClient) PickVirtualGroupFamilyID ¶ added in v0.2.3
func (s *GfSpClient) PickVirtualGroupFamilyID(ctx context.Context, task coretask.ApprovalCreateBucketTask) (uint32, error)
func (*GfSpClient) QueryBucketMigrate ¶ added in v0.2.3
func (*GfSpClient) QueryP2PBootstrap ¶
func (s *GfSpClient) QueryP2PBootstrap(ctx context.Context) ([]string, error)
func (*GfSpClient) QuerySPExit ¶ added in v0.2.3
func (*GfSpClient) QueryTasks ¶
func (*GfSpClient) RejectUnSealObject ¶
func (s *GfSpClient) RejectUnSealObject(ctx context.Context, object *storagetypes.MsgRejectSealObject) (string, error)
func (*GfSpClient) ReplicatePiece ¶
func (s *GfSpClient) ReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, data []byte, opts ...grpc.DialOption) error
func (*GfSpClient) ReplicatePieceToSecondary ¶
func (s *GfSpClient) ReplicatePieceToSecondary(ctx context.Context, endpoint string, receive coretask.ReceivePieceTask, data []byte) error
func (*GfSpClient) ReportTask ¶
func (*GfSpClient) ResumableUploadObject ¶ added in v0.2.3
func (s *GfSpClient) ResumableUploadObject(ctx context.Context, task coretask.ResumableUploadObjectTask, stream io.Reader) error
func (*GfSpClient) SPExit ¶ added in v0.2.3
func (s *GfSpClient) SPExit(ctx context.Context, spExit *virtualgrouptypes.MsgStorageProviderExit) (string, error)
func (*GfSpClient) SealObject ¶
func (s *GfSpClient) SealObject(ctx context.Context, object *storagetypes.MsgSealObject) (string, error)
func (*GfSpClient) SignCreateBucketApproval ¶
func (s *GfSpClient) SignCreateBucketApproval(ctx context.Context, bucket *storagetypes.MsgCreateBucket) ( []byte, error)
func (*GfSpClient) SignCreateObjectApproval ¶
func (s *GfSpClient) SignCreateObjectApproval(ctx context.Context, object *storagetypes.MsgCreateObject) ([]byte, error)
func (*GfSpClient) SignMigrateBucketApproval ¶ added in v0.2.3
func (s *GfSpClient) SignMigrateBucketApproval(ctx context.Context, bucket *storagetypes.MsgMigrateBucket) ( []byte, error)
func (*GfSpClient) SignMigratePiece ¶ added in v0.2.3
func (s *GfSpClient) SignMigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error)
func (*GfSpClient) SignP2PPingMsg ¶
func (*GfSpClient) SignP2PPongMsg ¶
func (*GfSpClient) SignReceiveTask ¶
func (s *GfSpClient) SignReceiveTask(ctx context.Context, receiveTask coretask.ReceivePieceTask) ([]byte, error)
func (*GfSpClient) SignRecoveryTask ¶ added in v0.2.3
func (s *GfSpClient) SignRecoveryTask(ctx context.Context, recoveryTask coretask.RecoveryPieceTask) ([]byte, error)
func (*GfSpClient) SignReplicatePieceApproval ¶
func (s *GfSpClient) SignReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask) ([]byte, error)
func (*GfSpClient) SignSecondarySPMigrationBucket ¶ added in v0.2.3
func (s *GfSpClient) SignSecondarySPMigrationBucket(ctx context.Context, signDoc *storagetypes.SecondarySpMigrationBucketSignDoc) ([]byte, error)
func (*GfSpClient) SignSecondarySealBls ¶ added in v0.2.3
func (*GfSpClient) SignSwapOut ¶ added in v0.2.3
func (s *GfSpClient) SignSwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) ([]byte, error)
func (*GfSpClient) SignerConn ¶
func (s *GfSpClient) SignerConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GfSpClient) SwapOut ¶ added in v0.2.3
func (s *GfSpClient) SwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) (string, error)
func (*GfSpClient) UpdateSPPrice ¶ added in v0.2.3
func (s *GfSpClient) UpdateSPPrice(ctx context.Context, price *sptypes.MsgUpdateSpStoragePrice) (string, error)
func (*GfSpClient) UpdateUserPublicKey ¶
func (s *GfSpClient) UpdateUserPublicKey(ctx context.Context, account string, domain string, currentNonce int32, nonce int32, userPublicKey string, expiryDate int64, opts ...grpc.CallOption) (bool, error)
UpdateUserPublicKey updates the user public key once the Dapp or client generates the EDDSA key pairs.
func (*GfSpClient) UploadObject ¶
func (s *GfSpClient) UploadObject(ctx context.Context, task coretask.UploadObjectTask, stream io.Reader) error
func (*GfSpClient) VerifyAuthentication ¶
func (s *GfSpClient) VerifyAuthentication(ctx context.Context, auth coremodule.AuthOpType, account, bucket, object string) (bool, error)
func (*GfSpClient) VerifyGNFD1EddsaSignature ¶ added in v0.2.4
func (s *GfSpClient) VerifyGNFD1EddsaSignature(ctx context.Context, account string, domain string, offChainSig string, realMsgToSign []byte, opts ...grpc.CallOption) (bool, error)
VerifyGNFD1EddsaSignature verifies the signature signed by user's EDDSA private key.
func (*GfSpClient) VerifyPermission ¶
func (s *GfSpClient) VerifyPermission(ctx context.Context, Operator string, bucketName string, objectName string, actionType permission_types.ActionType, opts ...grpc.DialOption) (*permission_types.Effect, error)
VerifyPermission Verify the input account’s permission to input items
func (*GfSpClient) VerifyPermissionByID ¶ added in v0.2.3
func (s *GfSpClient) VerifyPermissionByID(ctx context.Context, Operator string, resourceType resource.ResourceType, resourceID uint64, actionType permission_types.ActionType, opts ...grpc.DialOption) (*permission_types.Effect, error)
VerifyPermissionByID Verify the input account’s permission to input source type and resource id
type GfSpClientAPI ¶ added in v0.2.4
type GfSpClientAPI interface { ApproverAPI AuthenticatorAPI DownloaderAPI GaterAPI ManagerAPI MetadataAPI P2PAPI QueryAPI ReceiverAPI SignerAPI UploaderAPI Close() error }
GfSpClientAPI for mock use
type ManagerAPI ¶ added in v0.2.4
type ManagerAPI interface { CreateUploadObject(ctx context.Context, task coretask.UploadObjectTask) error CreateResumableUploadObject(ctx context.Context, task coretask.ResumableUploadObjectTask) error AskTask(ctx context.Context, limit corercmgr.Limit) (coretask.Task, error) ReportTask(ctx context.Context, report coretask.Task) error PickVirtualGroupFamilyID(ctx context.Context, task coretask.ApprovalCreateBucketTask) (uint32, error) }
ManagerAPI for mock use
type MetadataAPI ¶ added in v0.2.4
type MetadataAPI interface { GetUserBucketsCount(ctx context.Context, account string, includeRemoved bool, opts ...grpc.DialOption) (int64, error) ListDeletedObjectsByBlockNumberRange(ctx context.Context, spOperatorAddress string, startBlockNumber uint64, endBlockNumber uint64, includePrivate bool, opts ...grpc.DialOption) ([]*types.Object, uint64, error) GetUserBuckets(ctx context.Context, account string, includeRemoved bool, opts ...grpc.DialOption) ([]*types.Bucket, error) ListObjectsByBucketName(ctx context.Context, bucketName string, accountId string, maxKeys uint64, startAfter string, continuationToken string, delimiter string, prefix string, includeRemoved bool, opts ...grpc.DialOption) ( objects []*types.Object, KeyCount uint64, MaxKeys uint64, IsTruncated bool, NextContinuationToken string, Name string, Prefix string, Delimiter string, CommonPrefixes []string, ContinuationToken string, err error) GetBucketByBucketName(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, error) GetBucketByBucketID(ctx context.Context, bucketID int64, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, error) ListExpiredBucketsBySp(ctx context.Context, createAt int64, primarySpID uint32, limit int64, opts ...grpc.DialOption) ([]*types.Bucket, error) GetObjectMeta(ctx context.Context, objectName string, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Object, error) GetPaymentByBucketName(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error) GetPaymentByBucketID(ctx context.Context, bucketID int64, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error) VerifyPermission(ctx context.Context, Operator string, bucketName string, objectName string, actionType permission_types.ActionType, opts ...grpc.DialOption) (*permission_types.Effect, error) GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, *payment_types.StreamRecord, error) GetEndpointBySpID(ctx context.Context, spID uint32, opts ...grpc.DialOption) (string, error) GetBucketReadQuota(ctx context.Context, bucket *storage_types.BucketInfo, opts ...grpc.DialOption) (uint64, uint64, uint64, error) ListBucketReadRecord(ctx context.Context, bucket *storage_types.BucketInfo, startTimestampUs, endTimestampUs, maxRecordNum int64, opts ...grpc.DialOption) ([]*types.ReadRecord, int64, error) GetUploadObjectState(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (int32, string, error) GetUploadObjectSegment(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (uint32, error) GetGroupList(ctx context.Context, name string, prefix string, sourceType string, limit int64, offset int64, includeRemoved bool, opts ...grpc.DialOption) ([]*types.Group, int64, error) ListBucketsByBucketID(ctx context.Context, bucketIDs []uint64, includeRemoved bool, opts ...grpc.DialOption) (map[uint64]*types.Bucket, error) ListObjectsByObjectID(ctx context.Context, objectIDs []uint64, includeRemoved bool, opts ...grpc.DialOption) (map[uint64]*types.Object, error) ListVirtualGroupFamiliesSpID(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroupFamily, error) GetGlobalVirtualGroupByGvgID(ctx context.Context, gvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error) ListObjectsInGVGAndBucket(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error) ListObjectsInGVG(ctx context.Context, gvgID uint32, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error) ListObjectsByGVGAndBucketForGC(ctx context.Context, gvgID uint32, bucketID uint64, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.ObjectDetails, error) GetVirtualGroupFamily(ctx context.Context, vgfID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroupFamily, error) GetGlobalVirtualGroup(ctx context.Context, bucketID uint64, lvgID uint32, opts ...grpc.DialOption) (*virtual_types.GlobalVirtualGroup, error) ListGlobalVirtualGroupsByBucket(ctx context.Context, bucketID uint64, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error) ListGlobalVirtualGroupsBySecondarySP(ctx context.Context, spID uint32, opts ...grpc.DialOption) ([]*virtual_types.GlobalVirtualGroup, error) ListMigrateBucketEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListMigrateBucketEvents, error) ListSwapOutEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) ([]*types.ListSwapOutEvents, error) ListSpExitEvents(ctx context.Context, blockID uint64, spID uint32, opts ...grpc.DialOption) (*types.ListSpExitEvents, error) GetObjectByID(ctx context.Context, objectID uint64, opts ...grpc.DialOption) (*storage_types.ObjectInfo, error) VerifyPermissionByID(ctx context.Context, Operator string, resourceType resource.ResourceType, resourceID uint64, actionType permission_types.ActionType, opts ...grpc.DialOption) (*permission_types.Effect, error) GetSPInfo(ctx context.Context, operatorAddress string, opts ...grpc.DialOption) (*sptypes.StorageProvider, error) GetUserGroups(ctx context.Context, accountID string, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.GroupMember, error) GetGroupMembers(ctx context.Context, groupID uint64, startAfter string, limit uint32, opts ...grpc.DialOption) ([]*types.GroupMember, error) }
MetadataAPI for mock sue
type MockApproverAPI ¶ added in v0.2.4
type MockApproverAPI struct {
// contains filtered or unexported fields
}
MockApproverAPI is a mock of ApproverAPI interface.
func NewMockApproverAPI ¶ added in v0.2.4
func NewMockApproverAPI(ctrl *gomock.Controller) *MockApproverAPI
NewMockApproverAPI creates a new mock instance.
func (*MockApproverAPI) AskCreateBucketApproval ¶ added in v0.2.4
func (m *MockApproverAPI) AskCreateBucketApproval(ctx context.Context, t task.ApprovalCreateBucketTask) (bool, task.ApprovalCreateBucketTask, error)
AskCreateBucketApproval mocks base method.
func (*MockApproverAPI) AskCreateObjectApproval ¶ added in v0.2.4
func (m *MockApproverAPI) AskCreateObjectApproval(ctx context.Context, t task.ApprovalCreateObjectTask) (bool, task.ApprovalCreateObjectTask, error)
AskCreateObjectApproval mocks base method.
func (*MockApproverAPI) AskMigrateBucketApproval ¶ added in v0.2.4
func (m *MockApproverAPI) AskMigrateBucketApproval(ctx context.Context, t task.ApprovalMigrateBucketTask) (bool, task.ApprovalMigrateBucketTask, error)
AskMigrateBucketApproval mocks base method.
func (*MockApproverAPI) EXPECT ¶ added in v0.2.4
func (m *MockApproverAPI) EXPECT() *MockApproverAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockApproverAPIMockRecorder ¶ added in v0.2.4
type MockApproverAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockApproverAPIMockRecorder is the mock recorder for MockApproverAPI.
func (*MockApproverAPIMockRecorder) AskCreateBucketApproval ¶ added in v0.2.4
func (mr *MockApproverAPIMockRecorder) AskCreateBucketApproval(ctx, t interface{}) *gomock.Call
AskCreateBucketApproval indicates an expected call of AskCreateBucketApproval.
func (*MockApproverAPIMockRecorder) AskCreateObjectApproval ¶ added in v0.2.4
func (mr *MockApproverAPIMockRecorder) AskCreateObjectApproval(ctx, t interface{}) *gomock.Call
AskCreateObjectApproval indicates an expected call of AskCreateObjectApproval.
func (*MockApproverAPIMockRecorder) AskMigrateBucketApproval ¶ added in v0.2.4
func (mr *MockApproverAPIMockRecorder) AskMigrateBucketApproval(ctx, t interface{}) *gomock.Call
AskMigrateBucketApproval indicates an expected call of AskMigrateBucketApproval.
type P2PAPI ¶ added in v0.2.4
type P2PAPI interface { AskSecondaryReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask, low, high int, timeout int64) ([]*gfsptask.GfSpReplicatePieceApprovalTask, error) QueryP2PBootstrap(ctx context.Context) ([]string, error) }
P2PAPI for mock use
type QueryAPI ¶ added in v0.2.4
type QueryAPI interface { QueryTasks(ctx context.Context, endpoint string, subKey string) ([]string, error) QueryBucketMigrate(ctx context.Context, endpoint string) (string, error) QuerySPExit(ctx context.Context, endpoint string) (string, error) }
QueryAPI for mock use
type ReceiverAPI ¶ added in v0.2.4
type ReceiverAPI interface { ReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, data []byte, opts ...grpc.DialOption) error DoneReplicatePiece(ctx context.Context, task coretask.ReceivePieceTask, opts ...grpc.DialOption) ([]byte, []byte, error) }
ReceiverAPI for mock use
type SignerAPI ¶ added in v0.2.4
type SignerAPI interface { SignCreateBucketApproval(ctx context.Context, bucket *storagetypes.MsgCreateBucket) ([]byte, error) SignMigrateBucketApproval(ctx context.Context, bucket *storagetypes.MsgMigrateBucket) ([]byte, error) SignCreateObjectApproval(ctx context.Context, object *storagetypes.MsgCreateObject) ([]byte, error) SealObject(ctx context.Context, object *storagetypes.MsgSealObject) (string, error) UpdateSPPrice(ctx context.Context, price *sptypes.MsgUpdateSpStoragePrice) (string, error) CreateGlobalVirtualGroup(ctx context.Context, group *gfspserver.GfSpCreateGlobalVirtualGroup) error RejectUnSealObject(ctx context.Context, object *storagetypes.MsgRejectSealObject) (string, error) DiscontinueBucket(ctx context.Context, bucket *storagetypes.MsgDiscontinueBucket) (string, error) SignReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask) ([]byte, error) SignSecondarySealBls(ctx context.Context, objectID uint64, gvgId uint32, checksums [][]byte) ([]byte, error) SignReceiveTask(ctx context.Context, receiveTask coretask.ReceivePieceTask) ([]byte, error) SignRecoveryTask(ctx context.Context, recoveryTask coretask.RecoveryPieceTask) ([]byte, error) SignP2PPingMsg(ctx context.Context, ping *gfspp2p.GfSpPing) ([]byte, error) SignP2PPongMsg(ctx context.Context, pong *gfspp2p.GfSpPong) ([]byte, error) SignMigratePiece(ctx context.Context, task *gfsptask.GfSpMigratePieceTask) ([]byte, error) CompleteMigrateBucket(ctx context.Context, migrateBucket *storagetypes.MsgCompleteMigrateBucket) (string, error) SignSecondarySPMigrationBucket(ctx context.Context, signDoc *storagetypes.SecondarySpMigrationBucketSignDoc) ([]byte, error) SignSwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) ([]byte, error) SwapOut(ctx context.Context, swapOut *virtualgrouptypes.MsgSwapOut) (string, error) CompleteSwapOut(ctx context.Context, completeSwapOut *virtualgrouptypes.MsgCompleteSwapOut) (string, error) SPExit(ctx context.Context, spExit *virtualgrouptypes.MsgStorageProviderExit) (string, error) CompleteSPExit(ctx context.Context, completeSPExit *virtualgrouptypes.MsgCompleteStorageProviderExit) (string, error) }
SignerAPI for mock use