Documentation
¶
Overview ¶
Package local provides a local filesystem 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(p 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(path 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(path string) (goio.WriteCloser, error)
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 a local filesystem storage backend.
func New ¶
New creates a new local Medium rooted at the given directory. Pass "/" for full filesystem access, or a specific path to sandbox.
func (*Medium) Append ¶
func (m *Medium) Append(p string) (goio.WriteCloser, error)
Append opens the named file for appending, creating it if it doesn't exist.
func (*Medium) Create ¶
func (m *Medium) Create(p string) (goio.WriteCloser, error)
Create creates or truncates the named file.
func (*Medium) ReadStream ¶
func (m *Medium) ReadStream(path string) (goio.ReadCloser, error)
ReadStream returns a reader for the file content.
This is a convenience wrapper around Open that exposes a streaming-oriented API, as required by the io.Medium interface, while Open provides the more general filesystem-level operation. Both methods are kept for semantic clarity and backward compatibility.
func (*Medium) WriteStream ¶
func (m *Medium) WriteStream(path string) (goio.WriteCloser, error)
WriteStream returns a writer for the file content.
This is a convenience wrapper around Create that exposes a streaming-oriented API, as required by the io.Medium interface, while Create provides the more general filesystem-level operation. Both methods are kept for semantic clarity and backward compatibility.