Documentation ¶
Overview ¶
* @Author: Wangjun * @Date: 2023-05-19 16:51:32 * @LastEditTime: 2024-11-23 18:28:58 * @LastEditors: wangjun haodreams@163.com * @Description: * @FilePath: \ai_tradee:\go\src\gitee.com\haodreams\golib\js\jsutil\jsthis.go * hnxr
* @Author: Wangjun * @Date: 2023-03-15 13:32:52 * @LastEditTime: 2024-11-06 12:36:47 * @LastEditors: wangjun haodreams@163.com * @Description: * @FilePath: \golib\js\jsutil\model.go * hnxr
Index ¶
- func GetJsDir() string
- func InitModels(vm *goja.Runtime)
- func LoadNumber(path string) (err error)
- func LoadString(path string) (err error)
- func SaveNumber(path string) (err error)
- func SaveString(path string) (err error)
- func SetJsDir(dir string)
- type JsCtx
- func (m *JsCtx) Clock() string
- func (m *JsCtx) FormatNow(fmt string) string
- func (m *JsCtx) FormatTime(unix int64, fmt string) string
- func (m *JsCtx) Interrupt(obj any)
- func (m *JsCtx) Now() time.Time
- func (m *JsCtx) Setup(vm *goja.Runtime)
- func (m *JsCtx) Unix() int64
- func (m *JsCtx) UnixMilli() int64
- func (m *JsCtx) UsedTime(now time.Time) string
- func (m *JsCtx) VM() *goja.Runtime
- type JsThis
- func (m *JsThis) AppendFile(path, data string) any
- func (m *JsThis) Avg(x ...float64) float64
- func (m *JsThis) BufPush(data string)
- func (m *JsThis) BufReset()
- func (m *JsThis) BufString() string
- func (m *JsThis) BufWrite(data string)
- func (m *JsThis) Escape(p string) string
- func (m *JsThis) FileModiTime(path string) int64
- func (m *JsThis) GBK(data string) string
- func (m *JsThis) GET(url string) string
- func (m *JsThis) Get(url string) any
- func (m *JsThis) GetJSON(url string) string
- func (m *JsThis) GetNumber(key string) float64
- func (m *JsThis) GetString(key string) string
- func (m *JsThis) IF(x ...float64) float64
- func (m *JsThis) IsDir(path string) bool
- func (m *JsThis) IsExist(path string) bool
- func (m *JsThis) IsFile(path string) bool
- func (m *JsThis) Max(x ...float64) float64
- func (m *JsThis) Min(x ...float64) float64
- func (m *JsThis) Mkdir(path string) bool
- func (m *JsThis) POST(url string) string
- func (m *JsThis) PostJSON(url string, jsdata string) any
- func (m *JsThis) ReadFile(path string) any
- func (m *JsThis) Remove(path string) any
- func (m *JsThis) RemoveFile(path string) any
- func (m *JsThis) SetNumber(key string, value float64)
- func (m *JsThis) SetString(key string, value string)
- func (m *JsThis) Sleep(ms int)
- func (m *JsThis) Sum(x ...float64) float64
- func (m *JsThis) UTF8(data string) string
- func (m *JsThis) WriteFile(path, data string) any
- type Setuper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JsCtx ¶
type JsCtx struct { JsThis // contains filtered or unexported fields }
func (*JsCtx) FormatNow ¶
*
- @description: 格式化时间
- @param {int64} unix unix 时间戳
- @param {string} fmt
- @return {*}
func (*JsCtx) FormatTime ¶
*
- @description: 格式化时间
- @param {int64} unix unix 时间戳
- @param {string} fmt
- @return {*}
type JsThis ¶
type JsThis struct {
// contains filtered or unexported fields
}
func (*JsThis) AppendFile ¶
*
- @description: 追加的方式文件
- @param {*} path
- @param {string} data
- @return {*}
func (*JsThis) SetNumber ¶
*
- @description: 缓存设置数字数据
- @param {string} key
- @param {float64} value
- @return {*}
func (*JsThis) SetString ¶
*
- @description: 设置缓存的字符串
- @param {string} key
- @param {string} value
- @return {*}
Click to show internal directories.
Click to hide internal directories.