diff --git a/blocksources/fixed_size_block_resolver.go b/blocksources/fixed_size_block_resolver.go index d81573e..fc14686 100644 --- a/blocksources/fixed_size_block_resolver.go +++ b/blocksources/fixed_size_block_resolver.go @@ -22,7 +22,7 @@ func (r *FixedSizeBlockResolver) GetBlockEndOffset(blockID uint) int64 { } } -// Split blocks into chunks of the desired size, or less. This implementation assumes a fixed block size at the source. +// SplitBlockRangeToDesiredSize splits blocks into chunks of the desired size, or less. This implementation assumes a fixed block size at the source. func (r *FixedSizeBlockResolver) SplitBlockRangeToDesiredSize(startBlockID, endBlockID uint) []QueuedRequest { if r.MaxDesiredRequestSize == 0 { diff --git a/chunks/chunks.go b/chunks/chunks.go index aac4143..144c0e8 100644 --- a/chunks/chunks.go +++ b/chunks/chunks.go @@ -22,7 +22,7 @@ type ChunkChecksum struct { StrongChecksum []byte } -// compares a checksum to another based on the checksums, not the offset +// Match compares a checksum to another based on the checksums, not the offset func (chunk ChunkChecksum) Match(other ChunkChecksum) bool { weakEqual := bytes.Compare(chunk.WeakChecksum, other.WeakChecksum) == 0 strongEqual := false diff --git a/circularbuffer/noalloc.go b/circularbuffer/noalloc.go index 0449739..712b8df 100644 --- a/circularbuffer/noalloc.go +++ b/circularbuffer/noalloc.go @@ -107,7 +107,7 @@ func (c *C2) Truncate(byteCount int) (evicted []byte) { return bufferToRead.buffer[start : start+byteCount] } -// get the current buffer contents of block +// GetBlock gets the current buffer contents of block func (c *C2) GetBlock() []byte { // figure out which buffer has it stored contiguously bufferToRead := c.getBlockBuffer() @@ -116,7 +116,7 @@ func (c *C2) GetBlock() []byte { return bufferToRead.buffer[start:bufferToRead.head] } -// get the data that was evicted by the last write +// Evicted gets the data that was evicted by the last write func (c *C2) Evicted() []byte { if c.totalWritten <= c.blocksize { return nil diff --git a/filechecksum/filechecksum.go b/filechecksum/filechecksum.go index 4f69701..da80803 100644 --- a/filechecksum/filechecksum.go +++ b/filechecksum/filechecksum.go @@ -84,13 +84,13 @@ func (check *FileChecksumGenerator) GetChecksumSizes() (int, int) { return check.WeakRollingHash.Size(), check.GetStrongHash().Size() } -// Gets the Hash function for the overall file used on each block +// GetFileHash gets the Hash function for the overall file used on each block // defaults to md5 func (check *FileChecksumGenerator) GetFileHash() hash.Hash { return check.FileChecksumHash } -// Gets the Hash function for the strong hash used on each block +// GetStrongHash gets the Hash function for the strong hash used on each block // defaults to md5, but can be overriden by the generator func (check *FileChecksumGenerator) GetStrongHash() hash.Hash { return check.StrongHash diff --git a/patcher/sequential/sequential.go b/patcher/sequential/sequential.go index b8a3018..e6bbe87 100644 --- a/patcher/sequential/sequential.go +++ b/patcher/sequential/sequential.go @@ -16,8 +16,7 @@ const ( ABSOLUTE_POSITION = 0 ) -/* -This simple example currently doesn't do any pipelining of needed blocks, nor does it deal with +/* This simple example currently doesn't do any pipelining of needed blocks, nor does it deal with blocks being delivered out of order. */ func SequentialPatcher( diff --git a/rollsum/rollsum_32.go b/rollsum/rollsum_32.go index 1fbe7b8..f2d1c34 100644 --- a/rollsum/rollsum_32.go +++ b/rollsum/rollsum_32.go @@ -54,7 +54,7 @@ func (r *Rollsum32) BlockSize() int { return int(r.blockSize) } -// the number of bytes +// The number of bytes func (r *Rollsum32) Size() int { return 4 } diff --git a/rollsum/rollsum_32_base.go b/rollsum/rollsum_32_base.go index 8153e72..bb1212c 100644 --- a/rollsum/rollsum_32_base.go +++ b/rollsum/rollsum_32_base.go @@ -6,7 +6,7 @@ import ( const FULL_BYTES_16 = (1 << 16) - 1 -// Rollsum32Base decouples the rollsum algorithm from the implementation of +// NewRollsum32Base decouples the rollsum algorithm from the implementation of // hash.Hash and the storage the rolling checksum window // this allows us to write different versions of the storage for the distinctly different // use-cases and optimize the storage with the usage pattern. @@ -21,7 +21,7 @@ type Rollsum32Base struct { a, b uint32 } -// Add a single byte into the rollsum +// AddByte adds a single byte into the rollsum func (r *Rollsum32Base) AddByte(b byte) { r.a += uint32(b) r.b += r.a @@ -34,7 +34,7 @@ func (r *Rollsum32Base) AddBytes(bs []byte) { } } -// Remove a byte from the end of the rollsum +// RemoveByte removes a byte from the end of the rollsum // Use the previous length (before removal) func (r *Rollsum32Base) RemoveByte(b byte, length int) { r.a -= uint32(b) diff --git a/util/readers/sequencelimit.go b/util/readers/sequencelimit.go index 96ba1bd..f671e6d 100644 --- a/util/readers/sequencelimit.go +++ b/util/readers/sequencelimit.go @@ -4,7 +4,7 @@ import ( "io" ) -// read from 'readers' in sequence up to a limit of 'size' +// SequenceLimit reads from 'readers' in sequence up to a limit of 'size' func SequenceLimit(size int64, readers ...io.Reader) io.Reader { return io.LimitReader( io.MultiReader(readers...),