controller

package
v0.0.0-...-d098346 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorStatus

func NewErrorStatus(err error, code int) error

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

func ErrorInfo

func ErrorInfo(err error) (ErrorResponse, int)

type ErrorStatus

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

func (ErrorStatus) Unwrap

func (e ErrorStatus) Unwrap() error

type Handler

type Handler struct {
	Hndl HandlerProvider
}

func NewHandler

func NewHandler(s service.ServiceProvider) *Handler

type HandlerProvider

type HandlerProvider interface {
	Mux() *http.ServeMux
	CreateJoke(w http.ResponseWriter, r *http.Request) error
	GetJoke(w http.ResponseWriter, r *http.Request) error
	GetAllJokes(w http.ResponseWriter, r *http.Request) error
	UpdateJoke(w http.ResponseWriter, r *http.Request) error
	DeleteJoke(w http.ResponseWriter, r *http.Request) error
}

Jump to

Keyboard shortcuts

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