interfaces

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectInfo

type ObjectInfo struct {
	Name         string
	Bucket       string
	Size         int64
	ContentType  string
	LastModified time.Time
	ETag         string
	Metadata     map[string]string
}

type StorageProvider

type StorageProvider interface {
	ListObjects(ctx context.Context, bucketName string) (map[string]*ObjectInfo, error)
	GetObject(ctx context.Context, bucketName, objectName string) (*ObjectInfo, io.ReadCloser, error)
	UploadObject(ctx context.Context, bucketName, objectName string, reader io.Reader, size int64, contentType string) (*UploadInfo, error)
	DeleteObject(ctx context.Context, bucketName, objectName string) error
	BucketExists(ctx context.Context, bucketName string) (bool, error)
	EnsureBucketExists(ctx context.Context, bucketName string) error
	Close() error
}

type UploadInfo

type UploadInfo struct {
	Bucket string
	Key    string
	ETag   string
	Size   int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL