file

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilePolicyAdapter

func NewFilePolicyAdapter() domainPort.FilePolicy

func NewFileStorageAdapter

func NewFileStorageAdapter(st *infraStorage.Storage) domainPort.FileStorage

Types

type PolicyAdapter

type PolicyAdapter struct{}

PolicyAdapter 文件上传策略端口适配器

func (*PolicyAdapter) Allow

func (a *PolicyAdapter) Allow(mediaType valueobject.MediaType) ([]string, int64)

type StorageAdapter

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

StorageAdapter 文件存储端口适配器

func (*StorageAdapter) AbortMultipartUpload

func (adapter *StorageAdapter) AbortMultipartUpload(ctx context.Context, path, uploadId string) error

func (*StorageAdapter) CompleteMultipartUpload

func (adapter *StorageAdapter) CompleteMultipartUpload(ctx context.Context, path, uploadId string, parts []domainModel.Part) error

func (*StorageAdapter) FullURL

func (adapter *StorageAdapter) FullURL(ctx context.Context, path string) string

func (*StorageAdapter) InitMultipartUpload

func (adapter *StorageAdapter) InitMultipartUpload(ctx context.Context, path string, contentType string) (string, error)

func (*StorageAdapter) ListUploadedParts

func (adapter *StorageAdapter) ListUploadedParts(ctx context.Context, path, uploadId string) ([]domainModel.Part, error)

func (*StorageAdapter) RelativePath

func (adapter *StorageAdapter) RelativePath(ctx context.Context, path string) string

func (*StorageAdapter) TypeByExtension

func (adapter *StorageAdapter) TypeByExtension(filePath string) string

func (*StorageAdapter) Upload

func (adapter *StorageAdapter) Upload(ctx context.Context, path string, r io.Reader, contentType string) error

func (*StorageAdapter) UploadPart

func (adapter *StorageAdapter) UploadPart(ctx context.Context, path, uploadId string, partNumber int, r io.Reader) (string, error)

Jump to

Keyboard shortcuts

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