Documentation ¶
Overview ¶
Package caller is used to dynamically call functions with data unmarshalled into the functions' first argument. Its main purpose is to hide common unmarshalling code from each function implementation thus reducing boilerplate and making package interaction code sexier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidFunctionType is an error that is returned by the New function // when its argument is not a function. ErrInvalidFunctionType = errors.New("argument must be function") // ErrInvalidFunctionInArguments is an error that is returned by the New // function when its argument-function has a number of input arguments other // than 1. ErrInvalidFunctionInArguments = errors.New("function must have only one input argument") // ErrInvalidFunctionOutArguments is an error that is returned by the New // function when its argument-function returs any values. ErrInvalidFunctionOutArguments = errors.New("function must not have output arguments") )
Functions ¶
This section is empty.
Types ¶
type Caller ¶
type Caller struct { // Unmarshaller is a BYOB unmarshaller function. By default it uses JSON. Unmarshaller func(data []byte, v interface{}) error // contains filtered or unexported fields }
Caller wraps a function and makes it ready to be dynamically called.
Click to show internal directories.
Click to hide internal directories.