env

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CusFileInfo

type CusFileInfo struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
	// Mode FileMode     // file mode bits
	// ModTime time.Time // modification time
	IsDir bool `json:"isDir"` // abbreviation for Mode().IsDir()

	Path string `json:"path"`
	Ext  string `json:"ext"` // 扩展类型
}

大写开头的变量不符合 js 的风格,用 tag 重新设置字段在 json 中的名字

func NewCusFileInfo

func NewCusFileInfo(info fs.FileInfo, parentPath string) CusFileInfo

type FileOp

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

func (*FileOp) List

func (fo *FileOp) List(path string) []CusFileInfo

获取文件夹下所有文件 js接收的时候会自动转换成 json 对象

func (*FileOp) ListImage

func (fo *FileOp) ListImage(path string) []CusFileInfo

获取文件夹下所有图片文件

func (*FileOp) Open

func (fo *FileOp) Open(path string) []byte

读取文件 (返回的字节数组会自动base64编码成字符串)

func (*FileOp) SelectFolder

func (fo *FileOp) SelectFolder(title string) string

打开文件夹选择

func (*FileOp) SetContext

func (fo *FileOp) SetContext(ctx context.Context)

Jump to

Keyboard shortcuts

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