github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/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  	Bucket(name string) BucketInt
    17  }
    18  
    19  type BucketInt interface {
    20  	GetReader(ctx context.Context, path string) (rc io.ReadCloser, err error)
    21  	GetReaderWithRange(ctx context.Context, path string, begin, end int64) (rc io.ReadCloser, err error)
    22  	PutReader(ctx context.Context, path string, r io.Reader, length int64, contType string, perm ACL, options Options) error
    23  	Multi(ctx context.Context, key, contType string, perm ACL) (MultiInt, error)
    24  	Del(ctx context.Context, path string) error
    25  }
    26  
    27  type MultiInt interface {
    28  	ListParts(ctx context.Context) ([]Part, error)
    29  	Complete(ctx context.Context, parts []Part) error
    30  	PutPart(ctx context.Context, n int, r io.ReadSeeker) (Part, error)
    31  }