web

package
v0.3.97 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(c *config.Web)

func Resource

func Resource(path string, resource ResourceHandler, opts ...func(*ngamux.HttpServeMux))

func Router

func Router() *ngamux.HttpServeMux

func Server

func Server() *http.Server

func WithResourceMiddleware

func WithResourceMiddleware(middlewares ...ngamux.MiddlewareFunc) func(*ngamux.HttpServeMux)

Types

type HttpResponse added in v0.3.97

type HttpResponse struct {
	*ngamux.Response
}

func NewResponse added in v0.3.97

func NewResponse(w http.ResponseWriter) *HttpResponse

func (HttpResponse) Accepted added in v0.3.97

func (ctx HttpResponse) Accepted(body ...any) error

func (HttpResponse) BadRequest added in v0.3.97

func (ctx HttpResponse) BadRequest(body ...any) error

func (HttpResponse) Conflict added in v0.3.97

func (ctx HttpResponse) Conflict(body ...any) error

func (HttpResponse) Created added in v0.3.97

func (ctx HttpResponse) Created(body ...any) error

func (HttpResponse) Forbidden added in v0.3.97

func (ctx HttpResponse) Forbidden(body ...any) error

func (HttpResponse) InternalServerError added in v0.3.97

func (ctx HttpResponse) InternalServerError(body ...any) error

func (HttpResponse) NoContent added in v0.3.97

func (ctx HttpResponse) NoContent() error

func (HttpResponse) NotFound added in v0.3.97

func (ctx HttpResponse) NotFound(body ...any) error

func (HttpResponse) Ok added in v0.3.97

func (ctx HttpResponse) Ok(body ...any) error

func (HttpResponse) Unauthorized added in v0.3.97

func (ctx HttpResponse) Unauthorized(body ...any) error

type ResourceHandler

type ResourceHandler interface {
	Index(http.ResponseWriter, *http.Request)
	Show(http.ResponseWriter, *http.Request)
	Store(http.ResponseWriter, *http.Request)
	Update(http.ResponseWriter, *http.Request)
	Destroy(http.ResponseWriter, *http.Request)
}

Jump to

Keyboard shortcuts

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