local

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config) (fs.FileSystem, error)

Types

type Config added in v0.2.0

type Config struct {
	RootPath         string // 根目录路径
	SubPath          string // 子目录路径
	MultipartStorage MultipartStorage
}

type FileMultipartStorage added in v0.2.0

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

FileMultipartStorage 文件系统实现的状态存储

func NewFileMultipartStorage added in v0.2.0

func NewFileMultipartStorage(storageDir string) (*FileMultipartStorage, error)

func (*FileMultipartStorage) Delete added in v0.2.0

func (s *FileMultipartStorage) Delete(uploadID string) error

func (*FileMultipartStorage) Get added in v0.2.0

func (s *FileMultipartStorage) Get(uploadID string) (*MultipartUpload, error)

func (*FileMultipartStorage) List added in v0.2.0

func (s *FileMultipartStorage) List() ([]*MultipartUpload, error)

func (*FileMultipartStorage) Save added in v0.2.0

func (s *FileMultipartStorage) Save(upload *MultipartUpload) error

type MultipartStorage added in v0.2.0

type MultipartStorage interface {
	// Save 保存分片上传状态
	Save(upload *MultipartUpload) error
	// Get 获取分片上传状态
	Get(uploadID string) (*MultipartUpload, error)
	// Delete 删除分片上传状态
	Delete(uploadID string) error
	// List 列出所有未完成的分片上传
	List() ([]*MultipartUpload, error)
}

MultipartStorage 本地文件驱动分片上传状态存储器

type MultipartUpload added in v0.2.0

type MultipartUpload struct {
	Path       string         `json:"path"`
	UploadID   string         `json:"upload_id"`
	Parts      map[int]string `json:"parts"` // partNumber -> tempFilePath
	CreateTime string         `json:"create_time"`
}

Jump to

Keyboard shortcuts

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