wrap

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Http

func Http(fn HttpFunc) http.HandlerFunc

Http returns a http.HandlerFunc that wraps a HttpFunc capable of convenient return types.

func WebSocketTransport added in v0.1.15

func WebSocketTransport(fn func(t transport.Transport) error, options *websocket.AcceptOptions) http.HandlerFunc

WebSocketTransport returns a http.HandlerFunc that wraps a websocket setup/teardown into a transport.Transport which sends and receives JSON packets.

Types

type HttpFunc

type HttpFunc func(http.ResponseWriter, *http.Request) interface{}

HttpFunc is a handler used by Http which allows generating simple result types. Return nil to skip the built-in behavior.

Jump to

Keyboard shortcuts

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