bar

package
v0.0.0-...-cee63af Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMap = map[error]resterr.RESTErr{}

ErrMap is the mapping between business layer errors (services) and the JSON errors we want to send back from the REST API.

All expected errors resulting from downstream processing should be mapped here. Errors that are not mapped are sent to the client as a 500 error without details.

Functions

This section is empty.

Types

type BarHandler

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

BarHandler implements HTTP handlers and processes requests related to the bar resource.

func NewHandler

func NewHandler(logger *slog.Logger, barSvc barService, errHandler errHandler) (*BarHandler, error)

NewHandler instantiates a new BarHandler struct.

func (*BarHandler) Get

func (bh *BarHandler) Get(w http.ResponseWriter, r *http.Request)

Get mimics an HTTP handler for fetching a bar resource.

Jump to

Keyboard shortcuts

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