urlmanager

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is the unified implementation of UrlManager. It handles multicloud signing and multipart uploads by resolving provider metadata from the database.

func NewManager

func NewManager(database core.DatabaseInterface, signing config.SigningConfig) *Manager

func (*Manager) CompleteMultipartUpload

func (m *Manager) CompleteMultipartUpload(ctx context.Context, bucketName string, key string, uploadId string, parts []MultipartPart) error

func (*Manager) InitMultipartUpload

func (m *Manager) InitMultipartUpload(ctx context.Context, bucketName string, key string) (string, error)

func (*Manager) SignDownloadPart

func (m *Manager) SignDownloadPart(ctx context.Context, accessId string, urlStr string, start int64, end int64, opts SignOptions) (string, error)

func (*Manager) SignMultipartPart

func (m *Manager) SignMultipartPart(ctx context.Context, bucketName string, key string, uploadId string, partNumber int32) (string, error)

func (*Manager) SignURL

func (m *Manager) SignURL(ctx context.Context, accessId string, urlStr string, opts SignOptions) (string, error)

func (*Manager) SignUploadURL

func (m *Manager) SignUploadURL(ctx context.Context, accessId string, urlStr string, opts SignOptions) (string, error)

type MultipartManager

type MultipartManager interface {
	InitMultipartUpload(ctx context.Context, bucket string, key string) (string, error)
	SignMultipartPart(ctx context.Context, bucket string, key string, uploadId string, partNumber int32) (string, error)
	CompleteMultipartUpload(ctx context.Context, bucket string, key string, uploadId string, parts []MultipartPart) error
}

MultipartManager handles multipart lifecycle for a storage backend.

type MultipartPart

type MultipartPart struct {
	PartNumber int32
	ETag       string
}

MultipartPart represents a part in a multipart upload.

type SignOptions

type SignOptions struct {
	ExpiresIn int // in seconds
}

SignOptions contains optional parameters for signing.

type SignedURLManager

type SignedURLManager interface {
	// SignURL signs a URL for the given resource (Download).
	SignURL(ctx context.Context, accessId string, url string, opts SignOptions) (string, error)

	// SignUploadURL signs a URL for uploading a resource.
	SignUploadURL(ctx context.Context, accessId string, url string, opts SignOptions) (string, error)

	// SignDownloadPart signs a URL for downloading a specific byte range.
	SignDownloadPart(ctx context.Context, accessId string, url string, start int64, end int64, opts SignOptions) (string, error)
}

SignedURLManager signs download/upload URLs for a storage backend.

type UrlManager

type UrlManager interface {
	SignedURLManager
	MultipartManager
}

UrlManager composes signed URL operations and multipart operations.

Jump to

Keyboard shortcuts

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