Documentation ¶
Overview ¶
Package client is a generated GoMock package.
Index ¶
- Constants
- type MockPieceStoreAPI
- func (m *MockPieceStoreAPI) DeletePiece(ctx context.Context, key string) error
- func (m *MockPieceStoreAPI) EXPECT() *MockPieceStoreAPIMockRecorder
- func (m *MockPieceStoreAPI) GetPiece(ctx context.Context, key string, offset, limit int64) ([]byte, error)
- func (m *MockPieceStoreAPI) PutPiece(key string, value []byte) error
- type MockPieceStoreAPIMockRecorder
- type PieceStoreAPI
- type StoreClient
Constants ¶
View Source
const ( // PieceStoreSuccessPut defines the metrics label of successfully put piece data PieceStoreSuccessPut = "put_piece_store_success" // PieceStoreFailurePut defines the metrics label of unsuccessfully put piece data PieceStoreFailurePut = "put_piece_store_failure" // PieceStoreSuccessGet defines the metrics label of successfully get piece data PieceStoreSuccessGet = "get_piece_store_success" // PieceStoreFailureGet defines the metrics label of unsuccessfully get piece data PieceStoreFailureGet = "get_piece_store_failure" // PieceStoreSuccessDel defines the metrics label of successfully delete piece data PieceStoreSuccessDel = "del_piece_store_success" // PieceStoreFailureDel defines the metrics label of unsuccessfully delete piece data PieceStoreFailureDel = "del_piece_store_failure" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPieceStoreAPI ¶ added in v0.2.4
type MockPieceStoreAPI struct {
// contains filtered or unexported fields
}
MockPieceStoreAPI is a mock of PieceStoreAPI interface.
func NewMockPieceStoreAPI ¶ added in v0.2.4
func NewMockPieceStoreAPI(ctrl *gomock.Controller) *MockPieceStoreAPI
NewMockPieceStoreAPI creates a new mock instance.
func (*MockPieceStoreAPI) DeletePiece ¶ added in v0.2.4
func (m *MockPieceStoreAPI) DeletePiece(ctx context.Context, key string) error
DeletePiece mocks base method.
func (*MockPieceStoreAPI) EXPECT ¶ added in v0.2.4
func (m *MockPieceStoreAPI) EXPECT() *MockPieceStoreAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPieceStoreAPIMockRecorder ¶ added in v0.2.4
type MockPieceStoreAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockPieceStoreAPIMockRecorder is the mock recorder for MockPieceStoreAPI.
func (*MockPieceStoreAPIMockRecorder) DeletePiece ¶ added in v0.2.4
func (mr *MockPieceStoreAPIMockRecorder) DeletePiece(ctx, key any) *gomock.Call
DeletePiece indicates an expected call of DeletePiece.
type PieceStoreAPI ¶
type PieceStoreAPI interface { GetPiece(ctx context.Context, key string, offset, limit int64) ([]byte, error) PutPiece(key string, value []byte) error DeletePiece(ctx context.Context, key string) error }
PieceStoreAPI provides an interface to enable mocking the StoreClient's API operation. This makes unit test to test your code easier.
type StoreClient ¶
type StoreClient struct {
// contains filtered or unexported fields
}
func NewStoreClient ¶
func NewStoreClient(pieceConfig *storage.PieceStoreConfig) (*StoreClient, error)
func (*StoreClient) DeletePiece ¶ added in v0.2.0
func (client *StoreClient) DeletePiece(ctx context.Context, key string) error
DeletePiece deletes piece from piece store.
Click to show internal directories.
Click to hide internal directories.