clients

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Presigned URL expiry times
	PresignUploadExpiry   = 15 * time.Minute // Upload URLs valid for 15 minutes
	PresignDownloadExpiry = 1 * time.Hour    // Download URLs valid for 1 hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageClient

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

StorageClient manages S3 operations for workspace storage

func (*StorageClient) BucketExists

func (c *StorageClient) BucketExists(ctx context.Context, bucket string) (bool, error)

func (*StorageClient) Config

func (*StorageClient) CopyObject

func (c *StorageClient) CopyObject(ctx context.Context, srcBucket, srcKey, dstBucket, dstKey string) error

func (*StorageClient) CreateBucket

func (c *StorageClient) CreateBucket(ctx context.Context, bucket string) error

func (*StorageClient) CreateWorkspaceBucket

func (c *StorageClient) CreateWorkspaceBucket(ctx context.Context, workspaceExternalId string) (string, error)

func (*StorageClient) Delete

func (c *StorageClient) Delete(ctx context.Context, bucket, key string) error

func (*StorageClient) Download

func (c *StorageClient) Download(ctx context.Context, bucket, key string) ([]byte, error)

func (*StorageClient) Exists

func (c *StorageClient) Exists(ctx context.Context, bucket, key string) (bool, error)

func (*StorageClient) Head

func (c *StorageClient) Head(ctx context.Context, bucket, key string) (*s3.HeadObjectOutput, error)

func (*StorageClient) ListObjects

func (c *StorageClient) ListObjects(ctx context.Context, bucket, prefix string, maxKeys int32) (*s3.ListObjectsV2Output, error)

func (*StorageClient) PresignClient

func (c *StorageClient) PresignClient() *s3.PresignClient

func (*StorageClient) PresignDownload

func (c *StorageClient) PresignDownload(ctx context.Context, bucket, key string, expires time.Duration) (string, error)

PresignDownload generates a presigned GET URL for downloading a file

func (*StorageClient) PresignUpload

func (c *StorageClient) PresignUpload(ctx context.Context, bucket, key, contentType string, expires time.Duration) (string, error)

PresignUpload generates a presigned PUT URL for uploading a file

func (*StorageClient) S3Client

func (c *StorageClient) S3Client() *s3.Client

func (*StorageClient) Upload

func (c *StorageClient) Upload(ctx context.Context, bucket, key string, data []byte) error

func (*StorageClient) WorkspaceBucketName

func (c *StorageClient) WorkspaceBucketName(workspaceExternalId string) string

Jump to

Keyboard shortcuts

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