storage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildObjectKey

func BuildObjectKey(projectID, fileType, fileID, ext string) string

BuildObjectKey returns the canonical storage key: {project_id}/{file_type}/{uuid}{ext}.

Types

type ObjectStorage

type ObjectStorage interface {
	Upload(ctx context.Context, key string, body io.Reader, contentType string, size int64) (publicURL string, err error)
	DeleteObjects(ctx context.Context, keys []string) (failed []string, err error)
}

ObjectStorage uploads and deletes objects in project-configured S3-compatible storage.

type ProjectS3Storage

type ProjectS3Storage struct {
	// contains filtered or unexported fields
}

ProjectS3Storage implements ObjectStorage using aws-sdk-go-v2 and project storage settings.

func NewProjectS3Storage

func NewProjectS3Storage(project *models.Project, cfg *models.Config) (*ProjectS3Storage, error)

NewProjectS3Storage builds an S3-compatible client from project storage settings and platform free-cloud config.

func (*ProjectS3Storage) DeleteObjects

func (s *ProjectS3Storage) DeleteObjects(ctx context.Context, keys []string) ([]string, error)

DeleteObjects removes objects; returns keys that failed to delete.

func (*ProjectS3Storage) PublicURL

func (s *ProjectS3Storage) PublicURL(key string) string

PublicURL builds the object URL from PublicBaseURL or endpoint/bucket/key.

func (*ProjectS3Storage) Upload

func (s *ProjectS3Storage) Upload(ctx context.Context, key string, body io.Reader, contentType string, size int64) (string, error)

Upload streams an object to S3.

Jump to

Keyboard shortcuts

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