Documentation ¶
Index ¶
- Constants
- type PathResultMessage
- type Repository
- func (repo *Repository) AddFile(ctx context.Context, folder, target, destinationFolder string) (fileIdStr string, status int, err error)
- func (repo *Repository) AddPath(ctx context.Context, folder, target, destinationFolder string, ...)
- func (repo *Repository) AddStream(ctx context.Context, in io.ReadCloser, ...) (fileIdStr string, status int, err error)
- func (repo *Repository) RemovePath(ctx context.Context, path string, res chan<- PathResultMessage)
Constants ¶
View Source
const ( // The method ignored the file RepositoryStatusIgnored = iota - 3 // The file was already existing RepositoryStatusExisting // The file could not be found RepositoryStatusNotFound // Everything went well RepositoryStatusOK // An internal (application) error happened RepositoryStatusInternalError // An error occurred because of the user RepositoryStatusUserError )
Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathResultMessage ¶
PathResultMessage is the message passed to the res channel in AddPath/RemovePath
type Repository ¶
Repository is the object that manages the repository
func (*Repository) AddFile ¶
func (repo *Repository) AddFile(ctx context.Context, folder, target, destinationFolder string) (fileIdStr string, status int, err error)
AddFile adds a file to the repository This accepts any regular file, and it does not ignore any file
func (*Repository) AddPath ¶
func (repo *Repository) AddPath(ctx context.Context, folder, target, destinationFolder string, res chan<- PathResultMessage)
AddPath adds a path (a file or a folder, recursively) and reports each element added in the res channel
func (*Repository) AddStream ¶
func (repo *Repository) AddStream(ctx context.Context, in io.ReadCloser, filename, destinationFolder, mimeType string, size int64) (fileIdStr string, status int, err error)
AddStream adds a document to the repository by reading it from a stream
func (*Repository) RemovePath ¶
func (repo *Repository) RemovePath(ctx context.Context, path string, res chan<- PathResultMessage)
RemovePath removes a path by its prefix, and reports each element removed in the res channel
Click to show internal directories.
Click to hide internal directories.