s3-share/internal/s3/s3.go

27 lines
616 B
Go

package s3
import (
"context"
"io"
"git.kapelle.org/niklas/s3share/internal/types"
)
type ObjectReader interface {
io.Reader
io.Seeker
io.ReaderAt
io.Closer
}
type S3 interface {
// Get the object from the S3 bucket. Returns an error if the object does not exist.
GetObject(ctx context.Context, key string) (ObjectReader, error)
// Check if the given key exists
KeyExists(ctx context.Context, key string) (bool, error)
// Get object metadata. The `Filename` field is optional. Returns nil if the object does not exist.
GetObjectMetadata(ctx context.Context, key string) (*types.Metadata, error)
}