Home

Awesome

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);