file

package
v0.0.0-...-a8c716a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageType     = "fs"
	SystemStartPath = "/tmp"
	SystemBaseUrl   = "http://localhost/"
)

Variables

This section is empty.

Functions

func FolderExistOrCreate

func FolderExistOrCreate(path string) error

FolderExistOrCreate 检查目录是否存在, 如果不存在就创建 递归创建目录

func GetLink(ctx context.Context, fileName string, userId uint32) (link string, err error)

func GetLocalPath

func GetLocalPath(ctx context.Context, fileName string) string

func IsExist

func IsExist(filePath string) (bool, error)

IsExist 检查文件是存在的

func IsFileExist

func IsFileExist(ctx context.Context, fileName string) (bool, error)

func ParseFont

func ParseFont(fontFile string) (f *truetype.Font, err error)

Types

type FSStorage

type FSStorage struct {
}

TODO: context 应当使用飞行记录器记录,如果要使用,请将 go version 更新到 22.1.0 以上版本

func (f FSStorage) GetLink(ctx context.Context, fileName string) (string, error)

func (FSStorage) GetLocalPath

func (f FSStorage) GetLocalPath(ctx context.Context, fileName string) string

func (FSStorage) IsFileExist

func (f FSStorage) IsFileExist(ctx context.Context, fileName string) (bool, error)

func (FSStorage) Upload

func (f FSStorage) Upload(ctx context.Context, fileName string, content io.Reader) (output *PutObjectOutput, err error)

type PutObjectOutput

type PutObjectOutput struct{}

func Upload

func Upload(ctx context.Context, fileName string, content io.Reader) (*PutObjectOutput, error)

Jump to

Keyboard shortcuts

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