Documentation
¶
Overview ¶
* @Author: NyanCatda * @Date: 2022-03-22 21:59:31 * @LastEditTime: 2022-03-23 21:43:03 * @LastEditors: NyanCatda * @Description: 目录操作 * @FilePath: \Momizi\Internal\Plugin\JavaScript\Tools\File\Dir.go
* @Author: NyanCatda * @Date: 2022-03-22 21:57:52 * @LastEditTime: 2022-03-23 21:43:24 * @LastEditors: NyanCatda * @Description: 文件操作函数注册 * @FilePath: \Momizi\Internal\Plugin\JavaScript\Tools\File\File.go
* @Author: NyanCatda * @Date: 2022-03-23 13:57:19 * @LastEditTime: 2022-03-27 21:22:48 * @LastEditors: NyanCatda * @Description:文件读写操作 * @FilePath: \Momizi\Internal\Plugin\JavaScript\Tools\File\ReadWrite.go
Index ¶
- Variables
- func RegistrationFunction(VM *goja.Runtime) error
- type File
- func (File File) Copy(Path string, NewPath string) (int64, bool)
- func (File File) Delete(Path string) bool
- func (File File) Exists(Path string) bool
- func (File File) GetFileSize(FilePath string) int64
- func (File File) GetFilesList(Path string) []string
- func (File File) IsDir(Path string) bool
- func (File File) MKDir(Path string) bool
- func (File File) Move(Path string, NewPath string) bool
- func (File File) Read(Path string) any
- func (File File) ReadAsync(Path string, Callback goja.Callable)
- func (File File) WriteAppend(Path string, Content string) bool
- func (File File) WriteAppendAsync(Path string, Content string, Callback goja.Callable)
- func (File File) WriteTo(Path string, Content string) bool
- func (File File) WriteToAsync(Path string, Content string, Callback goja.Callable)
Constants ¶
This section is empty.
Variables ¶
View Source
var DataPath = Controller.DataPath + "/"
Functions ¶
Types ¶
type File ¶
func (File) Copy ¶
*
- @description: 复制文件
- @param {string} Path 路径
- @param {string} NewPath 新路径
- @return {int64} 文件大小(Byte)
- @return {bool} 是否成功
func (File) GetFileSize ¶
*
- @description: 获取文件大小
- @param {string} FilePath 文件路径
- @return {int64} 文件大小(Byte)
func (File) Move ¶
*
- @description: 移动文件
- @param {string} Path 路径
- @param {string} NewPath 新路径
- @return {bool} 是否成功
func (File) ReadAsync ¶
*
- @description: 异步读取文件
- @param {string} Path 文件路径
- @param {goja.Callable} Callback 回调函数
- @return {string} 文件内容(读取失败返回nil)
func (File) WriteAppend ¶
*
- @description: 追加写入文件
- @param {string} Path 文件路径
- @param {string} Content 文件内容
- @return {bool} 是否成功
func (File) WriteAppendAsync ¶
*
- @description: 异步追加写入文件
- @param {string} Path 文件路径
- @param {string} Content 文件内容
- @param {goja.Callable} Callback 回调函数
- @return {bool} 是否成功
Click to show internal directories.
Click to hide internal directories.