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 FileSyncer struct {
// contains filtered or unexported fields
}
func NewFileSyncer ¶
func NewFileSyncer(opts ...SetFileSyncerOption) (*FileSyncer, error)
func (*FileSyncer) Close ¶
func (fs *FileSyncer) Close() (err error)
func (*FileSyncer) Initialize ¶
func (fs *FileSyncer) Initialize() error
func (*FileSyncer) Sync ¶
func (fs *FileSyncer) Sync(offset int64, data []byte, size int) (err error)
func (*FileSyncer) Validate ¶
func (fs *FileSyncer) Validate() error
type FileSyncerOption ¶
type FileSyncerOption struct {
// contains filtered or unexported fields
}
func NewFileSyncerOption ¶
func NewFileSyncerOption() *FileSyncerOption
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.