summaryrefslogtreecommitdiff
path: root/file.go
blob: 2498bd828066a658b72ef4f54a02b4d7c606c57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package s3

import (
	"context"
	"io"
	"os"
	"path"
)

type File struct {
	fs     *Fs
	key    string
	r      io.ReadCloser
	w      io.WriteCloser
	cancel context.CancelFunc
}

// implements io.Closer
func (f *File) Close() error {
	f.cancel()
	return nil
}

// implements io.Reader
func (f *File) Read(b []byte) (int, error) {
	return f.r.Read(b)
}

// 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) {
	return f.w.Write(p)
}

// implements io.WriterAt
func (f *File) WriteAt(p []byte, off int64) (int, error) {
	panic("not implemented")
}

func (f *File) Name() string {
	return path.Base(f.key)
}

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) Seek(offset int64, whence int) (int64, error) {
	panic("not implemented")
}

func (f *File) Stat() (os.FileInfo, error) {
	return f.fs.Stat(f.key)
}

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")
}