Rename ManifestBuilder to Builder
This commit is contained in:
@@ -12,16 +12,16 @@ import (
|
||||
// FileProgress is called during file processing to report bytes read.
|
||||
type FileProgress func(bytesRead int64)
|
||||
|
||||
// ManifestBuilder constructs a manifest by adding files one at a time.
|
||||
type ManifestBuilder struct {
|
||||
// Builder constructs a manifest by adding files one at a time.
|
||||
type Builder struct {
|
||||
mu sync.Mutex
|
||||
files []*MFFilePath
|
||||
createdAt time.Time
|
||||
}
|
||||
|
||||
// NewBuilder creates a new ManifestBuilder.
|
||||
func NewBuilder() *ManifestBuilder {
|
||||
return &ManifestBuilder{
|
||||
// NewBuilder creates a new Builder.
|
||||
func NewBuilder() *Builder {
|
||||
return &Builder{
|
||||
files: make([]*MFFilePath, 0),
|
||||
createdAt: time.Now(),
|
||||
}
|
||||
@@ -30,7 +30,7 @@ func NewBuilder() *ManifestBuilder {
|
||||
// AddFile reads file content from reader, computes hashes, and adds to manifest.
|
||||
// The progress callback is called periodically with total bytes read so far.
|
||||
// Returns the number of bytes read.
|
||||
func (b *ManifestBuilder) AddFile(
|
||||
func (b *Builder) AddFile(
|
||||
path string,
|
||||
size int64,
|
||||
mtime time.Time,
|
||||
@@ -85,14 +85,14 @@ func (b *ManifestBuilder) AddFile(
|
||||
}
|
||||
|
||||
// FileCount returns the number of files added to the builder.
|
||||
func (b *ManifestBuilder) FileCount() int {
|
||||
func (b *Builder) FileCount() int {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
return len(b.files)
|
||||
}
|
||||
|
||||
// Build finalizes the manifest and writes it to the writer.
|
||||
func (b *ManifestBuilder) Build(w io.Writer) error {
|
||||
func (b *Builder) Build(w io.Writer) error {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user