funker

package module
v0.0.0-...-eaa0a2e Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2016 License: Apache-2.0 Imports: 6 Imported by: 64

README

Funker for Go

A Go implementation of Funker.

## Usage

Defining functions:

package main

import "github.com/bfirsh/funker-go"

type addArgs struct {
  X int `json:"x"`
  Y int `json:"y"`
}

func main() {
    err := funker.Handle(func(args *addArgs) int {
      return args.X + args.Y;
    });
    if err != nil {
      panic(err);
    }
}

Calling functions:

ret, err := funker.Call(addArgs{X: 1, Y: 2});
if err != nil {
  panic(err);
}
fmt.PrintLn(ret);

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(name string, args interface{}) (interface{}, error)

Call a Funker function

func Handle

func Handle(handler interface{}) error

Handle a Funker function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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