Documentation ¶
Index ¶
- Variables
- type BlobStorer
- type Uploader
- func (up *Uploader) DirExplorer(path string, pnode *node, nodes chan<- *node)
- func (up *Uploader) DirUploadDone()
- func (up *Uploader) DirWriterNode(node *node)
- func (up *Uploader) PutDir(path string) (*rnode.RawNode, error)
- func (up *Uploader) PutFile(path string) (*rnode.RawNode, error)
- func (up *Uploader) PutFileRename(path, filename string, extraMeta bool) (*rnode.RawNode, error)
- func (up *Uploader) PutMeta(meta *rnode.RawNode) error
- func (up *Uploader) PutReader(name string, reader io.Reader, data map[string]interface{}) (*rnode.RawNode, error)
- func (up *Uploader) RenameMeta(meta *rnode.RawNode, name string) error
- func (up *Uploader) StartDirUpload()
- func (up *Uploader) StartUpload()
- func (up *Uploader) UploadDone()
Constants ¶
This section is empty.
Variables ¶
var (
Pol = chunker.Pol(0x3c657535c4d6f5)
)
Functions ¶
This section is empty.
Types ¶
type BlobStorer ¶
type Uploader ¶
type Uploader struct { // Ignorer *gignore.GitIgnore Root string // contains filtered or unexported fields }
func NewUploader ¶
func NewUploader(bs BlobStorer) *Uploader
func (*Uploader) DirExplorer ¶
DirExplorer recursively reads the directory and send/route the files/directories to the according channel for processing
func (*Uploader) DirUploadDone ¶
func (up *Uploader) DirUploadDone()
Read from the channel to let another upload start
func (*Uploader) DirWriterNode ¶
func (up *Uploader) DirWriterNode(node *node)
DirWriterNode reads the directory and upload it.
func (*Uploader) PutDir ¶
PutDir upload a directory, it returns the saved Meta, a WriteResult containing infos about uploaded blobs.
func (*Uploader) PutFileRename ¶
PutFileRename uploads and renames the file at the given path
func (*Uploader) PutReader ¶
func (up *Uploader) PutReader(name string, reader io.Reader, data map[string]interface{}) (*rnode.RawNode, error)
PutReader uploads a reader
func (*Uploader) RenameMeta ¶
RenameMeta performs an efficient rename
func (*Uploader) StartDirUpload ¶
func (up *Uploader) StartDirUpload()
Block until the client can start the upload, thus limiting the number of file descriptor used.
func (*Uploader) StartUpload ¶
func (up *Uploader) StartUpload()
Block until the client can start the upload, thus limiting the number of file descriptor used.
func (*Uploader) UploadDone ¶
func (up *Uploader) UploadDone()
Read from the channel to let another upload start