httpserver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest    = errors.New("bad request")
	ErrForbidden     = errors.New("forbidden")
	ErrNotFound      = errors.New("not found")
	ErrUnprocessable = errors.New("unprocessable")
	ErrInternalError = errors.New("internal server error")
)

Functions

func Err

func Err(status int, w http.ResponseWriter, err error) error

func JSON

func JSON(status int, w http.ResponseWriter, data any) error

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(
	ctx context.Context,
	di *container.Container,
	logger zerolog.Logger,
) *Server

func (*Server) Register

func (s *Server) Register()

func (*Server) Route

func (s *Server) Route(
	name string,
	pattern string,
	f HandlerFunc,
)

func (*Server) Serve

func (s *Server) Serve()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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