local

package
v0.0.0-...-31ccecd Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalFilesystem

type LocalFilesystem struct {
	Root    string // 根目录
	BaseUrl string // 基础URL
}

func NewStorage

func NewStorage(root string, baseUrl string) *LocalFilesystem

func (*LocalFilesystem) Delete

func (fs *LocalFilesystem) Delete(path string) error

Delete 删除文件

func (*LocalFilesystem) Exists

func (fs *LocalFilesystem) Exists(path string) bool

Exists 判断文件是否存在

func (*LocalFilesystem) Get

func (fs *LocalFilesystem) Get(path string) ([]byte, error)

func (*LocalFilesystem) GetImageWidthHeight

func (fs *LocalFilesystem) GetImageWidthHeight(path string) (int, int, error)

func (*LocalFilesystem) GetSignedUrl

func (fs *LocalFilesystem) GetSignedUrl(path string, expires int64) (string, error)

GetSignedUrl 获取签名URL

func (*LocalFilesystem) GetUrl

func (fs *LocalFilesystem) GetUrl(path string) string

GetUrl 获取文件完整路径 当路径是绝对路径时,忽略Root配置

func (*LocalFilesystem) MustGetSignedUrl

func (fs *LocalFilesystem) MustGetSignedUrl(path string, expires int64) string

MustGetSignedUrl 获取签名URL

func (*LocalFilesystem) Put

func (fs *LocalFilesystem) Put(ctx context.Context, path string, data []byte) error

func (*LocalFilesystem) PutWithoutContext

func (fs *LocalFilesystem) PutWithoutContext(path string, data []byte) error

Jump to

Keyboard shortcuts

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