web

package
v0.3.98 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 Request added in v0.3.98

type Request struct {
	*ngamux.Request
	// contains filtered or unexported fields
}

func NewRequest added in v0.3.98

func NewRequest(r *http.Request) *Request

func (*Request) ToHttp added in v0.3.98

func (r *Request) ToHttp() *http.Request

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)
}

type Response added in v0.3.98

type Response struct {
	*ngamux.Response
}

func NewResponse added in v0.3.97

func NewResponse(w http.ResponseWriter) *Response

func (Response) Accepted added in v0.3.98

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

func (Response) BadRequest added in v0.3.98

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

func (Response) Conflict added in v0.3.98

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

func (Response) Created added in v0.3.98

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

func (Response) Forbidden added in v0.3.98

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

func (Response) InternalServerError added in v0.3.98

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

func (Response) NoContent added in v0.3.98

func (ctx Response) NoContent() error

func (Response) NotFound added in v0.3.98

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

func (Response) Ok added in v0.3.98

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

func (Response) Unauthorized added in v0.3.98

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

Jump to

Keyboard shortcuts

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