endpoint

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypeMismatch = errors.New("type mismatch")
)
View Source
var (
	StreamDone = errors.New("stream done")
)

Functions

This section is empty.

Types

type BiStream

type BiStream[IN, OUT any] func(ctx context.Context, receiver <-chan IN) (Receive[OUT], error)

type Endpoint

type Endpoint[IN, OUT any] interface {
	Unary[IN, OUT] | InnerStream[IN, OUT] | OuterStream[IN, OUT] | BiStream[IN, OUT]
}

type InnerStream

type InnerStream[IN, OUT any] func(ctx context.Context, request IN) (Receive[OUT], error)

type OuterStream

type OuterStream[IN, OUT any] func(ctx context.Context, receiver <-chan IN) (response OUT, err error)

type Receive

type Receive[T any] func() (T, error)

type Unary

type Unary[IN, OUT any] func(ctx context.Context, request IN) (response OUT, err error)

func FromKit

func FromKit[IN, OUT any](e kit.Endpoint) Unary[IN, OUT]

func (Unary[IN, OUT]) Kit

func (e Unary[IN, OUT]) Kit() kit.Endpoint

Jump to

Keyboard shortcuts

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