Documentation ¶
Overview ¶
Package file defines a file system storage
Index ¶
- Constants
- func AdjustInfoSize(info os.FileInfo, size int) os.FileInfo
- func Create(ctx context.Context, URL string, mode os.FileMode, isDir bool, ...) error
- func Delete(ctx context.Context, URL string, options ...storage.Option) error
- func EnsureParentPathExists(filename string, fileMode os.FileMode) error
- func List(ctx context.Context, URL string, options ...storage.Option) ([]storage.Object, error)
- func Mode(info os.FileInfo) os.FileMode
- func Move(ctx context.Context, sourceURL, destURL string, options ...storage.Option) error
- func New() storage.Manager
- func NewInfo(name string, size int64, mode os.FileMode, modificationTime time.Time, ...) os.FileInfo
- func NewMode(attributes string) (os.FileMode, error)
- func NewWriter(_ context.Context, URL string, mode os.FileMode, options ...storage.Option) (io.WriteCloser, error)
- func Open(ctx context.Context, object storage.Object, options ...storage.Option) (io.ReadCloser, error)
- func OpenURL(ctx context.Context, URL string, options ...storage.Option) (io.ReadCloser, error)
- func Path(location string) string
- func Provider(options ...storage.Option) (storage.Manager, error)
- func Upload(ctx context.Context, URL string, mode os.FileMode, reader io.Reader, ...) error
- type Info
Constants ¶
View Source
const ( //DefaultDirOsMode folder mode default DefaultDirOsMode = os.ModeDir | 0755 //DefaultFileOsMode file mode default DefaultFileOsMode = os.FileMode(0644) )
View Source
const Scheme = "file"
Scheme file URL scheme
Variables ¶
This section is empty.
Functions ¶
func AdjustInfoSize ¶
AdjustInfoSize adjust file info size
func Create ¶
func Create(ctx context.Context, URL string, mode os.FileMode, isDir bool, options ...storage.Option) error
Create creates a new file or directory
func EnsureParentPathExists ¶
EnsureParentPathExists create parent path if needed
func NewInfo ¶
func NewInfo(name string, size int64, mode os.FileMode, modificationTime time.Time, isDir bool, options ...storage.Option) os.FileInfo
NewInfo returns a ew file Info
func Open ¶ added in v1.0.0
func Open(ctx context.Context, object storage.Object, options ...storage.Option) (io.ReadCloser, error)
Open downloads TestContent for the supplied object
func Path ¶
Path returns shortest path for specified location, if relative it adds current directory
Types ¶
Click to show internal directories.
Click to hide internal directories.