Documentation ¶
Overview ¶
Package piece is a generated GoMock package.
Index ¶
- type MockPieceAPI
- func (m *MockPieceAPI) Delete(ctx context.Context, key string) error
- func (m *MockPieceAPI) DeleteByPrefix(ctx context.Context, key string) (uint64, error)
- func (m *MockPieceAPI) EXPECT() *MockPieceAPIMockRecorder
- func (m *MockPieceAPI) Get(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error)
- func (m *MockPieceAPI) Put(ctx context.Context, key string, reader io.Reader) error
- type MockPieceAPIMockRecorder
- func (mr *MockPieceAPIMockRecorder) Delete(ctx, key any) *gomock.Call
- func (mr *MockPieceAPIMockRecorder) DeleteByPrefix(ctx, key any) *gomock.Call
- func (mr *MockPieceAPIMockRecorder) Get(ctx, key, offset, limit any) *gomock.Call
- func (mr *MockPieceAPIMockRecorder) Put(ctx, key, reader any) *gomock.Call
- type PieceAPI
- type PieceStore
- func (p *PieceStore) Delete(ctx context.Context, key string) error
- func (p *PieceStore) DeleteByPrefix(ctx context.Context, key string) (uint64, error)
- func (p *PieceStore) Get(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error)
- func (p *PieceStore) Head(ctx context.Context, key string) (storage.Object, error)
- func (p *PieceStore) Put(ctx context.Context, key string, reader io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPieceAPI ¶ added in v0.2.4
type MockPieceAPI struct {
// contains filtered or unexported fields
}
MockPieceAPI is a mock of PieceAPI interface.
func NewMockPieceAPI ¶ added in v0.2.4
func NewMockPieceAPI(ctrl *gomock.Controller) *MockPieceAPI
NewMockPieceAPI creates a new mock instance.
func (*MockPieceAPI) Delete ¶ added in v0.2.4
func (m *MockPieceAPI) Delete(ctx context.Context, key string) error
Delete mocks base method.
func (*MockPieceAPI) DeleteByPrefix ¶ added in v1.10.0
DeleteByPrefix mocks base method.
func (*MockPieceAPI) EXPECT ¶ added in v0.2.4
func (m *MockPieceAPI) EXPECT() *MockPieceAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPieceAPI) Get ¶ added in v0.2.4
func (m *MockPieceAPI) Get(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error)
Get mocks base method.
type MockPieceAPIMockRecorder ¶ added in v0.2.4
type MockPieceAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockPieceAPIMockRecorder is the mock recorder for MockPieceAPI.
func (*MockPieceAPIMockRecorder) Delete ¶ added in v0.2.4
func (mr *MockPieceAPIMockRecorder) Delete(ctx, key any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockPieceAPIMockRecorder) DeleteByPrefix ¶ added in v1.10.0
func (mr *MockPieceAPIMockRecorder) DeleteByPrefix(ctx, key any) *gomock.Call
DeleteByPrefix indicates an expected call of DeleteByPrefix.
type PieceAPI ¶ added in v0.2.4
type PieceAPI interface { Get(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error) Put(ctx context.Context, key string, reader io.Reader) error Delete(ctx context.Context, key string) error DeleteByPrefix(ctx context.Context, key string) (uint64, error) }
PieceAPI for mock use
type PieceStore ¶
type PieceStore struct {
// contains filtered or unexported fields
}
func NewPieceStore ¶
func NewPieceStore(pieceConfig *storage.PieceStoreConfig) (*PieceStore, error)
NewPieceStore returns an instance of PieceStore
func (*PieceStore) Delete ¶
func (p *PieceStore) Delete(ctx context.Context, key string) error
Delete one piece in PieceStore
func (*PieceStore) DeleteByPrefix ¶ added in v1.10.0
DeleteByPrefix deletes several pieces in PieceStore and returns deleted size
func (*PieceStore) Get ¶
func (p *PieceStore) Get(ctx context.Context, key string, offset, limit int64) (io.ReadCloser, error)
Get one piece from PieceStore