Documentation ¶
Index ¶
Constants ¶
View Source
const (
DEFAULT_CHUNK_SIZE int64 = 512 * 1024
)
Variables ¶
View Source
var ( ErrInvalidArgument = errors.New("invalid argument") ErrHashNotMatch = errors.New("hash not match") ErrBadChunkIndex = errors.New("bad chunk index") ErrEmptyCacheFile = errors.New("empty cache file") )
View Source
var (
DONE = errors.New("done")
)
Functions ¶
This section is empty.
Types ¶
type FileSyncer ¶
type FileSyncerOption ¶
type FileSyncerOption struct {
// contains filtered or unexported fields
}
func NewFileSyncerOption ¶
func NewFileSyncerOption() *FileSyncerOption
type RandomFileSyncer ¶
type RandomFileSyncer struct {
// contains filtered or unexported fields
}
func NewRandomFileSyncer ¶
func NewRandomFileSyncer(opts ...SetFileSyncerOption) (*RandomFileSyncer, error)
func (*RandomFileSyncer) Close ¶
func (fs *RandomFileSyncer) Close() (err error)
type SequenceFileSyncer ¶
type SequenceFileSyncer struct {
// contains filtered or unexported fields
}
func NewSequenceFileSyncer ¶
func NewSequenceFileSyncer(writeCloser io.WriteCloser, size int64, sha1_hash string, chunk_size int64) *SequenceFileSyncer
func (*SequenceFileSyncer) Close ¶
func (sfs *SequenceFileSyncer) Close() error
type SetFileSyncerOption ¶
type SetFileSyncerOption func(*FileSyncerOption)
func SetCachePath ¶
func SetCachePath(path string) SetFileSyncerOption
func SetChunkSize ¶
func SetChunkSize(size int64) SetFileSyncerOption
func SetPath ¶
func SetPath(path string) SetFileSyncerOption
func SetSha1Hash ¶
func SetSha1Hash(hash string) SetFileSyncerOption
func SetSize ¶
func SetSize(size int64) SetFileSyncerOption
Click to show internal directories.
Click to hide internal directories.