s3browser-backend/internal/s3/s3.go

30 lines
694 B
Go
Raw Normal View History

package s3
import (
"context"
"io"
"git.kapelle.org/niklas/s3browser/internal/types"
)
type Bucket string
type Object interface {
io.Reader
io.Seeker
io.ReaderAt
io.Closer
}
type S3Service interface {
ListBuckets(ctx context.Context) ([]Bucket, error)
GetObject(ctx context.Context, id types.ID) (Object, error)
PutObject(ctx context.Context, id types.ID, reader io.Reader, objectSize int64) error
ListObjects(ctx context.Context, id types.ID) ([]types.File, []types.Directory, error)
CopyObject(ctx context.Context, src types.ID, dest types.ID) error
StatObject(ctx context.Context, id types.ID) (*types.File, error)
RemoveObject(ctx context.Context, id types.ID) error
}