bartender

package module
v0.0.0-...-2b06c38 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2015 License: MIT Imports: 6 Imported by: 0

README

Bartender

This is a library to simplify coding with go-kit, especially with endpoint.

Currently only working on Endpoint related helper functions / types. May add something else in the future.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanEndpoint

func CanEndpoint(fn interface{}) bool

CanEndpoint test if a function can be cast as Endpoint

func Compose

func Compose(fns ...interface{}) (e endpoint.Endpoint, err error)

Compose takes multiple functions and compose them into a single endpoint. The functions will be called in the order of input. The rule to valid compose:

  1. The output variables of any functions should match the types and position of arguments of the next function.
  1. The first function should take a context.Context and 1 other argument.

3. The last function should output 1 variable with 1 error

func Endpoint

func Endpoint(fn interface{}) (e endpoint.Endpoint, err error)

Endpoint wraps a provided function and returns a valid go-kit Endpoint

Types

This section is empty.

Jump to

Keyboard shortcuts

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