Documentation ¶
Index ¶
- Variables
- type Config
- type Manager
- func (mgr *Manager) GetUploader(ctx context.Context, uploaderID string) (*Uploader, error)
- func (mgr *Manager) Len(ctx context.Context) (int, error)
- func (mgr *Manager) NewUploader(ctx context.Context, config *Config) (string, error)
- func (mgr *Manager) Root() (ocfl.WriteFS, string)
- func (mgr *Manager) UploaderIDs(ctx context.Context) ([]string, error)
- type Persistence
- type PersistentUploader
- type Upload
- type Uploader
- func (up *Uploader) Close(ctx context.Context) error
- func (up *Uploader) Config() *Config
- func (up *Uploader) ContentSource(alg string) ocfl.ContentSource
- func (up *Uploader) Created() time.Time
- func (up *Uploader) Delete(ctx context.Context) error
- func (up *Uploader) FixitySource(alg string) ocfl.FixitySource
- func (up *Uploader) Root() (ocfl.WriteFS, string)
- func (up *Uploader) Uploads() []Upload
- func (up *Uploader) Write(ctx context.Context, r io.Reader) (*Upload, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUploaderNotFound = errors.New("uploader not found with the given id") ErrUploaderDelete = errors.New("uploader is being deleted") ErrUploaderInUse = errors.New("uploader is in use and can't be deleted") ErrDigestAlgorithm = errors.New("uploader doesn't support the digest algorithm") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(fsys ocfl.WriteFS, dir string, persist Persistence) *Manager
func (*Manager) GetUploader ¶
func (*Manager) NewUploader ¶
type Persistence ¶
type Persistence interface { CreateUploader(ctx context.Context, vals *PersistentUploader) error CreateUpload(ctx context.Context, upID string, vals *Upload) error // list of all uploaderIDs GetUploaderIDs(ctx context.Context) ([]string, error) // GetUploader with all it's uploads GetUploader(ctx context.Context, id string) (*PersistentUploader, error) // Delete the uploader and all its uploads DeleteUploader(ctx context.Context, id string) error // number of uploaders CountUploaders(ctx context.Context) (int, error) }
type PersistentUploader ¶
type Upload ¶
type Upload struct { // file name relative to uploader's root Name string `json:"name,omitempty"` // file size Size int64 `json:"size"` // digests for each algorithm used by the uploader Digests ocfl.DigestSet `json:"digests"` }
Upload is an item in the Uploader manifest.
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func (*Uploader) ContentSource ¶
func (*Uploader) FixitySource ¶
Click to show internal directories.
Click to hide internal directories.