Documentation ¶
Index ¶
- func Copy(ctx context.Context, dstURL, srcURL *url.URL) error
- func Create(ctx context.Context, dstURL *url.URL) (io.WriteCloser, error)
- func NewProgressReader(r io.Reader, f ProgressFunc) io.Reader
- func Open(ctx context.Context, srcURL *url.URL) (io.ReadCloser, error)
- func Register(scheme string, constructor func() FileSystem)
- func WithProgressFunc(ctx context.Context, f ProgressFunc) context.Context
- type FileInfo
- type FileSystem
- type ProgressFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProgressReader ¶
func NewProgressReader(r io.Reader, f ProgressFunc) io.Reader
NewProgressReader creates a new io.Reader which reports progress.
func Register ¶
func Register(scheme string, constructor func() FileSystem)
Register registers a filesystem provider for the given scheme.
func WithProgressFunc ¶
func WithProgressFunc(ctx context.Context, f ProgressFunc) context.Context
WithProgressFunc sets a progress function on a context.
Types ¶
type FileSystem ¶
type FileSystem interface { Create(ctx context.Context, dstURL *url.URL) (io.WriteCloser, error) Open(ctx context.Context, srcURL *url.URL) (io.ReadCloser, error) Stat(ctx context.Context, srcURL *url.URL) (FileInfo, error) }
A FileSystem implements file operations.
type ProgressFunc ¶
type ProgressFunc = func(add int)
A ProgressFunc is used to track progress of an operation.
func GetProgressFunc ¶
func GetProgressFunc(ctx context.Context) ProgressFunc
GetProgressFunc gets a progress function from a context. If no function is defined a no-op function is returned.
Click to show internal directories.
Click to hide internal directories.