converter

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 1 Imported by: 8

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.

Jump to

Keyboard shortcuts

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