Documentation
¶
Overview ¶
Package s3 provides an S3-backed implementation of the io.Medium interface.
Index ¶
- type Medium
- func (m *Medium) Append(p string) (goio.WriteCloser, error)
- func (m *Medium) Create(p string) (goio.WriteCloser, error)
- func (m *Medium) Delete(p string) error
- func (m *Medium) DeleteAll(p string) error
- func (m *Medium) EnsureDir(_ string) error
- func (m *Medium) Exists(p string) bool
- func (m *Medium) FileGet(p string) (string, error)
- func (m *Medium) FileSet(p, content string) error
- func (m *Medium) IsDir(p string) bool
- func (m *Medium) IsFile(p string) bool
- func (m *Medium) List(p string) ([]fs.DirEntry, error)
- func (m *Medium) Open(p string) (fs.File, error)
- func (m *Medium) Read(p string) (string, error)
- func (m *Medium) ReadStream(p string) (goio.ReadCloser, error)
- func (m *Medium) Rename(oldPath, newPath string) error
- func (m *Medium) Stat(p string) (fs.FileInfo, error)
- func (m *Medium) Write(p, content string) error
- func (m *Medium) WriteStream(p string) (goio.WriteCloser, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Medium ¶
type Medium struct {
// contains filtered or unexported fields
}
Medium is an S3-backed storage backend implementing the io.Medium interface.
func (*Medium) Append ¶
func (m *Medium) Append(p string) (goio.WriteCloser, error)
Append opens the named file for appending. It downloads the existing content (if any) and re-uploads the combined content on Close.
func (*Medium) Create ¶
func (m *Medium) Create(p string) (goio.WriteCloser, error)
Create creates or truncates the named file. Returns a writer that uploads the content on Close.
func (*Medium) IsDir ¶
IsDir checks if a path exists and is a directory (has objects under it as a prefix).
func (*Medium) IsFile ¶
IsFile checks if a path exists and is a regular file (not a "directory" prefix).
func (*Medium) List ¶
List returns directory entries for the given path using ListObjectsV2 with delimiter.
func (*Medium) ReadStream ¶
func (m *Medium) ReadStream(p string) (goio.ReadCloser, error)
ReadStream returns a reader for the file content.
func (*Medium) WriteStream ¶
func (m *Medium) WriteStream(p string) (goio.WriteCloser, error)
WriteStream returns a writer for the file content. Content is uploaded on Close.