writer

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Pol = chunker.Pol(0x3c657535c4d6f5)
)

Functions

This section is empty.

Types

type BlobStorer

type BlobStorer interface {
	// Get(context.Context, string) ([]byte, error)
	// Enumerate(chan<- string, string, string, int) error
	Stat(context.Context, string) (bool, error)
	Put(context.Context, string, []byte) error
}

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

func (up *Uploader) DirExplorer(path string, pnode *node, nodes chan<- *node)

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

func (up *Uploader) PutDir(path string) (*rnode.RawNode, error)

PutDir upload a directory, it returns the saved Meta, a WriteResult containing infos about uploaded blobs.

func (*Uploader) PutFile

func (up *Uploader) PutFile(path string) (*rnode.RawNode, error)

PutFile uploads the file at the given path

func (*Uploader) PutFileRename

func (up *Uploader) PutFileRename(path, filename string, extraMeta bool) (*rnode.RawNode, error)

PutFileRename uploads and renames the file at the given path

func (*Uploader) PutMeta

func (up *Uploader) PutMeta(meta *rnode.RawNode) error

PutMeta uploads a raw node

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

func (up *Uploader) RenameMeta(meta *rnode.RawNode, name string) error

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

Jump to

Keyboard shortcuts

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