lib

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LibList        = map[string]FuncMap{}
	ErrNotLib      = errors.New("'%s' is not a library")
	ErrNotFunction = errors.New("in lib %s, '%s' is not a function")
	ErrNumReturn   = errors.New("in lib %s, '%s()' return incorrect number of values")
	ErrReturnTypes = errors.New("in lib %s, '%s()' does not return (interface{}, error)")
)
View Source
var (
	ErrNotALibrary = errors.New("'%s' is not a known library")
)

Functions

func Add

func Add(libName string, functions FuncMap)

Adds inclusion map to global include list if lib name is required

func CallFunc

func CallFunc(name string, function i, args []interface{}) (val i, err error)

Calls library function from fizz process. Uses reflect to get arg number and types from function. This means the types of params matter (but only here). Returns error if args or types dont match. Name of function and name given do not need to match.

func IncludeLibraries

func IncludeLibraries(includes []string) error

Imports all included libs to running fizz process

func PrintDocs added in v1.1.0

func PrintDocs(libname string) error

Prints functions of the given library to the terminal. Returns an error if not a known library name.

func VerifyFunction added in v0.6.0

func VerifyFunction(lib string, fname string, f i) error

Checks if function is valid. Returns error if not.

Types

type FuncMap

type FuncMap map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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