handler

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogID   string
	Timeout time.Duration
}

type Handler

type Handler struct {
	Config
	// Must always return a valid HTTP status code, for both nil and non-nil error.
	Fun      func(context.Context, http.ResponseWriter, *http.Request) (int, error)
	Endpoint types.Endpoint
	Method   string
}

Handler implements the http.Handler interface

func (Handler) Register added in v0.7.0

func (h Handler) Register(mux *http.ServeMux, prefix string)

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is part of the http.Handler interface

Jump to

Keyboard shortcuts

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