Help us shape the future of Go! Take the 2026 Go Developer Survey

httpadapter

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, envelope Envelope)

Types

type Envelope

type Envelope struct {
	OK           bool           `json:"ok"`
	Data         any            `json:"data,omitempty"`
	Error        string         `json:"error,omitempty"`
	ErrorCode    string         `json:"error_code,omitempty"`
	ErrorDetails map[string]any `json:"error_details,omitempty"`
}

type Handler

type Handler struct {
	Host                    *host.Host
	WebSecurity             websecurity.Guard
	EnableLocalImportRoutes bool
}

func (Handler) ServeHTTP

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

type Route

type Route struct {
	Method string
	Path   string
}

func RouteSet

func RouteSet() []Route

func RouteSetWithOptions

func RouteSetWithOptions(options RouteSetOptions) []Route

type RouteSetOptions

type RouteSetOptions struct {
	EnableLocalImportRoutes bool
}

Jump to

Keyboard shortcuts

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