router

package
v0.0.0-...-f23880e Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderError

func RenderError(ctx context.Context, w http.ResponseWriter, err errors.CustomError)

RenderError Renders an error with some sane defaults.

func RenderJSON

func RenderJSON(ctx context.Context, w http.ResponseWriter, httpStatusCode int, payload any)

RenderJSON is a helper function to write a JSON response

Types

type HTTPRouter

type HTTPRouter struct {
	Mux *chi.Mux
	// contains filtered or unexported fields
}

func NewHTTPRouter

func NewHTTPRouter(cfgs config.ServerConfigurations) *HTTPRouter

func (*HTTPRouter) Shutdown

func (s *HTTPRouter) Shutdown(ctx context.Context)

func (*HTTPRouter) Start

func (s *HTTPRouter) Start()

Jump to

Keyboard shortcuts

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