fn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package fn provides the interfaces and functions necessary to create functions for fnrun. This is the only package that is necessary for developers to use if they are using fnrun as a library to build functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fn

type Fn interface {
	Invoke(context.Context, interface{}) (interface{}, error)
}

Fn represents a function that encapsulates some application functionality.

Fn implementations may contain the functionality directly or facilitate some process by which the functionality is invoked.

func NewFnFromInvokeFunc

func NewFnFromInvokeFunc(i InvokeFunc) Fn

NewFnFromInvokeFunc wraps an InvokeFunc in an Fn and returns the result.

type InvokeFunc

type InvokeFunc func(context.Context, interface{}) (interface{}, error)

InvokeFunc is an adapter to allow the use of ordinary functions as the basis for an Fn.

Jump to

Keyboard shortcuts

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