sync

package
v0.0.0-...-08e1f15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2011 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbsolutePath

type AbsolutePath string

func (AbsolutePath) Resolve

func (absPath AbsolutePath) Resolve() string

type BlockMatch

type BlockMatch struct {
	SrcBlock  fs.Block
	DstOffset int64
}

type Conflict

type Conflict struct {
	Path     *LocalPath
	FileInfo *os.FileInfo
	// contains filtered or unexported fields
}

Register a conflict

func (*Conflict) Cleanup

func (conflict *Conflict) Cleanup() os.Error

func (*Conflict) Exec

func (conflict *Conflict) Exec(srcStore fs.BlockStore) (err os.Error)

func (*Conflict) String

func (conflict *Conflict) String() string

type FileMatch

type FileMatch struct {
	SrcSize      int64
	DstSize      int64
	BlockMatches []*BlockMatch
}

func Match

func Match(src string, dst string) (match *FileMatch, err os.Error)

func MatchFile

func MatchFile(srcFile fs.File, dst string) (match *FileMatch, err os.Error)

func (*FileMatch) NotMatched

func (match *FileMatch) NotMatched() (ranges []*RangePair)

type Keep

type Keep struct {
	Path PathRef
}

Keep a file. Yeah, that's right. Just leave it alone.

func (*Keep) Exec

func (keep *Keep) Exec(srcStore fs.BlockStore) os.Error

func (*Keep) String

func (keep *Keep) String() string

type LocalPath

type LocalPath struct {
	LocalStore fs.LocalStore
	RelPath    string
}

func (*LocalPath) Resolve

func (localPath *LocalPath) Resolve() string

func (*LocalPath) String

func (localPath *LocalPath) String() string

type LocalTemp

type LocalTemp struct {
	Path PathRef
	Size int64
	// contains filtered or unexported fields
}

Start a temp file to recieve changes on a local destination file. The temporary file is created with specified size and no contents.

func (*LocalTemp) Exec

func (localTemp *LocalTemp) Exec(srcStore fs.BlockStore) (err os.Error)

func (*LocalTemp) String

func (localTemp *LocalTemp) String() string

type LocalTempCopy

type LocalTempCopy struct {
	Temp        *LocalTemp
	LocalOffset int64
	TempOffset  int64
	Length      int64
}

Copy a range of data known to already be in the local destination file.

func (*LocalTempCopy) Exec

func (ltc *LocalTempCopy) Exec(srcStore fs.BlockStore) (err os.Error)

func (*LocalTempCopy) String

func (ltc *LocalTempCopy) String() string

type PatchCmd

type PatchCmd interface {
	String() string

	Exec(srcStore fs.BlockStore) os.Error
}

type PatchPlan

type PatchPlan struct {
	Cmds []PatchCmd
	// contains filtered or unexported fields
}

func NewPatchPlan

func NewPatchPlan(srcStore fs.BlockStore, dstStore fs.LocalStore) *PatchPlan

func Patch

func Patch(src string, dst string) (*PatchPlan, os.Error)

func (*PatchPlan) Clean

func (plan *PatchPlan) Clean(errors chan<- os.Error)

func (*PatchPlan) Exec

func (plan *PatchPlan) Exec() (failedCmd PatchCmd, err os.Error)

func (*PatchPlan) SetMode

func (plan *PatchPlan) SetMode(errors chan<- os.Error)

func (*PatchPlan) String

func (plan *PatchPlan) String() string

type PathRef

type PathRef interface {
	Resolve() string
}

type RangePair

type RangePair struct {
	From int64
	To   int64
}

func (*RangePair) Size

func (r *RangePair) Size() int64

type ReplaceWithTemp

type ReplaceWithTemp struct {
	Temp *LocalTemp
}

Replace the local file with its temporary

func (*ReplaceWithTemp) Exec

func (rwt *ReplaceWithTemp) Exec(srcStore fs.BlockStore) (err os.Error)

func (*ReplaceWithTemp) String

func (rwt *ReplaceWithTemp) String() string

type Resize

type Resize struct {
	Path PathRef
	Size int64
}

Set a file to a different size. Paths are relative.

func (*Resize) Exec

func (resize *Resize) Exec(srcStore fs.BlockStore) os.Error

func (*Resize) String

func (resize *Resize) String() string

type SrcFileDownload

type SrcFileDownload struct {
	SrcFile fs.File
	Path    PathRef
	Length  int64
}

Copy a range of data from the source file to the destination file.

func (*SrcFileDownload) Exec

func (sfd *SrcFileDownload) Exec(srcStore fs.BlockStore) os.Error

func (*SrcFileDownload) String

func (sfd *SrcFileDownload) String() string

type SrcTempCopy

type SrcTempCopy struct {
	Temp       *LocalTemp
	SrcStrong  string
	SrcOffset  int64
	TempOffset int64
	Length     int64
}

Copy a range of data from the source file into a local temp file.

func (*SrcTempCopy) Exec

func (stc *SrcTempCopy) Exec(srcStore fs.BlockStore) os.Error

func (*SrcTempCopy) String

func (stc *SrcTempCopy) String() string

type Transfer

type Transfer struct {
	From *LocalPath
	To   *LocalPath
	// contains filtered or unexported fields
}

Copy a local file.

func (*Transfer) Exec

func (transfer *Transfer) Exec(srcStore fs.BlockStore) (err os.Error)

func (*Transfer) String

func (transfer *Transfer) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL