Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(passphrase, data []byte) ([]byte, error)
- func AESDecryptBuf(passphrase string, buf *core.Buffer) (bufout *core.Buffer, err error)
- func AESEncrypt(passphrase, data []byte) ([]byte, error)
- func AESEncryptBuf(passphrase string, buf *core.Buffer) (bufout *core.Buffer, err error)
- func AbsPath(rt *Runtime, fname string) (string, error)
- func AbsºInt(x int64) int64
- func AddºBufBuf(left *core.Buffer, right *core.Buffer) (out *core.Buffer)
- func AddºCharChar(left, right int64) string
- func AddºCharStr(left int64, right string) string
- func AddºFloatInt(left float64, right int64) float64
- func AddºIntFloat(left int64, right float64) float64
- func AddºStrChar(left string, right int64) string
- func AppendFileºStrBuf(rt *Runtime, filename string, buf *core.Buffer) error
- func AppendFileºStrStr(rt *Runtime, filename, s string) error
- func ArchiveName(finfo *Struct, root string) string
- func ArgCount(rt *Runtime) int64
- func Args(rt *Runtime) *core.Array
- func ArgsTail(rt *Runtime) *core.Array
- func ArgsºStr(rt *Runtime, flag string) *core.Array
- func ArgºStr(rt *Runtime, flag string) string
- func ArgºStrInt(rt *Runtime, flag string, def int64) (int64, error)
- func ArgºStrStr(rt *Runtime, flag, def string) string
- func AssignAddºArr(dest interface{}, src interface{}) (interface{}, error)
- func AssignAddºArrAny(arr interface{}, value interface{}) (interface{}, error)
- func AssignAddºBufBuf(buf interface{}, value interface{}) (interface{}, error)
- func AssignAddºBufChar(buf interface{}, value interface{}) (interface{}, error)
- func AssignAddºBufInt(buf interface{}, value interface{}) (interface{}, error)
- func AssignAddºBufStr(buf interface{}, value interface{}) (interface{}, error)
- func AssignAddºFloatFloat(ptr *float64, value float64) (float64, error)
- func AssignAddºIntInt(ptr *int64, value int64) (int64, error)
- func AssignAddºObj(obj interface{}, value interface{}) (interface{}, error)
- func AssignAddºSetSet(set interface{}, value interface{}) (interface{}, error)
- func AssignAddºStrChar(ptr *string, value interface{}) (string, error)
- func AssignAddºStrStr(ptr *string, value interface{}) (string, error)
- func AssignBitAndºIntInt(ptr *int64, value int64) (int64, error)
- func AssignBitOrºIntInt(ptr *int64, value int64) (int64, error)
- func AssignBitXorºIntInt(ptr *int64, value int64) (int64, error)
- func AssignDivºFloatFloat(ptr *float64, value float64) (float64, error)
- func AssignDivºIntInt(ptr *int64, value int64) (int64, error)
- func AssignLShiftºIntInt(ptr *int64, value int64) (int64, error)
- func AssignModºIntInt(ptr *int64, value int64) (int64, error)
- func AssignMulºFloatFloat(ptr *float64, value float64) (float64, error)
- func AssignMulºIntInt(ptr *int64, value int64) (int64, error)
- func AssignRShiftºIntInt(ptr *int64, value int64) (int64, error)
- func AssignSubºFloatFloat(ptr *float64, value float64) (float64, error)
- func AssignSubºIntInt(ptr *int64, value int64) (int64, error)
- func AssignºObjAny(ptr interface{}, value interface{}) (interface{}, error)
- func AssignºObjBool(ptr interface{}, value interface{}) (interface{}, error)
- func AssignºStrBool(ptr *string, value interface{}) (string, error)
- func AssignºStrInt(ptr *string, value interface{}) (string, error)
- func Base64ºBuf(buf *core.Buffer) string
- func BaseName(fname string) string
- func BitAndºSetSet(left *core.Set, right *core.Set) *core.Set
- func BitNotºSet(set *core.Set) *core.Set
- func BitOrºSetSet(left *core.Set, right *core.Set) *core.Set
- func CeilºFloat(val float64) int64
- func ChDirºStr(rt *Runtime, dirname string) error
- func ChModeºStr(rt *Runtime, name string, mode int64) error
- func CheckPlaygroundLimits(vm *VM, fname string, size int64) error
- func ClearCarriage(input string) string
- func CloseFile(file *core.File) error
- func CloseTarGz(gzfile *GzFile) (err error)
- func CloseZip(zfile *ZipFile) (err error)
- func Command(rt *Runtime, cmdLine string) error
- func CommandOutput(rt *Runtime, cmdLine string) (string, error)
- func CompressFile(rt *Runtime, pack Pack, filename, packname string) error
- func CopyFileºStrStr(rt *Runtime, src, dest string) (int64, error)
- func CopyVar(rt *Runtime, ptr *interface{}, value interface{})
- func CreateDirºStr(rt *Runtime, dirname string) error
- func CreateFileºStrBool(rt *Runtime, filename string, always int64) error
- func CtxGetºStr(rt *Runtime, key string) (string, error)
- func CtxIsºStr(rt *Runtime, key string) int64
- func CtxSetºStrBool(rt *Runtime, key string, value int64) (string, error)
- func CtxSetºStrFloat(rt *Runtime, key string, value float64) (string, error)
- func CtxSetºStrInt(rt *Runtime, key string, value int64) (string, error)
- func CtxSetºStrStr(rt *Runtime, key, value string) (string, error)
- func CtxValueºStr(rt *Runtime, key string) string
- func CtxºStr(rt *Runtime, input string) (string, error)
- func DaysºTime(it *Struct) int64
- func DecodeºBufInt(buf *core.Buffer, offset int64) (int64, error)
- func DeinitPlayground(vm *VM)
- func DelºBufIntInt(buf *core.Buffer, off, length int64) (*core.Buffer, error)
- func DelºMapStr(pmap *core.Map, key string) *core.Map
- func DerivePassphrase(passphrase, salt []byte, keyLen int) ([]byte, []byte, error)
- func Dir(fname string) string
- func DivºFloatInt(left float64, right int64) (float64, error)
- func DivºIntFloat(left int64, right float64) (float64, error)
- func Download(rt *Runtime, url, filename string) (written int64, err error)
- func EncodeºBufInt(buf *core.Buffer, i int64) *core.Buffer
- func EqualºFloatInt(left float64, right int64) int64
- func EqualºTimeTime(left, right *Struct) int64
- func ErrFormat(path string, line, pos int64, message string) string
- func ErrID(err *RuntimeError) int64
- func ErrText(err *RuntimeError) string
- func ErrTrace(rt *Runtime, err *RuntimeError) *core.Array
- func ErrorText(id int) string
- func ExistFile(rt *Runtime, filename string) (int64, error)
- func ExpStrºBool(left string, right int64) string
- func ExpStrºChar(left string, right int64) string
- func ExpStrºFloat(left string, right float64) string
- func ExpStrºInt(left string, right int64) string
- func ExpStrºObj(left string, right *core.Obj) string
- func Ext(fname string) string
- func FileInfoToPath(finfo *Struct) string
- func FileModeºStr(rt *Runtime, name string) (int64, error)
- func FindFirstRegExpºStrStr(src, rePattern string) (*core.Array, error)
- func FindRegExpºStrStr(src, rePattern string) (*core.Array, error)
- func FindºStrStr(s, substr string) (off int64)
- func FloorºFloat(val float64) int64
- func FormatºStr(pattern string, pars ...interface{}) string
- func FormatºTimeStr(layout string, t *Struct) string
- func GetCurDir() (string, error)
- func GetEnv(name string) string
- func GreaterºCharChar(left, right int64) int64
- func GreaterºFloatInt(left float64, right int64) int64
- func GreaterºTimeTime(left, right *Struct) int64
- func HTTPGet(rt *Runtime, url string) (buf *core.Buffer, err error)
- func HTTPPage(rt *Runtime, url string) (string, error)
- func HTTPRequest(rt *Runtime, urlPath string, method string, params *core.Map, ...) (ret string, err error)
- func HasPrefixºStrStr(s, prefix string) int64
- func HasSuffixºStrStr(s, suffix string) int64
- func HexºBuf(buf *core.Buffer) string
- func IfaceToObj(val interface{}) (*core.Obj, error)
- func IncDecºInt(ptr *int64, shift int64) (int64, error)
- func InitPlayground(settings *Settings) (err error)
- func InsertºBufIntBuf(buf *core.Buffer, off int64, b *core.Buffer) (*core.Buffer, error)
- func IsArgºStr(rt *Runtime, flag string) int64
- func IsArrayºObj(obj *core.Obj) int64
- func IsEmptyDir(rt *Runtime, path string) (ret int64, err error)
- func IsKeyºMapStr(pmap *core.Map, key string) int64
- func IsMapºObj(obj *core.Obj) int64
- func IsNil(val *core.Obj) int64
- func IsSet(set *core.Set, index int64) int64
- func ItemºObjInt(val *core.Obj, ind int64) (ret *core.Obj, err error)
- func ItemºObjStr(val *core.Obj, key string) (ret *core.Obj, err error)
- func JoinPath(pars ...interface{}) string
- func JoinºArrStr(value *core.Array, sep string) string
- func Json(obj *core.Obj) (ret string, err error)
- func JsonToObj(input string) (ret *core.Obj, err error)
- func KeyºMapInt(pmap *core.Map, index int64) (string, error)
- func LeftºStrInt(s string, count int64) string
- func LessºCharChar(left, right int64) int64
- func LessºFloatInt(left float64, right int64) int64
- func LessºTimeTime(left, right *Struct) int64
- func LinesºStr(in string) *core.Array
- func Lock(rt *Runtime)
- func LowerºStr(s string) string
- func MatchPath(pattern, fname string) (int64, error)
- func MatchºStrStr(s string, rePattern string) (int64, error)
- func MaxºFloatFloat(left, right float64) float64
- func MaxºIntInt(left, right int64) int64
- func Md5FileºStr(rt *Runtime, filename string) (string, error)
- func Md5ºBuf(in *core.Buffer) (out *core.Buffer)
- func Md5ºStr(in string) (out *core.Buffer)
- func MinºFloatFloat(left, right float64) float64
- func MinºIntInt(left, right int64) int64
- func MulºFloatInt(left float64, right int64) float64
- func MulºIntFloat(left int64, right float64) float64
- func ObjºFinfo(finfo *Struct) *core.Obj
- func OpenFileºStr(rt *Runtime, fname string, flags int64) (ret *core.File, err error)
- func OpenWithºStr(rt *Runtime, app, fname string) error
- func OpenºStr(rt *Runtime, fname string) error
- func PlaygroundAbsPath(vm *VM, fname string) (ret string, err error)
- func PlaygroundSize(vm *VM, fname string) (int64, error)
- func Print(pars ...interface{}) (int64, error)
- func PrintShiftºStr(par string) (int64, error)
- func Println(pars ...interface{}) (int64, error)
- func ProgressEnd(rt *Runtime, id int64)
- func ProgressInc(rt *Runtime, id, inc int64)
- func ProgressStart(rt *Runtime, total int64, ptype int64, src, dest string) int64
- func Random(limit int64) int64
- func RandomBuf(size int64) (buf *core.Buffer, err error)
- func RandomBytes(size int) (ret []byte, err error)
- func ReadDirºStr(rt *Runtime, dirname string) (*core.Array, error)
- func ReadDirºStrArr(rt *Runtime, dirname string, flags int64, patterns *core.Array, ...) (*core.Array, error)
- func ReadDirºStrIntStr(rt *Runtime, dirname string, flags int64, pattern string) (*core.Array, error)
- func ReadFileºStr(rt *Runtime, filename string) (string, error)
- func ReadFileºStrBuf(rt *Runtime, filename string, buf *core.Buffer) (*core.Buffer, error)
- func ReadFileºStrIntInt(rt *Runtime, filename string, off int64, length int64) (buf *core.Buffer, err error)
- func ReadString(rt *Runtime, text string) (string, error)
- func ReadTarGz(rt *Runtime, filename string) (*core.Array, error)
- func ReadZip(rt *Runtime, zipfile string) (*core.Array, error)
- func ReadºFileInt(file *core.File, size int64) (*core.Buffer, error)
- func RegExpºStrStr(src, rePattern string) (ret string, err error)
- func RemoveDirºStr(rt *Runtime, dirname string) error
- func RemoveºStr(rt *Runtime, filename string) error
- func RenameºStrStr(rt *Runtime, oldname, newname string) error
- func RepeatºStrInt(input string, count int64) string
- func ReplaceRegExpºStrStr(src, rePattern, repl string) (string, error)
- func ReplaceºStrStrStr(in, old, new string) string
- func ReverseºArr(arr *core.Array) *core.Array
- func RightºStrInt(s string, count int64) string
- func RoundºFloat(val float64) int64
- func RoundºFloatInt(val float64, digits int64) float64
- func Run(exec *core.Exec, settings Settings) (interface{}, error)
- func SetEnv(rt *Runtime, name string, value interface{}) (string, error)
- func SetEnvBool(rt *Runtime, name string, value int64) (string, error)
- func SetFileTimeºStrTime(rt *Runtime, name string, ftime *Struct) error
- func SetLenºBuf(buf *core.Buffer, size int64) (*core.Buffer, error)
- func SetPosºFileIntInt(file *core.File, off int64, whence int64) (int64, error)
- func SetThreadData(rt *Runtime, obj *core.Obj)
- func SetºSet(set *core.Set, index int64) (*core.Set, error)
- func Sha256FileºStr(rt *Runtime, filename string) (string, error)
- func Sha256ºBuf(in *core.Buffer) (out *core.Buffer)
- func Sha256ºStr(in string) (out *core.Buffer)
- func ShiftºStr(par string) string
- func SizeToStr(size int64, format string) string
- func SliceºArr(rt *Runtime, arr *core.Array, start, end int64) (*core.Array, error)
- func SortºArr(value *core.Array) *core.Array
- func SplitCmdLine(cmdline string) (ret *core.Array)
- func SplitºStrStr(in, sep string) *core.Array
- func StructDecode(input *core.Buffer, pstruct *Struct) (err error)
- func StructEncode(pstruct *Struct) (ret *core.Buffer, err error)
- func StrºTime(it *Struct) string
- func Subbuf(buf *core.Buffer, off int64, size int64) (*core.Buffer, error)
- func SubstrºStrIntInt(in string, off, length int64) (string, error)
- func SubºFloatInt(left float64, right int64) float64
- func SubºIntFloat(left int64, right float64) float64
- func TarGz(rt *Runtime, targzfile string, path string) error
- func TempDir() string
- func TempDirºStrStr(rt *Runtime, dir, prefix string) (string, error)
- func ThreadData(rt *Runtime) (*core.Obj, error)
- func ToggleºSetInt(set *core.Set, index int64) (prev int64, err error)
- func Trace(rt *Runtime) *core.Array
- func TrimLeftºStr(in string, set string) string
- func TrimRightºStr(in string, set string) string
- func TrimSpaceºStr(in string) string
- func TrimºStr(in string, set string) string
- func Type(val *core.Obj) string
- func UnBase64ºStr(value string) (buf *core.Buffer, err error)
- func UnHexºStr(value string) (*core.Buffer, error)
- func UnSetºSet(set *core.Set, index int64) (*core.Set, error)
- func Unlock(rt *Runtime)
- func UnpackTarGz(rt *Runtime, filename string, dir string) error
- func UnpackTarGzºStr(rt *Runtime, filename string, dir string, patterns *core.Array, ...) error
- func UnpackZip(rt *Runtime, zipfile string, dir string) error
- func UnpackZipºStr(rt *Runtime, zipfile string, dir string, patterns *core.Array, ...) error
- func UnsetEnv(rt *Runtime, name string) error
- func UpperºStr(s string) string
- func WaitAll(rt *Runtime) error
- func WaitDone(rt *Runtime) error
- func WaitGroup(rt *Runtime, count int64) error
- func WeekdayºTime(rt *Runtime, t *Struct) int64
- func WriteFileºFileBuf(rt *Runtime, file *core.File, buf *core.Buffer) (*core.File, error)
- func WriteFileºStrBuf(rt *Runtime, filename string, buf *core.Buffer) error
- func WriteFileºStrStr(rt *Runtime, filename, in string) error
- func WriteºBuf(buf *core.Buffer, offset int64, input *core.Buffer) (*core.Buffer, error)
- func YearDayºTime(t *Struct) int64
- func ZipºStr(rt *Runtime, zipfile string, path string) error
- type Call
- type Const
- type Fn
- type GzFile
- type OptValue
- type Pack
- type Playground
- type PlaygroundFS
- type Progress
- type ProgressFunc
- type ProgressReader
- type ProgressWriter
- type Runtime
- type RuntimeError
- type Settings
- type Struct
- func AddHoursºTimeInt(rt *Runtime, it *Struct, hours int64) *Struct
- func DateTimeºInts(rt *Runtime, year, month, day, hour, minute, second int64) *Struct
- func DateºInts(rt *Runtime, year, month, day int64) *Struct
- func FileInfoºFile(rt *Runtime, file *core.File) (*Struct, error)
- func FileInfoºStr(rt *Runtime, name string) (*Struct, error)
- func HeadInfo(rt *Runtime, url string) (*Struct, error)
- func NewStruct(rt *Runtime, sInfo *core.StructInfo) *Struct
- func Now(rt *Runtime) *Struct
- func ParseTimeºStrStr(rt *Runtime, layout, value string) (*Struct, error)
- func UTCºTime(rt *Runtime, local *Struct) *Struct
- type Thread
- type TraceInfo
- type UntargzFile
- type UnzipFile
- type VM
- type ZipFile
Constants ¶
const ( // CtxChar is a context boundery character CtxChar = '#' // CtxLength is the max length of the context key CtxLength = 64 // CtxDeep is the max deep in replace function CtxDeep = 16 )
const ( AESKey = 32 SaltLen = 16 )
const ( // ErrRunIndex is returned when Run has been executed with wrong index ErrRunIndex = iota + 1 // ErrDepth is returned when maximum depth of recursion has been reached ErrDepth // ErrDivZero is returned when there is division by zero ErrDivZero // ErrCycle is returned when maximum cycle count has been reached ErrCycle // ErrShift is returned when << or >> are used with the negative right operand ErrShift // ErrStrToInt is returned when the conversion string to integer is invalid ErrStrToInt // ErrStrToFloat is returned when the conversion string to float is invalid ErrStrToFloat // ErrEmptyCommand is returned if empty command is specified in $ ErrEmptyCommand // ErrQuoteCommand is returned if there is an unclosed quotation mark in $ command ErrQuoteCommand // ErrIndexOut means that int index is out of the length of the array ErrIndexOut // ErrMapIndex is returned when there is not the key in the map ErrMapIndex // ErrAssignment is returned when there is a recursive assignment ErrAssignment // ErrUndefined means that the value of the variable is undefined ErrUndefined // ErrByteOut is returned when value for buf is greater 255 ErrByteOut // ErrInvalidParam is returned when the function gets invalid parameter(s) ErrInvalidParam // ErrNotRun is returned when the executing unit doesn't have run function ErrNotRun // ErrFnEmpty is returned in case of calling undefined fn variable ErrFnEmpty // ErrThreadIndex is returned when the index of the thread is out of range ErrThreadIndex // ErrThreadClosed is generated when the thread has been closed ErrThreadClosed // ErrPlatform is generated when the function is not supported on the current platform ErrPlatform // ErrObjValue is returned when obj has wrong type ErrObjValue // ErrCustom is generated when there is an invalid custom declaration ErrCustom // ErrCRC is returned when Exec was compiled with different stdlib or custom functions ErrCRC // ErrMainThread is returned when the function is called in go thread ErrMainThread // ErrThread is returned when the function is called in main thread ErrThread // ErrObjNil is returned when the object value is undefined ErrObjNil // ErrObjArr is returned when the object must contains array ErrObjArr // ErrObjMap is returned when the object must contains map ErrObjMap // ErrObjType is returned when the value has incompatible type ErrObjType // ErrTerminated is returned when the script has been terminated by owner ErrTerminated // ErrExit is returned when exit function has been called ErrExit // ErrPlayCycle is returned when maximum cycle count has been reached in Playground mode ErrPlayCycle // ErrPlayRun is returned on starting any processes in Playground mode ErrPlayRun // ErrPlayEnv is returned on setting environment in Playground mode ErrPlayEnv // ErrPlayAccess is returned on access denied error in Playground mode ErrPlayAccess // ErrPlayCount is returned when files count limit is exceeded in Playground mode ErrPlayCount // ErrPlaySize is returned when the file size limit reached in Playground mode ErrPlaySize // ErrPlayAllSize is returned when the summary files size limit reached in Playground mode ErrPlayAllSize // ErrPlayDepth is returned when maximum depth of recursion has been reached om Playground mode ErrPlayDepth // ErrPlayFunc is returned on calling disabled function in Playground mode ErrPlayFunc // ErrDecode is returned if decoding error occurs ErrDecode // ErrEmbedded means golang error in embedded functions ErrEmbedded = 254 // ErrRuntime error. It means bug ErrRuntime = 255 )
const ( Recursive = 0x01 OnlyFiles = 0x02 RegExp = 0x04 OnlyDirs = 0x08 FileCreate = 0x01 FileTrunc = 0x02 FileReadonly = 0x04 )
const ( NoLimit = -1 ClearSize = -2 DeleteSize = -3 DeleteAllSize = -4 )
const ( ProgressCopy = iota ProgressDownload ProgressCompress ProgressDecompress ProgressCompressCounter = 200 ProgressDecompressCounter = 201 ProgStatusStart = 0 ProgStatusActive = 1 ProgStatusEnd = 2 )
const ( TRACESTRUCT = iota TIMESTRUCT FINFOSTRUCT HINFOSTRUCT )
const ( BININT = binary.MaxVarintLen64 + iota BINCHAR BINSTR BINFLOAT BINBUF )
const ( // ThQueue means that the thread is in the queue to start ThQueue = iota // ThWork means that the thread is running ThWork // ThPaused means that the thread has been suspended ThPaused // ThWait means that the thread is waiting for the end of another thread ThWait // ThFinished means that the thread finished ThFinished // ThError means that the thread has been closed with an error ThError // ThClosed means that the thread has been closed ThClosed )
const ( // ThCmdClose closes the thread ThCmdClose = iota // ThCmdResume resumes the thread ThCmdResume // ThCmdContinue continues the thread after waiting ThCmdContinue )
const ( STACKSIZE = 256 // CYCLE is the limit of loops CYCLE = uint64(16000000) // DEPTH is the maximum size of blocks stack DEPTH = uint32(1000) )
const ( SysSuspend SysResume SysTerminate )
const ( // SleepStep is a tick in sleep SleepStep = int64(100) )
const StdLibCount = 365
Variables ¶
var ( // ErrCtxLength is returned when the key is too long ErrCtxLength = `key length is longer than %d characters` // ErrCtxLoop is returned when there is a loop in values of context ErrCtxLoop = `%s key refers to itself` // ErrCtxDeep is returned if the maximum depth reached ErrCtxDeep = `maximum depth reached` )
var CRCCustom uint64
var CRCStdlib uint64
var EmbedFuncs = []core.Embed{}/* 365 elements not displayed */
Functions ¶
func AESDecrypt ¶ added in v1.18.0
func AESDecryptBuf ¶ added in v1.18.0
AESDecrypt(str, buf) buf
func AESEncrypt ¶ added in v1.18.0
func AESEncryptBuf ¶ added in v1.18.0
AESEncrypt(str, buf) buf
func AddºBufBuf ¶ added in v1.7.0
AddºBufBuf adds two buffers
func AddºCharChar ¶ added in v1.7.0
AddºCharChar adds two rune values
func AddºCharStr ¶ added in v1.7.0
AddºCharStr appends rune to string
func AddºFloatInt ¶ added in v1.7.0
AddºFloatInt adds float and int
func AddºIntFloat ¶ added in v1.7.0
AddºIntFloat adds int and float
func AddºStrChar ¶ added in v1.7.0
AddºStrChar appends rune to string
func AppendFileºStrBuf ¶ added in v1.7.0
AppendFileºStrBuf appends a buffer to a file
func AppendFileºStrStr ¶ added in v1.7.0
AppendFileºStrStr appends a string to a file
func ArchiveName ¶ added in v1.20.0
func ArgºStrInt ¶ added in v1.6.0
ArgºStrInt returns the number value of the command-line option or the default value
func ArgºStrStr ¶ added in v1.6.0
ArgºStrStr returns the value of the command-line option or the default value
func AssignAddºArr ¶ added in v1.7.0
func AssignAddºArr(dest interface{}, src interface{}) (interface{}, error)
AssignAddºArr appends one array to another one
func AssignAddºArrAny ¶ added in v1.7.0
func AssignAddºArrAny(arr interface{}, value interface{}) (interface{}, error)
AssignAddºArrAny appends an item to array
func AssignAddºBufBuf ¶ added in v1.7.0
func AssignAddºBufBuf(buf interface{}, value interface{}) (interface{}, error)
AssignAddºBufBuf appends buffer to buffer
func AssignAddºBufChar ¶ added in v1.7.0
func AssignAddºBufChar(buf interface{}, value interface{}) (interface{}, error)
AssignAddºBufChar appends rune to buffer
func AssignAddºBufInt ¶ added in v1.7.0
func AssignAddºBufInt(buf interface{}, value interface{}) (interface{}, error)
AssignAddºBufInt appends one byte to buffer
func AssignAddºBufStr ¶ added in v1.7.0
func AssignAddºBufStr(buf interface{}, value interface{}) (interface{}, error)
AssignAddºBufStr appends string to buffer
func AssignAddºFloatFloat ¶ added in v1.7.0
AssignAddºFloatFloat adds one float to another
func AssignAddºIntInt ¶ added in v1.7.0
AssignAddºIntInt adds one integer to another
func AssignAddºObj ¶ added in v1.16.0
func AssignAddºObj(obj interface{}, value interface{}) (interface{}, error)
AssignAddºObj appends an item to object array
func AssignAddºSetSet ¶ added in v1.7.0
func AssignAddºSetSet(set interface{}, value interface{}) (interface{}, error)
AssignAddºSetSet appends set to set
func AssignAddºStrChar ¶ added in v1.7.0
AssignAddºStrChar appends one rune to string
func AssignAddºStrStr ¶ added in v1.7.0
AssignAddºStrStr appends one string to another
func AssignBitAndºIntInt ¶ added in v1.7.0
AssignBitAndºIntInt equals int &= int
func AssignBitOrºIntInt ¶ added in v1.7.0
AssignBitOrºIntInt equals int |= int
func AssignBitXorºIntInt ¶ added in v1.7.0
AssignBitXorºIntInt equals int ^= int
func AssignDivºFloatFloat ¶ added in v1.7.0
AssignDivºFloatFloat does float /= float
func AssignDivºIntInt ¶ added in v1.7.0
AssignDivºIntInt does int /= int
func AssignLShiftºIntInt ¶ added in v1.7.0
AssignLShiftºIntInt does int <<= int
func AssignModºIntInt ¶ added in v1.7.0
AssignModºIntInt equals int %= int
func AssignMulºFloatFloat ¶ added in v1.7.0
AssignMulºFloatFloat equals float *= float
func AssignMulºIntInt ¶ added in v1.7.0
AssignMulºIntInt equals int *= int
func AssignRShiftºIntInt ¶ added in v1.7.0
AssignRShiftºIntInt does int >>= int
func AssignSubºFloatFloat ¶ added in v1.7.0
AssignSubºFloatFloat equals float *= float
func AssignSubºIntInt ¶ added in v1.7.0
AssignSubºIntInt equals int *= int
func AssignºObjAny ¶ added in v1.8.0
func AssignºObjAny(ptr interface{}, value interface{}) (interface{}, error)
AssignºObjAny assigns integer, float, str, arr, map to obj
func AssignºObjBool ¶ added in v1.8.0
func AssignºObjBool(ptr interface{}, value interface{}) (interface{}, error)
AssignºObjBool assigns bool to obj
func AssignºStrBool ¶ added in v1.7.0
AssignºStrBool assigns boolean to string
func AssignºStrInt ¶ added in v1.7.0
AssignºStrInt assigns integer to string
func Base64ºBuf ¶ added in v1.7.0
Base64ºBuf encodes buf to base64 string
func BitAndºSetSet ¶ added in v1.7.0
BitAndºSetSet equals set & set
func BitNotºSet ¶ added in v1.7.0
BitNotºSet changes boolean value of set
func BitOrºSetSet ¶ added in v1.7.0
BitOrºSetSet equals set & set
func CeilºFloat ¶ added in v1.7.0
CeilºFloat returns the least integer value greater than or equal to val.
func ChModeºStr ¶ added in v1.9.0
ChModeºStr change the file mode.
func CheckPlaygroundLimits ¶ added in v1.14.0
func ClearCarriage ¶ added in v1.9.0
ClearCarriage deletes output before carriage return character
func CloseTarGz ¶ added in v1.20.0
CloseTarGz closes the created tar.gz file
func CommandOutput ¶ added in v1.7.0
CommandOutput executes the command line and returns the standard output
func CompressFile ¶ added in v1.20.0
func CopyFileºStrStr ¶ added in v1.7.0
CopyFileºStrStr copies a file
func CopyVar ¶ added in v1.6.0
func CopyVar(rt *Runtime, ptr *interface{}, value interface{})
CopyVar copies one object to another one
func CreateDirºStr ¶ added in v1.7.0
CreateDirºStr creates the directory(s)
func CreateFileºStrBool ¶ added in v1.12.0
CreateFileºStrBool creates an empty file
func CtxGetºStr ¶ added in v1.6.0
CtxGetºStr replaces context values in the value of the key
func CtxSetºStrBool ¶ added in v1.6.0
CtxSetºStrBool assign a bool to a context key
func CtxSetºStrFloat ¶ added in v1.6.0
CtxSetºStrFloat assign a float to a context key
func CtxSetºStrInt ¶ added in v1.6.0
CtxSetºStrInt assign an integer to a context key
func CtxSetºStrStr ¶ added in v1.6.0
CtxSetºStrStr sets a context value
func CtxValueºStr ¶ added in v1.6.0
CtxValueºStr returns a context value
func DecodeºBufInt ¶ added in v1.19.0
DecodeºBufInt decodes int from buf
func DeinitPlayground ¶ added in v1.14.0
func DeinitPlayground(vm *VM)
DeinitPlayground removes playground files
func DelºBufIntInt ¶ added in v1.7.0
DelºBufIntInt deletes part of the buffer
func DelºMapStr ¶ added in v1.7.0
DelºMapStr deletes key and value from the map
func DerivePassphrase ¶ added in v1.18.0
func DivºFloatInt ¶ added in v1.7.0
DivºFloatInt divides one float by int
func DivºIntFloat ¶ added in v1.7.0
DivºIntFloat divides one int by float
func EncodeºBufInt ¶ added in v1.19.0
EncodeºBufInt encodes int to buf
func EqualºFloatInt ¶ added in v1.7.0
EqualºFloatInt returns true if left == right
func EqualºTimeTime ¶ added in v1.6.0
EqualºTimeTime returns true if time structures are equal
func ErrText ¶ added in v1.6.0
func ErrText(err *RuntimeError) string
ErrText returns the text of the error
func ErrTrace ¶ added in v1.6.0
func ErrTrace(rt *Runtime, err *RuntimeError) *core.Array
ErrTrace returns the trace of the error
func ExpStrºBool ¶ added in v1.7.0
ExpStrºBool adds string and boolean in string expression
func ExpStrºChar ¶ added in v1.7.0
ExpStrºChar adds string and char in string expression
func ExpStrºFloat ¶ added in v1.7.0
ExpStrºFloat adds string and float in string expression
func ExpStrºInt ¶ added in v1.7.0
ExpStrºInt adds string and integer in string expression
func ExpStrºObj ¶ added in v1.8.0
ExpStrºObj adds string and obj in string expression
func FileInfoToPath ¶ added in v1.20.0
FileInfoToPath return the full name of the file from finfo
func FileModeºStr ¶ added in v1.9.0
FileModeºStr returns the file mode.
func FindFirstRegExpºStrStr ¶ added in v1.17.0
FindFirstRegExpºStrStr returns an array of the first successive matches of the expression
func FindRegExpºStrStr ¶ added in v1.7.0
FindRegExpºStrStr returns an array of all successive matches of the expression
func FindºStrStr ¶ added in v1.7.0
FindºStrStr returns the index of the first instance of substr
func FloorºFloat ¶ added in v1.7.0
FloorºFloat returns the greatest integer value less than or equal to val.
func FormatºStr ¶ added in v1.7.0
FormatºStr formats according to a format specifier and returns the resulting string
func FormatºTimeStr ¶ added in v1.6.0
FormatºTimeStr formats the time
func GreaterºCharChar ¶ added in v1.7.0
GreaterºCharChar returns true if left > right
func GreaterºFloatInt ¶ added in v1.7.0
GreaterºFloatInt returns true if left > right
func GreaterºTimeTime ¶ added in v1.6.0
GreaterºTimeTime returns true if left time structures are greater than right
func HTTPPage ¶ added in v1.7.0
HTTPPage issues a GET to the specified URL and returns a string result.
func HTTPRequest ¶ added in v1.13.0
func HTTPRequest(rt *Runtime, urlPath string, method string, params *core.Map, headers *core.Map) (ret string, err error)
HTTPRequest send HTTP request to the specified URL and returns a string result.
func HasPrefixºStrStr ¶ added in v1.7.0
HasPrefixºStrStr returns true if the string s begins with prefix
func HasSuffixºStrStr ¶ added in v1.7.0
HasSuffixºStrStr returns true if the string s ends with suffix
func IfaceToObj ¶ added in v1.21.0
func IncDecºInt ¶ added in v1.7.0
IncDecºInt incriment and decriment
func InitPlayground ¶ added in v1.14.0
InitPlayground inits playground settings
func InsertºBufIntBuf ¶ added in v1.7.0
InsertºBufIntBuf inserts one buf object into another one
func IsArrayºObj ¶ added in v1.16.0
IsArrayºObj returns true if the object is an array
func IsEmptyDir ¶ added in v1.17.0
IsEmptyDir returns true if the specified folder is empty
func IsKeyºMapStr ¶ added in v1.7.0
IsKeyºMapStr returns true if there is the key in the map
func ItemºObjInt ¶ added in v1.16.0
ItemºObjInt returns an item from array object
func ItemºObjStr ¶ added in v1.16.0
ItemºObjStr returns an item from map object
func JoinPath ¶ added in v1.7.0
func JoinPath(pars ...interface{}) string
JoinPath joins any number of path elements into a single path.
func JoinºArrStr ¶ added in v1.7.0
JoinºArrStr concatenates the elements of a to create a single string.
func KeyºMapInt ¶ added in v1.7.0
KeyºMapInt returns the key by the index
func LeftºStrInt ¶ added in v1.7.0
LeftºStrInt cuts the string.
func LessºCharChar ¶ added in v1.7.0
LessºCharChar returns true if left < right
func LessºFloatInt ¶ added in v1.7.0
LessºFloatInt returns true if left < right
func LessºTimeTime ¶ added in v1.6.0
LessºTimeTime returns true if left time structures are less than right
func LowerºStr ¶ added in v1.7.0
LowerºStr converts a copy of the string to their lower case and returns it.
func MatchPath ¶ added in v1.7.0
MatchPath reports whether name matches the specified file name pattern.
func MatchºStrStr ¶ added in v1.7.0
MatchºStrStr reports whether the string s contains any match of the regular expression
func MaxºFloatFloat ¶ added in v1.7.0
MaxºFloatFloat returns the maximum of two float numbers
func MaxºIntInt ¶ added in v1.7.0
MaxºIntInt returns the maximum of two integers
func Md5FileºStr ¶ added in v1.7.0
Md5FileºStr returns md5 hash of the file as a hex string
func MinºFloatFloat ¶ added in v1.7.0
MinºFloatFloat returns the minimum of two float numbers
func MinºIntInt ¶ added in v1.7.0
MinºIntInt returns the minimum of two integers
func MulºFloatInt ¶ added in v1.7.0
MulºFloatInt multiplies float and int
func MulºIntFloat ¶ added in v1.7.0
MulºIntFloat multiplies int and float
func OpenFileºStr ¶ added in v1.19.0
func OpenWithºStr ¶ added in v1.6.0
OpenWithºStr runs the application with the specified file.
func PlaygroundAbsPath ¶ added in v1.14.0
func PrintShiftºStr ¶ added in v1.7.0
PrintShiftºStr writes to standard output with trim spaces characters in the each line.
func ProgressEnd ¶ added in v1.15.0
func ProgressInc ¶ added in v1.15.0
func ProgressStart ¶ added in v1.15.0
func RandomBytes ¶ added in v1.18.0
func ReadDirºStr ¶ added in v1.6.0
ReadDirºStr reads a directory
func ReadDirºStrArr ¶ added in v1.17.0
func ReadDirºStrArr(rt *Runtime, dirname string, flags int64, patterns *core.Array, ignore *core.Array) (*core.Array, error)
ReadDirºStrArr reads a directory with additional settings
func ReadDirºStrIntStr ¶ added in v1.11.0
func ReadDirºStrIntStr(rt *Runtime, dirname string, flags int64, pattern string) (*core.Array, error)
ReadDirºStrIntStr reads a directory with additional settings
func ReadFileºStr ¶ added in v1.7.0
ReadFileºStr reads a file
func ReadFileºStrBuf ¶ added in v1.7.0
ReadFileºStrBuf reads a file to buffer
func ReadFileºStrIntInt ¶ added in v1.7.0
func ReadFileºStrIntInt(rt *Runtime, filename string, off int64, length int64) (buf *core.Buffer, err error)
ReadFileºStrIntInt reads a part of the file to the buffer
func ReadString ¶ added in v1.7.0
ReadString reads a string from standard input.
func ReadºFileInt ¶ added in v1.19.0
func RegExpºStrStr ¶ added in v1.8.0
RegExpºStrStr returns the first found match of the expression
func RemoveDirºStr ¶ added in v1.7.0
RemoveDirºStr removes a directory
func RemoveºStr ¶ added in v1.7.0
RemoveºStr removes a file or an empty directory
func RenameºStrStr ¶ added in v1.7.0
RenameºStrStr renames a file or a directory
func RepeatºStrInt ¶ added in v1.7.0
RepeatºStrInt returns a new string consisting of count copies of the specified string.
func ReplaceRegExpºStrStr ¶ added in v1.7.0
ReplaceRegExpºStrStr returns a copy of src, replacing matches of the Regexp with the replacement string
func ReplaceºStrStrStr ¶ added in v1.7.0
ReplaceºStrStrStr replaces strings in a string
func ReverseºArr ¶ added in v1.7.0
ReverseºArr reverses an array
func RightºStrInt ¶ added in v1.8.0
RightºStrInt returns the right substring of the string.
func RoundºFloat ¶ added in v1.7.0
RoundºFloat returns the nearest integer, rounding half away from zero.
func RoundºFloatInt ¶ added in v1.7.0
RoundºFloatInt returns a number with the specified number of decimal places.
func SetEnvBool ¶ added in v1.7.0
SetEnvBool assign the value to the environment variable
func SetFileTimeºStrTime ¶ added in v1.6.0
SetFileTimeºStrTime changes the modification time of the named file
func SetLenºBuf ¶ added in v1.19.0
SetLenºBuf sets the length of the buffer
func SetPosºFileIntInt ¶ added in v1.19.0
SetPosºFileIntInt sets the postion in the file
func SetThreadData ¶ added in v1.22.0
SetThreadData sets Data parameter of the thread
func Sha256FileºStr ¶ added in v1.7.0
Sha256FileºStr returns sha256 hash of the file as a hex string
func Sha256ºBuf ¶ added in v1.7.0
Sha256ºBuf returns md5 hash of the buffer
func Sha256ºStr ¶ added in v1.7.0
Sha256ºStr returns md5 hash of the string as hex string
func ShiftºStr ¶ added in v1.7.0
ShiftºStr trims white spaces characters in the each line of the string.
func SplitCmdLine ¶ added in v1.10.0
SplitCmdLine splits the command line parameters to the array of strings
func SplitºStrStr ¶ added in v1.7.0
SplitºStrStr splits a string to a array of strings
func StructDecode ¶ added in v1.18.0
StructDecode decodes buffer to struct variable
func StructEncode ¶ added in v1.18.0
StructEncode encodes struct variable to buffer
func SubstrºStrIntInt ¶ added in v1.7.0
SubstrºStrIntInt returns a substring with the specified offset and length
func SubºFloatInt ¶ added in v1.7.0
SubºFloatInt subtracts float and int
func SubºIntFloat ¶ added in v1.7.0
SubºIntFloat subtracts int and float
func TempDirºStrStr ¶ added in v1.7.0
TempDirºStrStr creates a directory in the temporary directory
func ThreadData ¶ added in v1.22.0
ThreadData returns Data parameter of the thread
func ToggleºSetInt ¶ added in v1.7.0
ToggleºSetInt changes the value of the set
func TrimLeftºStr ¶ added in v1.8.0
TrimLeftºStr returns a substring of the string with all leading characters in set removed.
func TrimRightºStr ¶ added in v1.7.0
TrimRightºStr returns a substring of the string with all trailing characters in set removed.
func TrimSpaceºStr ¶ added in v1.7.0
TrimSpaceºStr trims white space in a string
func TrimºStr ¶ added in v1.8.0
TrimºStr returns a substring of the string with all leading and trailing characters in set removed.
func UnBase64ºStr ¶ added in v1.7.0
UnBase64ºStr decodes base64 string to buf
func UnpackTarGz ¶ added in v1.20.0
UnpackTarGz unpacks a .tar.gz file to the specified folder
func UnpackTarGzºStr ¶ added in v1.20.0
func UnpackTarGzºStr(rt *Runtime, filename string, dir string, patterns *core.Array, ignore *core.Array) error
UnpackTarGzºStr unpacks a .tar.gz file to the specified folder
func UnpackZipºStr ¶ added in v1.20.0
func UnpackZipºStr(rt *Runtime, zipfile string, dir string, patterns *core.Array, ignore *core.Array) error
UnpackZipºStr unpacks a zip file to the specified folder
func UpperºStr ¶ added in v1.7.0
UpperºStr converts a copy of the string to their upper case and returns it.
func WeekdayºTime ¶ added in v1.6.0
WeekdayºTime returns the day of the week specified by t.
func WriteFileºFileBuf ¶ added in v1.19.0
WriteFileºFileBuf writes a buffer to a file
func WriteFileºStrBuf ¶ added in v1.7.0
WriteFileºStrBuf writes a buffer to a file
func WriteFileºStrStr ¶ added in v1.7.0
WriteFileºStrStr writes a string to a file
func YearDayºTime ¶ added in v1.6.0
YearDayºTime returns the day of the year specified by t.
Types ¶
type Call ¶
type Call struct { IsFunc bool IsLocal bool Cycle uint64 Offset int32 Int int32 Float int32 Str int32 Any int32 Optional *[]OptValue // for loop blocks Flags int16 Start int32 Continue int32 // shift for continue Break int32 // shift for break Try int32 // shift for try Recover int32 // shift for recover Retry int32 // shift for retry }
Call stores stack of blocks
type Fn ¶ added in v1.6.0
type Fn struct {
Func int32 // id of function
}
Fn is used for custom func types
type GzFile ¶ added in v1.20.0
func CreateTarGz ¶ added in v1.20.0
CreateTarGz creates tar.gz file and returns its handle
type Playground ¶ added in v1.14.0
type PlaygroundFS ¶ added in v1.14.0
type Progress ¶ added in v1.15.0
type Progress struct { ID uint32 Type int32 Status int32 Total int64 Current int64 Source string Dest string Ratio float64 Custom interface{} // contains filtered or unexported fields }
func NewProgress ¶ added in v1.15.0
type ProgressFunc ¶ added in v1.15.0
type ProgressReader ¶ added in v1.15.0
type ProgressReader struct { *Progress // contains filtered or unexported fields }
func NewProgressReader ¶ added in v1.15.0
func NewProgressReader(reader io.Reader, progress *Progress) *ProgressReader
type ProgressWriter ¶ added in v1.20.0
type ProgressWriter struct { *Progress // contains filtered or unexported fields }
func NewProgressWriter ¶ added in v1.20.0
func NewProgressWriter(writer io.Writer, progress *Progress) *ProgressWriter
type Runtime ¶
type Runtime struct { Owner *VM ParCount int32 Calls []Call Thread Thread ThreadID int64 Optional *[]OptValue Data *core.Obj // gentee embedded object Custom interface{} // embedded structure // These are stacks for different types SInt [STACKSIZE]int64 // int, char, bool SFloat [STACKSIZE]float64 // float SStr [STACKSIZE]string // str SAny [STACKSIZE]interface{} // all other types }
Runtime is the one thread structure
type RuntimeError ¶ added in v1.6.0
RuntimeError is a runtime error type
func (*RuntimeError) Error ¶ added in v1.6.0
func (re *RuntimeError) Error() string
type Struct ¶ added in v1.6.0
type Struct struct { Type *core.StructInfo Values []interface{} // Values of fields }
Struct is used for custom struct types
func AddHoursºTimeInt ¶ added in v1.6.0
AddHoursºTimeInt adds/subtract hours
func DateTimeºInts ¶ added in v1.6.0
DateTimeºInts returns time
func FileInfoºFile ¶ added in v1.19.0
FileInfoºFile sets returns the finfo of the file
func FileInfoºStr ¶ added in v1.6.0
FileInfoºStr returns the finfo describing the named file.
func NewStruct ¶ added in v1.6.0
func NewStruct(rt *Runtime, sInfo *core.StructInfo) *Struct
NewStruct creates a new struct object
func ParseTimeºStrStr ¶ added in v1.6.0
ParseTimeºStrStr parses a formatted string and returns the time value it represents
type TraceInfo ¶ added in v1.6.0
type TraceInfo struct { Path string // the full path name of the source Entry string // the entry function name Func string // the called function Line int64 // line position in the source Pos int64 // column position in the line }
TraceInfo is a structure for stack func info
type UntargzFile ¶ added in v1.20.0
type UnzipFile ¶ added in v1.20.0
type UnzipFile struct { Name string Reader *zip.ReadCloser }
type VM ¶
type VM struct { Settings Settings Exec *core.Exec Consts map[int32]Const Runtimes []*Runtime CtxMutex sync.RWMutex ThreadMutex sync.RWMutex LockMutex sync.Mutex WaitGroup sync.WaitGroup Unique *sync.Map // now for progress Context map[string]string Count int64 // count of active threads WaitCount int64 Stopped bool ChCount chan int64 ChError chan error ChWait chan int64 Playground PlaygroundFS }
VM is the main structure of the virtual machine