github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/chat/s3/interface.go (about) 1 package s3 2 3 import ( 4 "io" 5 6 "github.com/keybase/client/go/libkb" 7 "golang.org/x/net/context" 8 ) 9 10 type Root interface { 11 New(g *libkb.GlobalContext, signer Signer, region Region) Connection 12 } 13 14 type Connection interface { 15 SetAccessKey(key string) 16 SetSessionToken(token string) 17 Bucket(name string) BucketInt 18 } 19 20 type BucketInt interface { 21 GetReader(ctx context.Context, path string) (rc io.ReadCloser, err error) 22 GetReaderWithRange(ctx context.Context, path string, begin, end int64) (rc io.ReadCloser, err error) 23 PutReader(ctx context.Context, path string, r io.Reader, length int64, contType string, perm ACL, options Options) error 24 Multi(ctx context.Context, key, contType string, perm ACL) (MultiInt, error) 25 Del(ctx context.Context, path string) error 26 } 27 28 type MultiInt interface { 29 ListParts(ctx context.Context) ([]Part, error) 30 Complete(ctx context.Context, parts []Part) error 31 PutPart(ctx context.Context, n int, r io.ReadSeeker) (Part, error) 32 }