{"modulePath":"github.com/data-preservation-programs/singularity","version":"v0.3.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package datasource\n\n## Functions\n\n```go\nfunc OptionsToCLIFlags(regInfo *fs.RegInfo) *cli.Command\n```\n\n## Types\n\n```go\ntype DefaultHandlerResolver struct {\n}\n```\n\n```go\nfunc (DefaultHandlerResolver) Resolve(ctx context.Context, source model.Source) (Handler, error)\n```\n\n```go\ntype EmptyReadCloser struct{}\n```\nEmptyReadCloser is a ReadCloser that always returns EOF.\n\n```go\nfunc (e *EmptyReadCloser) Close() error\n```\n\n```go\nfunc (e *EmptyReadCloser) Read(p []byte) (n int, err error)\n```\n\n```go\ntype Entry struct {\n\tError error\n\tInfo  fs.Object\n}\n```\nEntry is a struct that represents a single file during a data source scan\n\n```go\ntype Handler interface {\n\t// List lists the files at the given path.\n\tList(ctx context.Context, path string) ([]fs.DirEntry, error)\n\n\t// Scan scans the data source starting at the given path and returns a channel of entries.\n\t// The `last` parameter is used to resume scanning from the last entry returned by a previous scan. It is exclusive.\n\t// The returned entries must be sorted by path in ascending order.\n\tScan(ctx context.Context, path string, last string) \u003c-chan Entry\n\n\t// Check checks the size and last modified time of the file at the given path.\n\tCheck(ctx context.Context, path string) (fs.DirEntry, error)\n\n\tReadHandler\n}\n```\nHandler is an interface for scanning, reading, opening, and checking files in a data source.\n\n```go\ntype HandlerResolver interface {\n\tResolve(ctx context.Context, source model.Source) (Handler, error)\n}\n```\n\n```go\ntype RCloneHandler struct {\n\tfs.Fs\n}\n```\n\n```go\nfunc NewRCloneHandler(ctx context.Context, source model.Source) (*RCloneHandler, error)\n```\n\n```go\nfunc (h RCloneHandler) Check(ctx context.Context, path string) (fs.DirEntry, error)\n```\n\n```go\nfunc (h RCloneHandler) List(ctx context.Context, path string) ([]fs.DirEntry, error)\n```\n\n```go\nfunc (h RCloneHandler) Read(ctx context.Context, path string, offset int64, length int64) (io.ReadCloser, fs.Object, error)\n```\n\n```go\nfunc (h RCloneHandler) Scan(ctx context.Context, path string, last string) \u003c-chan Entry\n```\n\n```go\ntype ReadHandler interface {\n\t// Read reads data from the data source starting at the given path and offset, and returns a ReadCloser.\n\t// The `length` parameter specifies the number of bytes to read.\n\t// This method is most likely used for retrieving a single block of data.\n\tRead(ctx context.Context, path string, offset int64, length int64) (io.ReadCloser, fs.Object, error)\n}\n```\n\n","path":"github.com/data-preservation-programs/singularity/datasource","name":"datasource","synopsis":"","isRedistributable":true}
