Documentation ¶
Index ¶
Constants ¶
View Source
const OperatorKind = "converter"
OperatorKind means opeartor kind. All operators generated in this package are has kind `converter`.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter interface { definition.Operator }
Converter describes a converter.
func For ¶
func For(f interface{}) Converter
For creates converter for a converter func.
A converter func should has signature:
func f(context.Context, string, AnyType) (AnyType, error)
The second parameter is a string that is used to generate error. AnyType can be any type in go. But struct type and built-in data type is recommended.
Click to show internal directories.
Click to hide internal directories.