storage

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: GPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package storage provides FileStorage implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStorage

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

LocalStorage stores files on the local filesystem. Directory layout: {basePath}/{tenantID}/{storageKey}

Intended for development and small self-hosted deployments. For production, use S3Storage or MinIOStorage (implement the same interface).

func NewLocalStorage

func NewLocalStorage(basePath string) *LocalStorage

NewLocalStorage creates a local filesystem storage provider.

func (*LocalStorage) Delete

func (s *LocalStorage) Delete(_ context.Context, tenantID, storageKey string) error

func (*LocalStorage) Download

func (s *LocalStorage) Download(_ context.Context, tenantID, storageKey string) (io.ReadCloser, string, error)

func (*LocalStorage) Upload

func (s *LocalStorage) Upload(_ context.Context, tenantID, filename, _ string, reader io.Reader) (string, error)

type S3Storage

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

S3Storage stores files in S3-compatible object storage (AWS S3, MinIO, etc). Object key layout: {tenantID}/{storageKey}

func NewS3Storage

func NewS3Storage(bucket, region, endpoint, accessKey, secretKey string) (*S3Storage, error)

NewS3Storage creates an S3 storage provider. For MinIO: set endpoint to MinIO URL (e.g., "http://minio:9000"). For AWS S3: leave endpoint empty (uses default AWS endpoint).

func (*S3Storage) Delete

func (s *S3Storage) Delete(ctx context.Context, tenantID, storageKey string) error

func (*S3Storage) Download

func (s *S3Storage) Download(ctx context.Context, tenantID, storageKey string) (io.ReadCloser, string, error)

func (*S3Storage) Upload

func (s *S3Storage) Upload(ctx context.Context, tenantID, filename, contentType string, reader io.Reader) (string, error)

Jump to

Keyboard shortcuts

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