Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2019 v0.1.0 Jul 23, 2018 Changes in this version + var ErrFileNameMissing = errors.New("the first chunk should have the filename") + var ErrNoSession = errors.New("no open file session with this id") + var ErrUnauthorized = errors.New("peer not authorized for requested file") + type Handler interface + AbortWrite func(ctx context.Context, sessionID uuid.UUID) (err error) + BeginWrite func(ctx context.Context, fileName string) (uuid.UUID, error) + EndWrite func(ctx context.Context, sessionID uuid.UUID) (fileHash []byte, err error) + Exists func(ctx context.Context, fileHash []byte) (bool, error) + Read func(ctx context.Context, fileHash []byte) ([]byte, error) + ReadChunks func(ctx context.Context, fileHash []byte, chunkSize int, reader Reader) error + WriteChunk func(ctx context.Context, sessionID uuid.UUID, chunk []byte) (err error) + func NewLocalFileHandler(path string, db db.DB) Handler + type Reader interface + OnChunk func(chunk []byte, filePath string) error