Documentation
¶
Overview ¶
Package chunk is a generated GoMock package.
Index ¶
- Variables
- func ShouldSkipFile(data []byte) bool
- type Chunk
- func (c *Chunk) GetBuf(data []byte) (*bytes.Buffer, bool)
- func (c *Chunk) GetFileThreshold() int64
- func (c *Chunk) GetMaxPeekSize() int
- func (c *Chunk) GetPeekedBuf() (*[]byte, bool)
- func (c *Chunk) GetSize() int
- func (c *Chunk) PutBuf(window *bytes.Buffer)
- func (c *Chunk) PutPeekedBuf(b *[]byte)
- func (c *Chunk) ReadChunk(reader *bufio.Reader, totalLines int) (string, error)
- type IChunk
- type MockIChunk
- type MockIChunkMockRecorder
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedFileType = errors.New("unsupported file type")
Functions ¶
func ShouldSkipFile ¶
ShouldSkipFile checks if the file should be skipped based on its content type
Types ¶
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
Chunk holds two pools and sizing parameters needed for reading chunks of data with look-ahead
func (*Chunk) GetFileThreshold ¶
func (*Chunk) GetMaxPeekSize ¶
func (*Chunk) GetPeekedBuf ¶
GetPeekedBuf returns a fixed-size []byte from the pool
func (*Chunk) PutPeekedBuf ¶
PutPeekedBuf returns the fixed-size []byte to the pool
type MockIChunk ¶
type MockIChunk struct {
// contains filtered or unexported fields
}
MockIChunk is a mock of IChunk interface.
func NewMockIChunk ¶
func NewMockIChunk(ctrl *gomock.Controller) *MockIChunk
NewMockIChunk creates a new mock instance.
func (*MockIChunk) EXPECT ¶
func (m *MockIChunk) EXPECT() *MockIChunkMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIChunk) GetFileThreshold ¶
func (m *MockIChunk) GetFileThreshold() int64
GetFileThreshold mocks base method.
func (*MockIChunk) GetMaxPeekSize ¶
func (m *MockIChunk) GetMaxPeekSize() int
GetMaxPeekSize mocks base method.
type MockIChunkMockRecorder ¶
type MockIChunkMockRecorder struct {
// contains filtered or unexported fields
}
MockIChunkMockRecorder is the mock recorder for MockIChunk.
func (*MockIChunkMockRecorder) GetFileThreshold ¶
func (mr *MockIChunkMockRecorder) GetFileThreshold() *gomock.Call
GetFileThreshold indicates an expected call of GetFileThreshold.
func (*MockIChunkMockRecorder) GetMaxPeekSize ¶
func (mr *MockIChunkMockRecorder) GetMaxPeekSize() *gomock.Call
GetMaxPeekSize indicates an expected call of GetMaxPeekSize.
func (*MockIChunkMockRecorder) GetSize ¶
func (mr *MockIChunkMockRecorder) GetSize() *gomock.Call
GetSize indicates an expected call of GetSize.
type Option ¶
type Option func(*Chunk)
func WithMaxPeekSize ¶
WithMaxPeekSize sets the max size of look-ahead bytes
func WithSmallFileThreshold ¶
WithSmallFileThreshold sets the threshold for small files