Documentation ¶
Overview ¶
Package digest is a generated GoMock package.
Index ¶
- Constants
- func Checksum(buf []byte) uint32
- func NewDigest() stackadler32.Digest
- func Validate(b []byte) ([]byte, error)
- type Buffer
- type FdWithDigestWriter
- type FileWithDigestWriter
- type MockFdWithDigestWriter
- func (m *MockFdWithDigestWriter) Close() error
- func (m *MockFdWithDigestWriter) Digest() hash.Hash32
- func (m *MockFdWithDigestWriter) EXPECT() *MockFdWithDigestWriterMockRecorder
- func (m *MockFdWithDigestWriter) Fd() *os.File
- func (m *MockFdWithDigestWriter) Flush() error
- func (m *MockFdWithDigestWriter) Reset(arg0 *os.File)
- func (m *MockFdWithDigestWriter) Write(arg0 []byte) (int, error)
- type MockFdWithDigestWriterMockRecorder
- func (mr *MockFdWithDigestWriterMockRecorder) Close() *gomock.Call
- func (mr *MockFdWithDigestWriterMockRecorder) Digest() *gomock.Call
- func (mr *MockFdWithDigestWriterMockRecorder) Fd() *gomock.Call
- func (mr *MockFdWithDigestWriterMockRecorder) Flush() *gomock.Call
- func (mr *MockFdWithDigestWriterMockRecorder) Reset(arg0 interface{}) *gomock.Call
- func (mr *MockFdWithDigestWriterMockRecorder) Write(arg0 interface{}) *gomock.Call
Constants ¶
const (
// DigestLenBytes is the length of generated digests in bytes.
DigestLenBytes = 4
)
Variables ¶
This section is empty.
Functions ¶
func NewDigest ¶
func NewDigest() stackadler32.Digest
NewDigest creates a new digest. The default 32-bit hashing algorithm is adler32.
Types ¶
type Buffer ¶
type Buffer []byte
Buffer is a byte slice that facilitates digest reading and writing.
func (Buffer) ReadDigest ¶
ReadDigest reads the digest from the buffer.
func (Buffer) ReadDigestFromFile ¶
ReadDigestFromFile reads the digest from the file.
func (Buffer) WriteDigest ¶
WriteDigest writes a digest to the buffer.
type FdWithDigestWriter ¶
type FdWithDigestWriter interface { io.Writer Flush() error // contains filtered or unexported methods }
FdWithDigestWriter provides a buffered writer for writing to the underlying file.
type FileWithDigestWriter ¶
type FileWithDigestWriter struct {
// contains filtered or unexported fields
}
FileWithDigestWriter writes data to a file and computes the data checksum in a streaming fashion.
func NewFdWithDigestWriter ¶
func NewFdWithDigestWriter(bufferSize int) *FileWithDigestWriter
NewFdWithDigestWriter creates a new FdWithDigestWriter.
func (*FileWithDigestWriter) Close ¶
func (w *FileWithDigestWriter) Close() error
Close writes the final checksum to file, flushes what's remaining in the buffered writer, and closes the underlying file.
func (*FileWithDigestWriter) Flush ¶
func (w *FileWithDigestWriter) Flush() error
Flush flushes what's remaining in the buffered writes.
func (*FileWithDigestWriter) Reset ¶
func (w *FileWithDigestWriter) Reset(fd *os.File)
Reset resets the writer.
type MockFdWithDigestWriter ¶
type MockFdWithDigestWriter struct {
// contains filtered or unexported fields
}
MockFdWithDigestWriter is a mock of FdWithDigestWriter interface
func NewMockFdWithDigestWriter ¶
func NewMockFdWithDigestWriter(ctrl *gomock.Controller) *MockFdWithDigestWriter
NewMockFdWithDigestWriter creates a new mock instance
func (*MockFdWithDigestWriter) Close ¶
func (m *MockFdWithDigestWriter) Close() error
Close mocks base method
func (*MockFdWithDigestWriter) Digest ¶
func (m *MockFdWithDigestWriter) Digest() hash.Hash32
Digest mocks base method
func (*MockFdWithDigestWriter) EXPECT ¶
func (m *MockFdWithDigestWriter) EXPECT() *MockFdWithDigestWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockFdWithDigestWriter) Fd ¶
func (m *MockFdWithDigestWriter) Fd() *os.File
Fd mocks base method
func (*MockFdWithDigestWriter) Flush ¶
func (m *MockFdWithDigestWriter) Flush() error
Flush mocks base method
func (*MockFdWithDigestWriter) Reset ¶
func (m *MockFdWithDigestWriter) Reset(arg0 *os.File)
Reset mocks base method
type MockFdWithDigestWriterMockRecorder ¶
type MockFdWithDigestWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockFdWithDigestWriterMockRecorder is the mock recorder for MockFdWithDigestWriter
func (*MockFdWithDigestWriterMockRecorder) Close ¶
func (mr *MockFdWithDigestWriterMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockFdWithDigestWriterMockRecorder) Digest ¶
func (mr *MockFdWithDigestWriterMockRecorder) Digest() *gomock.Call
Digest indicates an expected call of Digest
func (*MockFdWithDigestWriterMockRecorder) Fd ¶
func (mr *MockFdWithDigestWriterMockRecorder) Fd() *gomock.Call
Fd indicates an expected call of Fd
func (*MockFdWithDigestWriterMockRecorder) Flush ¶
func (mr *MockFdWithDigestWriterMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush
func (*MockFdWithDigestWriterMockRecorder) Reset ¶
func (mr *MockFdWithDigestWriterMockRecorder) Reset(arg0 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockFdWithDigestWriterMockRecorder) Write ¶
func (mr *MockFdWithDigestWriterMockRecorder) Write(arg0 interface{}) *gomock.Call
Write indicates an expected call of Write