modules

package
v0.0.0-...-8d6e374 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoArg = errors.New("No argument exists at that name")

Functions

This section is empty.

Types

type Args

type Args map[string]interface{}

func (Args) GetInt

func (args Args) GetInt(name string) (int, error)

GetInt takes the name of an argument and returns an integer and an error

func (Args) GetString

func (args Args) GetString(name string) (string, error)

GetString takes the name of an argument and returns a string and an error.

type Function

type Function func(Args, Args) error

Function is the signature of a module function, it takes two argument maps -- one for input and one for output. The function will return an appropriate error on failure.

func FindFunction

func FindFunction(module string, name string) Function

FindFunction finds a function based on a given module and name in our registered modules

type Functions

type Functions map[string]Function

Functions is a map of string names to module functions

type Module

type Module struct {
	Name      string
	Functions Functions
}

The Module struct binds a map of Functions to a module name

func Register

func Register(name string, functions Functions) *Module

Register creates a new module and adds it to the registered list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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