objects

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package objects provides storage orchestration layer that combines clientpool provider resolution with objects/storage pure operations to enable multi-tenant file storage management.

Index

Constants

View Source
const (
	// DefaultClientPoolTTL is the default TTL for client pool entries.
	DefaultClientPoolTTL = 15 * time.Minute
	// DefaultDevStorageBucket is used when a development storage bucket is required but not provided.
	DefaultDevStorageBucket = "/tmp/dev-storage"
	// DefaultS3Region is used when no region is specified for S3-compatible providers.
	DefaultS3Region = "us-east-1"
)

Variables

View Source
var (
	// ErrProviderResolutionFailed is returned when storage provider resolution failed
	ErrProviderResolutionFailed = errors.New("storage provider resolution failed")
	// ErrProviderCreationFailed is returned when storage provider creation failed
	ErrProviderCreationFailed = errors.New("storage provider creation failed")
	// ErrInvalidUploadOptions is returned when invalid upload options provided
	ErrInvalidUploadOptions = errors.New("invalid upload options")
	// ErrInvalidIntegration is returned when an invalid integration is provided
	ErrInvalidIntegration = errors.New("invalid integration provided")
	// ErrNoOrganizationID is returned when no organization ID is available
	ErrNoOrganizationID = errors.New("no organization ID available")
	// ErrMissingIntegrationID is returned when integration ID is missing
	ErrMissingIntegrationID = errors.New("integration ID is missing")
	// ErrMissingHushID is returned when hush ID is missing
	ErrMissingHushID = errors.New("hush ID is missing")
	// ErrSystemIntegrationMissingOrgID is returned when system integration is missing organization ID
	ErrSystemIntegrationMissingOrgID = errors.New("system integration missing organization ID")
	// ErrNoIntegrationOrCredentials is returned when no integration or credentials are available
	ErrNoIntegrationOrCredentials = errors.New("no integration or credentials available")
	// ErrNoSystemIntegration is returned when no system integration is found for a provider
	ErrNoSystemIntegration = errors.New("no system integration found")
	// ErrNoIntegrationWithSecrets is returned when an integration lacks associated secrets
	ErrNoIntegrationWithSecrets = errors.New("no active integration with secrets found")
	// ErrMissingFileID is returned when file ID is required but missing
	ErrMissingFileID = errors.New("file id required for presigned URL")
)

Functions

func ApplyProviderHints

func ApplyProviderHints(ctx context.Context, hints *storagetypes.ProviderHints) context.Context

ApplyProviderHints injects hint values into the resolution context using typed context values

func PopulateProviderHints

func PopulateProviderHints(file *pkgobjects.File, orgID string)

PopulateProviderHints ensures standard metadata is present on the file's provider hints

func ResolveModuleFromFile

func ResolveModuleFromFile(f pkgobjects.File) (models.OrgModule, bool)

ResolveModuleFromFile attempts to determine the module associated with the upload

Types

type Config

Config holds configuration for creating a new Service

type KnownProviderHint

type KnownProviderHint storagetypes.ProviderType

type ModuleHint

type ModuleHint models.OrgModule

Typed context hint strings

type PreferredProviderHint

type PreferredProviderHint storagetypes.ProviderType

type ProviderCacheKey

type ProviderCacheKey struct {
	TenantID        string
	IntegrationType string
}

ProviderCacheKey implements eddy.CacheKey for provider caching

func (ProviderCacheKey) String

func (k ProviderCacheKey) String() string

String returns the cache key as a string

type Service

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

Service orchestrates storage operations using eddy provider resolution

func NewService

func NewService(cfg Config) *Service

NewService creates a new storage orchestration service

func (*Service) Delete

Delete deletes a file using provider resolution

func (*Service) Download

Download downloads a file using provider resolution

func (*Service) ErrorResponseHandler

func (s *Service) ErrorResponseHandler() storage.ErrResponseHandler

ErrorResponseHandler returns the configured error response handler

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, file *storagetypes.File) (bool, error)

Exists checks if a file exists using provider resolution

func (*Service) GetPresignedURL

func (s *Service) GetPresignedURL(ctx context.Context, file *storagetypes.File, duration time.Duration) (string, error)

GetPresignedURL gets a presigned URL for a file using provider resolution

func (*Service) IgnoreNonExistentKeys

func (s *Service) IgnoreNonExistentKeys() bool

IgnoreNonExistentKeys returns whether to ignore non-existent form keys

func (*Service) Keys

func (s *Service) Keys() []string

Keys returns the configured form keys

func (*Service) MaxSize

func (s *Service) MaxSize() int64

MaxSize returns the configured maximum file size

func (*Service) Skipper

func (s *Service) Skipper() storage.SkipperFunc

Skipper returns the configured skipper function

func (*Service) Upload

func (s *Service) Upload(ctx context.Context, reader io.Reader, opts *storage.UploadOptions) (*pkgobjects.File, error)

Upload uploads a file using provider resolution

type SizeBytesHint

type SizeBytesHint int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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