Documentation
¶
Index ¶
- Variables
- func ValidateKey(key string) bool
- type BlobBackend
- type BlobIndex
- func (bi *BlobIndex) Close() error
- func (bi *BlobIndex) Count() int
- func (bi *BlobIndex) FilterAfterTime(after time.Time) ([]*BlobInfo, error)
- func (bi *BlobIndex) FilterBeforeTime(before time.Time) ([]*BlobInfo, error)
- func (bi *BlobIndex) FilterByKeyGlob(pattern string) ([]*BlobInfo, error)
- func (bi *BlobIndex) FilterByPrefix(prefix string) ([]*BlobInfo, error)
- func (bi *BlobIndex) FilterBySuffix(suffix string) ([]*BlobInfo, error)
- func (bi *BlobIndex) FilterByTime(filter TimeFilter) ([]*BlobInfo, error)
- func (bi *BlobIndex) Get(key string) (*BlobInfo, bool)
- func (bi *BlobIndex) Iter() iter.Seq[*BlobInfo]
- func (bi *BlobIndex) List() ([]*BlobInfo, error)
- func (bi *BlobIndex) Remove(key string) error
- func (bi *BlobIndex) Set(blob *BlobInfo) error
- func (bi *BlobIndex) SetMany(blobs []*BlobInfo) error
- type BlobInfo
- type BlobService
- type CompleteMultipartUploadParams
- type CompletedPart
- type CopyObjectParams
- type CopyObjectResponse
- type GetObjectResponse
- type IBlobIndex
- type PutObjectMultipartParams
- type PutObjectMultipartResponse
- type PutObjectParams
- type PutObjectPresignedResponse
- type PutObjectResponse
- type S3Backend
- func (s *S3Backend) CompleteMultipartUpload(ctx context.Context, params *CompleteMultipartUploadParams) (*PutObjectResponse, error)
- func (s *S3Backend) CopyObject(ctx context.Context, params *CopyObjectParams) (*CopyObjectResponse, error)
- func (s *S3Backend) Delegate() any
- func (s *S3Backend) DeleteObject(ctx context.Context, key string) (bool, error)
- func (s *S3Backend) GetObject(ctx context.Context, key string) (*GetObjectResponse, error)
- func (s *S3Backend) GetObjectPresigned(ctx context.Context, key string) (string, error)
- func (s *S3Backend) ListObjects(ctx context.Context) ([]*BlobInfo, error)
- func (s *S3Backend) PutObject(ctx context.Context, params *PutObjectParams) (*PutObjectResponse, error)
- func (s *S3Backend) PutObjectMultipart(ctx context.Context, params *PutObjectMultipartParams) (*PutObjectMultipartResponse, error)
- func (s *S3Backend) PutObjectPresigned(ctx context.Context, key string) (string, error)
- type S3Config
- type TimeFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidKey = errors.New("invalid key")
)
Functions ¶
func ValidateKey ¶
Validate a key for S3 and local file system compatibility
Types ¶
type BlobBackend ¶
type BlobBackend interface {
GetObject(ctx context.Context, key string) (*GetObjectResponse, error)
GetObjectPresigned(ctx context.Context, key string) (string, error)
PutObject(ctx context.Context, params *PutObjectParams) (*PutObjectResponse, error)
PutObjectPresigned(ctx context.Context, key string) (string, error)
PutObjectMultipart(ctx context.Context, params *PutObjectMultipartParams) (*PutObjectMultipartResponse, error)
CompleteMultipartUpload(ctx context.Context, params *CompleteMultipartUploadParams) (*PutObjectResponse, error)
CopyObject(ctx context.Context, params *CopyObjectParams) (*CopyObjectResponse, error)
DeleteObject(ctx context.Context, key string) (bool, error)
ListObjects(ctx context.Context) ([]*BlobInfo, error)
Delegate() any
// contains filtered or unexported methods
}
not enforced yet
type BlobIndex ¶
type BlobIndex struct {
// contains filtered or unexported fields
}
BlobIndex provides access to the blob metadata stored in SQLite
func (*BlobIndex) FilterAfterTime ¶
FilterAfterTime returns blobs modified after the given time (maintains backward compatibility)
func (*BlobIndex) FilterBeforeTime ¶
FilterBeforeTime returns blobs modified before the given time
func (*BlobIndex) FilterByKeyGlob ¶
FilterByKeyGlob returns blobs with keys matching the given SQL LIKE pattern
func (*BlobIndex) FilterByPrefix ¶
func (*BlobIndex) FilterBySuffix ¶
func (*BlobIndex) FilterByTime ¶
func (bi *BlobIndex) FilterByTime(filter TimeFilter) ([]*BlobInfo, error)
FilterByTime returns blobs modified after the given time
type BlobService ¶
type BlobService struct {
// contains filtered or unexported fields
}
func NewBlobService ¶
func NewBlobService(cfg *S3Config, db *sqlx.DB) (*BlobService, error)
func (*BlobService) Backend ¶
func (b *BlobService) Backend() BlobBackend
Backend returns the underlying blob backend instance
type CompleteMultipartUploadParams ¶
type CompleteMultipartUploadParams struct {
Key string `json:"key"`
UploadID string `json:"uploadId"`
Parts []*CompletedPart `json:"parts"`
}
type CompletedPart ¶
type CopyObjectParams ¶
type CopyObjectResponse ¶
type GetObjectResponse ¶
type IBlobIndex ¶
type IBlobIndex interface {
Get(key string) (*BlobInfo, bool)
Set(blob *BlobInfo) error
SetMany(blobs []*BlobInfo) error
Remove(key string) error
List() ([]*BlobInfo, error)
Iter() iter.Seq[*BlobInfo]
Count() int
FilterByKeyGlob(pattern string) ([]*BlobInfo, error)
FilterByPrefix(prefix string) ([]*BlobInfo, error)
FilterBySuffix(suffix string) ([]*BlobInfo, error)
FilterByTime(filter TimeFilter) ([]*BlobInfo, error)
FilterAfterTime(after time.Time) ([]*BlobInfo, error)
FilterBeforeTime(before time.Time) ([]*BlobInfo, error)
}
not enforced yet
type PutObjectParams ¶
type PutObjectResponse ¶
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
func NewS3BackendWithConfig ¶
func (*S3Backend) CompleteMultipartUpload ¶
func (s *S3Backend) CompleteMultipartUpload(ctx context.Context, params *CompleteMultipartUploadParams) (*PutObjectResponse, error)
func (*S3Backend) CopyObject ¶
func (s *S3Backend) CopyObject(ctx context.Context, params *CopyObjectParams) (*CopyObjectResponse, error)
func (*S3Backend) DeleteObject ¶
func (*S3Backend) GetObjectPresigned ¶
func (*S3Backend) ListObjects ¶
func (*S3Backend) PutObject ¶
func (s *S3Backend) PutObject(ctx context.Context, params *PutObjectParams) (*PutObjectResponse, error)
Add an object to a bucket
func (*S3Backend) PutObjectMultipart ¶
func (s *S3Backend) PutObjectMultipart(ctx context.Context, params *PutObjectMultipartParams) (*PutObjectMultipartResponse, error)
type S3Config ¶
Click to show internal directories.
Click to hide internal directories.