summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2022-08-14 19:10:19 +0300
committerMarin Ivanov <[email protected]>2022-08-14 19:10:19 +0300
commit391f147a227b264c37c57950c9ee054bfd22cd41 (patch)
tree98a20bc09337b1ee5e7352a03a669037cfb2ae94
parentb6d256dd2b38f499392493307aeac7a8948f2968 (diff)
Bootstrap afero.Fs
-rw-r--r--file.go62
-rw-r--r--fs.go84
2 files changed, 146 insertions, 0 deletions
diff --git a/file.go b/file.go
new file mode 100644
index 0000000..c20ab62
--- /dev/null
+++ b/file.go
@@ -0,0 +1,62 @@
+package s3
+
+import (
+ "os"
+)
+
+type File struct {
+ name string
+}
+
+// implements io.Closer
+func (f *File) Close() error {
+ panic("not implemented")
+}
+
+// implements io.Reader
+func (f *File) Read(b []byte) (int, error) {
+ panic("not implemented")
+}
+
+// implements io.ReaderAt
+func (f *File) ReadAt(p []byte, off int64) (int, error) {
+ panic("not implemented")
+}
+
+// implements io.Writer
+func (f *File) Write(p []byte) (int, error) {
+ panic("not implemented")
+}
+
+// implements io.WriterAt
+func (f *File) WriteAt(p []byte, off int64) (int, error) {
+ panic("not implemented")
+}
+
+func (f *File) Name() string {
+ return f.name
+}
+
+func (f *File) Readdir(count int) ([]os.FileInfo, error) {
+ panic("not implemented")
+}
+
+func (f *File) Readdirnames(n int) ([]string, error) {
+ panic("not implemented")
+}
+
+func (f *File) Stat() (os.FileInfo, error) {
+ panic("not implemented")
+}
+
+func (f *File) Sync() error {
+ panic("not implemented")
+}
+
+func (f *File) Truncate(size int64) error {
+ panic("not implemented")
+}
+
+func (f *File) WriteString(s string) (ret int, err error) {
+ panic("not implemented")
+}
diff --git a/fs.go b/fs.go
new file mode 100644
index 0000000..8856cfe
--- /dev/null
+++ b/fs.go
@@ -0,0 +1,84 @@
+package s3
+
+import (
+ "os"
+ "time"
+)
+
+// Create creates a file in the filesystem, returning the file and an
+// error, if any happens.
+func (fs *Fs) Create(name string) (File, error) {
+ panic("not implemented")
+}
+
+// Mkdir creates a directory in the filesystem, return an error if any
+// happens.
+func (fs *Fs) Mkdir(name string, perm os.FileMode) error {
+ panic("not implemented")
+}
+
+// MkdirAll creates a directory path and all parents that does not exist
+// yet.
+func (fs *Fs) MkdirAll(path string, perm os.FileMode) error {
+ panic("not implemented")
+}
+
+// Open opens a file, returning it or an error, if any happens.
+func (fs *Fs) Open(name string) (File, error) {
+ panic("not implemented")
+}
+
+// OpenFile opens a file using the given flags and the given mode.
+func (fs *Fs) OpenFile(name string, flag int, perm os.FileMode) (File, error) {
+ panic("not implemented")
+}
+
+// Remove removes a file identified by name, returning an error, if any
+// happens.
+func (fs *Fs) Remove(name string) error {
+ panic("not implemented")
+}
+
+// RemoveAll removes a directory path and any children it contains. It
+// does not fail if the path does not exist (return nil).
+func (fs *Fs) RemoveAll(path string) error {
+ panic("not implemented")
+}
+
+// Rename renames a file.
+func (fs *Fs) Rename(oldname, newname string) error {
+ panic("not implemented")
+}
+
+// Stat returns a FileInfo describing the named file, or an error, if any
+// happens.
+func (fs *Fs) Stat(name string) (os.FileInfo, error) {
+ panic("not implemented")
+}
+
+// The name of this FileSystem
+func (fs *Fs) Name() string {
+ return "s3"
+}
+
+// Chmod changes the mode of the named file to mode.
+func (fs *Fs) Chmod(name string, mode os.FileMode) error {
+ panic("not implemented")
+}
+
+// Chown changes the uid and gid of the named file.
+func (fs *Fs) Chown(name string, uid, gid int) error {
+ panic("not implemented")
+}
+
+// Chtimes changes the access and modification times of the named file
+func (fs *Fs) Chtimes(name string, atime time.Time, mtime time.Time) error {
+ panic("not implemented")
+}
+
+type Fs struct {
+}
+
+func NewFs(url string) *Fs {
+ return &Fs{}
+}