Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func AddBuiltins(symbolTable *symbols.SymbolTable)
- func AddFunction(s *symbols.SymbolTable, fd FunctionDefinition) error
- func Append(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func AsString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func BlockFonts(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func BlockPrint(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func CallBuiltin(s *symbols.SymbolTable, name string, args ...interface{}) (interface{}, error)
- func Chars(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Chdir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Chmod(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Chown(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func CipherRandom(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Clearenv(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Close(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func CloseAny(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Compare(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Contains(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ContainsAny(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Count(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func CreateToken(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func DecodeBase64(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Decrypt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func DeepCopy(source interface{}, depth int) interface{}
- func Delete(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func DeleteFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func EncodeBase64(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Encrypt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Environ(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func EqualFold(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Exec(s *symbols.SymbolTable, args []interface{}) (result interface{}, err error)
- func Executable(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Exit(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Expand(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ExpandPath(path, ext string) ([]string, error)
- func Extract(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Fields(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func FindName(f func(*symbols.SymbolTable, []interface{}) (interface{}, error)) string
- func Format(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func FormatAsString(s *symbols.SymbolTable, v interface{}) string
- func GetArgs(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func GetEnv(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func GetMode(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func GetName(f NativeFunction) string
- func Hash(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Hostname(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func I18nLanguage(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func I18nT(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Index(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func InternalCast(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Ints(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func JSONMarshal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func JSONMarshalIndent(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func JSONUnmarshal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Join(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Left(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Length(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Log(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func LogTail(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Lower(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Make(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func MakeTime(t *time.Time) interface{}
- func Max(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func MemStats(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Members(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Min(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func New(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Normalize(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func OpenFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Packages(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ParseURLPattern(url, pattern string) (map[string]interface{}, bool)
- func PathAbs(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func PathBase(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func PathClean(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func PathDir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func PathExt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func PathJoin(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Print(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Printf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Println(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ProfileDelete(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ProfileGet(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ProfileKeys(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ProfileSet(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Random(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ReadDir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ReadFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ReadString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Reflect(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Right(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Seal(i interface{}) interface{}
- func SetLogger(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Signal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SizeOf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sleep(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sort(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortBytes(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortFloat32s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortFloat64s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortFloats(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortInt32s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortInt64s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortInts(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func SortStrings(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Split(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sprintf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sqrt(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sscanf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvAtoi(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvFormatBool(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvFormatFloat(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvFormatInt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvItoa(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvQuote(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrConvUnquote(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func StrLen(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Substring(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Sum(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Template(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeAdd(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeFormat(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeNow(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeParse(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeSince(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeSleep(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func TimeSub(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func ToString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Tokenize(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Truncate(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Type(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func URLPattern(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func UUIDNew(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func UUIDNil(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func UUIDParse(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Upper(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Validate(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func Write(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func WriteAt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func WriteFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- func WriteString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
- type AuthToken
- type FunctionDefinition
- type MultiValueReturn
- type NativeFunction
- type NativeFunctionDef
Constants ¶
const Any = math.MaxInt32
Any is a constant that defines that a function can have as many arguments as desired.
const MaxDeepCopyDepth = 100
For a new() on an object, we won't recursively copy objects nested more deeply than this. Setting this too small will prevent complex structures from copying correctly. Too large, and memory could be swallowed whole.
Variables ¶
var FunctionDictionary = map[string]FunctionDefinition{}/* 127 elements not displayed */
FunctionDictionary is the dictionary of functions. As functions are determined to allow the return of both a value and an error as multi-part results, add the ErrReturn:true flag to each function definition.
var NativeFunctionMap = []NativeFunctionDef{ { Kind: data.WaitGroupType, Name: "Wait", F: waitGroupWait, }, { Kind: data.WaitGroupType, Name: "Add", F: waitGroupAdd, }, { Kind: data.WaitGroupType, Name: "Done", F: waitGroupDone, }, { Kind: data.PointerType(data.WaitGroupType), Name: "Wait", F: waitGroupWait, }, { Kind: data.PointerType(data.WaitGroupType), Name: "Add", F: waitGroupAdd, }, { Kind: data.PointerType(data.WaitGroupType), Name: "Done", F: waitGroupDone, }, { Kind: data.MutexType, Name: "Lock", F: mutexLock, }, { Kind: data.MutexType, Name: "Unlock", F: mutexUnlock, }, { Kind: data.PointerType(data.MutexType), Name: "Lock", F: mutexLock, }, { Kind: data.PointerType(data.MutexType), Name: "Unlock", F: mutexUnlock, }, }
NativeFunctionMap defines, for each combination of data type and function name, specify the native function handler for that type. For example, a sync.WaitGroup has Add(), Done(), and Wait() methods and are all shown here. This table is used by the Member opcode to check to see if the member index is into a natively implemented type...
Functions ¶
func Abs ¶
func Abs(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Abs implements the abs() function.
func AddBuiltins ¶
func AddBuiltins(symbolTable *symbols.SymbolTable)
AddBuiltins adds or overrides the default function library in the symbol map. Function names are distinct in the map because they always have the "()" suffix for the key.
func AddFunction ¶
func AddFunction(s *symbols.SymbolTable, fd FunctionDefinition) error
func Append ¶
func Append(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Append implements the builtin append() function, which concatenates all the items together as an array. The first argument is flattened into the result, and then each additional argument is added to the array as-is.
func AsString ¶
func AsString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func BlockFonts ¶
func BlockFonts(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func BlockPrint ¶
func BlockPrint(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func CallBuiltin ¶
func CallBuiltin(s *symbols.SymbolTable, name string, args ...interface{}) (interface{}, error)
func Chars ¶
func Chars(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Chars implements the strings.chars() function. This accepts a string value and converts it to an array of characters.
func Chdir ¶
func Chdir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Chdir implements the os.Chdir() function.
func Chmod ¶
func Chmod(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Chmod implements the os.Chmod() function.
func Chown ¶
func Chown(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Chown implements the os.Chown() function.
func CipherRandom ¶
func CipherRandom(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Random implements the cipher.Random() function which generates a random token string value using the cryptographic random number generator.
func Clearenv ¶
func Clearenv(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Clearenv implements the os.Clearenv() function.
func Close ¶
func Close(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Close closes a file.
func CloseAny ¶
func CloseAny(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
This is the generic close() which can be used to close a channel or a file, and maybe later other items as well.
func Compare ¶
func Compare(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Compare().
func Contains ¶
func Contains(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Contains().
func ContainsAny ¶
func ContainsAny(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Contains().
func Count ¶
func Count(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Count().
func CreateToken ¶
func CreateToken(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
CreateToken creates a new token with a username and a data payload.
func DecodeBase64 ¶
func DecodeBase64(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
DecodeBase64 encodes a string as a BASE64 string using standard encoding rules.
func Decrypt ¶
func Decrypt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Decrypt implements the cipher.Decrypt() function. It accepts an encrypted string and a key, and attempts to decode the string. If the string is not a valid encryption using the given key, an empty string is returned. It is an error if the string does not contain a valid hexadecimal character string.
func DeepCopy ¶
func DeepCopy(source interface{}, depth int) interface{}
DeepCopy makes a deep copy of an Ego data type. It should be called with the maximum nesting depth permitted (i.e. array index->array->array...). Because it calls itself recursively, this is used to determine when to give up and stop traversing nested data. The default is MaxDeepCopyDepth.
func Delete ¶
func Delete(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Delete can be used three ways. To delete a member from a structure, to delete an element from an array by index number, or to delete a symbol entirely. The first form requires a string name, the second form requires an integer index, and the third form does not have a second parameter.
func DeleteFile ¶
func DeleteFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
DeleteFile deletes a file.
func EncodeBase64 ¶
func EncodeBase64(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
EncodeBase64 encodes a string as a BASE64 string using standard encoding rules.
func Encrypt ¶
func Encrypt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Encrypt implements the cipher.Encrypt() function. This takes a string value and a string key, and encrypts the string using the key.
func Environ ¶
func Environ(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Environ implements the os.Environ() function.
func EqualFold ¶
func EqualFold(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.EqualFold().
func Exec ¶
func Exec(s *symbols.SymbolTable, args []interface{}) (result interface{}, err error)
Exec implements the util.Exec() function. This should be replaced with a proper emulation of the Go command object type in the future.
func Executable ¶
func Executable(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Executable implements the os.Executable() function.
func Exit ¶
func Exit(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Exit implements the os.exit() function.
func Expand ¶
func Expand(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Expand expands a list of file or path names into a list of files.
func ExpandPath ¶
ExpandPath is used to expand a path into a list of file names. This is also used elsewhere to product path lists, so it must be an exported symbol.
func Extract ¶
func Extract(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Extract extracts the data from a token and returns it as a struct.
func Fields ¶
func Fields(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Fields().
func FindName ¶
func FindName(f func(*symbols.SymbolTable, []interface{}) (interface{}, error)) string
FindName returns the name of a function from the dictionary if one is found.
func Format ¶
func Format(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Format implements the strings.format() function.
func FormatAsString ¶
func FormatAsString(s *symbols.SymbolTable, v interface{}) string
FormatAsString will attempt to use the String() function of the object type passed in, if it is a typed struct. Otherwise, it just returns the Unquoted format value.
func GetArgs ¶
func GetArgs(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
GetArgs implements util.Args() which fetches command-line arguments from the Ego command invocation, if any.
func GetEnv ¶
func GetEnv(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
GetEnv implements the util.getenv() function which reads an environment variable from the os.
func GetMode ¶
func GetMode(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
GetMode implements the util.Mode() function which reports the runtime mode.
func GetName ¶
func GetName(f NativeFunction) string
func Hash ¶
func Hash(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Hash implements the cipher.hash() function. For an arbitrary string value, it computes a crypotraphic hash of the value, and returns it as a 32-character string containing the hexadecimal hash value. Hashes are irreversible.
func Hostname ¶
func Hostname(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
func I18nLanguage ¶
func I18nLanguage(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func I18nT ¶
func I18nT(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func Index ¶
func Index(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Index implements the index() function.
func InternalCast ¶
func InternalCast(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Compiler-generate casting; generally always array types. This is used to convert numeric arrays to a different kind of array, to convert a string to an array of integer (rune) values, etc.
func Ints ¶
func Ints(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Ints implements the strings.ints() function. This accepts a string value and converts it to an array of integer rune values.
func JSONMarshal ¶
func JSONMarshal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
JSONMarshal writes a JSON string from arbitrary data.
func JSONMarshalIndent ¶
func JSONMarshalIndent(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
JSONMarshalIndent writes a JSON string from arbitrary data.
func JSONUnmarshal ¶
func JSONUnmarshal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
JSONUnmarshal reads a string as JSON data.
func Join ¶
func Join(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Wrapper around strings.Join().
func Left ¶
func Left(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Left implements the left() function.
func Length ¶
func Length(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Length implements the len() function.
func Log ¶
func Log(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Log is the log() function.
func LogTail ¶
func LogTail(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
LogTail implements the util.Log(n) function, which returns the last 'n' lines from the current.
func Lower ¶
func Lower(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Lower implements the lower() function.
func Make ¶
func Make(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Make implements the make() function. The first argument must be a model of the array type (using the Go native version), and the second argument is the size.
func Max ¶
func Max(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Max implements the max() function.
func MemStats ¶
func MemStats(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func Members ¶
func Members(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Members gets an array of the names of the fields in a structure.
func Min ¶
func Min(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Min implements the min() function.
func New ¶
func New(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
New implements the new() function. If an integer type number or a string type name is given, the "zero value" for that type is returned. For an array, struct, or map, a recursive copy is done of the members to a new object which is returned.
func Normalize ¶
func Normalize(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Normalize coerces a value to match the type of a model value.
func OpenFile ¶
func OpenFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
OpenFile opens a file.
func Packages ¶
func Packages(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func ParseURLPattern ¶
ParseURLPattern accepts a pattern that tells what part of the URL is meant to be literal, and what is a user-supplied item. The result is a map of the URL items parsed.
If the pattern is
"/services/debug/processes/{{ID}}"
and the url is
/services/debug/processses/1653
Then the result map will be
map[string]interface{} { "ID" : 1653 }
func PathAbs ¶
func PathAbs(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func PathBase ¶
func PathBase(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func PathClean ¶
func PathClean(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func PathDir ¶
func PathDir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func PathExt ¶
func PathExt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func PathJoin ¶
func PathJoin(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Given a list of path components, connect them together in the syntax supported by the host platform as a file system path. Resolve duplicate separators.
func Print ¶
func Print(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Print implements fmt.Print() and is a wrapper around the native Go function.
func Printf ¶
func Printf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Printf implements fmt.printf() and is a wrapper around the native Go function.
func Println ¶
func Println(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Println implements fmt.Println() and is a wrapper around the native Go function.
func ProfileDelete ¶
func ProfileDelete(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
ProfileDelete implements the profile.delete() function. This just calls the set operation with an empty value, which results in a delete operatinon. The consolidates the persmission checking, etc. in the Set routine only.
func ProfileGet ¶
func ProfileGet(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
ProfileGet implements the profile.get() function.
func ProfileKeys ¶
func ProfileKeys(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
ProfileKeys implements the profile.keys() function.
func ProfileSet ¶
func ProfileSet(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
ProfileSet implements the profile.set() function.
func Random ¶
func Random(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Random implmeents the math.Random function.
func ReadDir ¶
func ReadDir(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
ReadDir implements the io.readdir() function.
func ReadFile ¶
func ReadFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
ReadFile reads a file contents into a string value.
func ReadString ¶
func ReadString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
ReadString reads the next line from the file as a string.
func Reflect ¶
func Reflect(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func Right ¶
func Right(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Right implements the right() function.
func SetLogger ¶
func SetLogger(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
SetLogger implements the util.SetLogger() function. This sets a logger to be enabled or disabled, and returns the previous state of the logger. It is an error to specify a non-existent logger name. Logger names are not case sensitive.
func Signal ¶
func Signal(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Signal creates an error object based on the parameters.
func SizeOf ¶
func SizeOf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SizeOf returns the size in bytes of an arbibrary object.
func Sleep ¶
func Sleep(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Sleep implements util.sleep().
func Sort ¶
func Sort(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Sort implements the sort.Sort() function, whichi sorts an array regardless of it's type.
func SortBytes ¶
func SortBytes(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortBytes implements the sort.Bytes function.
func SortFloat32s ¶
func SortFloat32s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortFloat32s implements the sort.Float32s function.
func SortFloat64s ¶
func SortFloat64s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortFloat64s implements the sort.Float64s function.
func SortFloats ¶
func SortFloats(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortFloats implements the sort.Floats function.
func SortInt32s ¶
func SortInt32s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortInt32s implements the sort.Int32s function.
func SortInt64s ¶
func SortInt64s(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortInt64s implements the sort.Int64s function.
func SortInts ¶
func SortInts(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortInts implements the sort.Ints function.
func SortStrings ¶
func SortStrings(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
SortStrings implements the sort.Strings function.
func Split ¶
func Split(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Split splits a string into lines separated by a newline. Optionally a different delimiter can be supplied as the second argument.
func Sprintf ¶
func Sprintf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Sprintf implements fmt.sprintf() and is a wrapper around the native Go function.
func Sqrt ¶
func Sqrt(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Sqrt implements the sqrt() function.
func Sscanf ¶
func Sscanf(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvAtoi ¶
func StrConvAtoi(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvFormatBool ¶
func StrConvFormatBool(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvFormatFloat ¶
func StrConvFormatFloat(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvFormatInt ¶
func StrConvFormatInt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvItoa ¶
func StrConvItoa(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvQuote ¶
func StrConvQuote(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrConvUnquote ¶
func StrConvUnquote(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func StrLen ¶
func StrLen(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
StrLen is the strings.Length() function, which counts characters/runes instead of bytes like len() does.
func Substring ¶
func Substring(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Substring implements the substring() function.
func Sum ¶
func Sum(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Sum implements the sum() function.
func Template ¶
func Template(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Template implements the strings.template() function.
func TimeAdd ¶
func TimeAdd(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeAdd implements time.duration().
func TimeFormat ¶
func TimeFormat(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeFormat implements time.Format().
func TimeNow ¶
func TimeNow(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeNow implements time.now().
func TimeParse ¶
func TimeParse(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeParse time.Parse().
func TimeSince ¶
func TimeSince(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func TimeSleep ¶
func TimeSleep(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeSleep implements time.SleepUntil().
func TimeString ¶
func TimeString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeFormat implements time.Format().
func TimeSub ¶
func TimeSub(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
TimeSub implements time.duration().
func ToString ¶
func ToString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
ToString implements the strings.string() function, which accepts an array of items and converts it to a single long string of each item. Normally , this is an array of characters.
func Tokenize ¶
func Tokenize(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Tokenize splits a string into tokens.
func Truncate ¶
func Truncate(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
func Type ¶
func Type(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Type implements the type() function.
func URLPattern ¶
func URLPattern(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
URLPattern uses ParseURLPattern and then puts the result in a native Ego map structure.
func UUIDNew ¶
func UUIDNew(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
UUIDNew implements the uuid.New() function.
func UUIDNil ¶
func UUIDNil(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
UUIDNil implements the uuid.Nil() function.
func UUIDParse ¶
func UUIDParse(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
UUIDParse implements the uuid.Parse() function.
func Upper ¶
func Upper(symbols *symbols.SymbolTable, args []interface{}) (interface{}, error)
Upper implements the upper() function.
func Validate ¶
func Validate(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Validate determines if a token is valid and returns true/false.
func Write ¶
func Write(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Write writes an arbitrary binary object to a file.
func WriteAt ¶
func WriteAt(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
Write writes an arbitrary binary object to a file at an offset.
func WriteFile ¶
func WriteFile(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
WriteFile writes a string to a file.
func WriteString ¶
func WriteString(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
WriteString writes a string value to a file.
Types ¶
type AuthToken ¶
type AuthToken struct { Name string Data string TokenID uuid.UUID Expires time.Time AuthID uuid.UUID }
AuthToken is the Go native expression of a token value, which contains the identity of the creator, an arbitrary data payload, an expiration time after which the token is no longer valid, a unique ID for this token, and the unique ID of the Ego session that created the token.
type FunctionDefinition ¶
type FunctionDefinition struct { Name string Pkg string Min int Max int ErrReturn bool FullScope bool F interface{} V interface{} D *data.FunctionDeclaration }
FunctionDefinition is an element in the function dictionary.
func FindFunction ¶
func FindFunction(f func(*symbols.SymbolTable, []interface{}) (interface{}, error)) *FunctionDefinition
FindFunction returns the function definition associated with the provided function pointer, if one is found.
type MultiValueReturn ¶
type MultiValueReturn struct {
Value []interface{}
}
MultiValueReturn is a type used to return a list of values from a builtin function. This an be used to return a result and an err to the caller, for example. The Value list must contain the values in the order received by the caller.
type NativeFunction ¶
type NativeFunction func(s *symbols.SymbolTable, args []interface{}) (interface{}, error)
func FindNativeFunction ¶
func FindNativeFunction(kind *data.Type, name string) NativeFunction
For a given datatype and name, see if there is a native function that supports this operation. If so, return it's function pointer.
type NativeFunctionDef ¶
type NativeFunctionDef struct { Kind *data.Type Name string F NativeFunction }