respond

package
v0.0.0-...-f97ce34 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Respond

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

func (*Respond) ErrorBadRequest

func (r *Respond) ErrorBadRequest(w http.ResponseWriter, err error)

func (*Respond) ErrorForbidden

func (r *Respond) ErrorForbidden(w http.ResponseWriter, err error)

func (*Respond) ErrorInternal

func (r *Respond) ErrorInternal(w http.ResponseWriter, err error)

func (*Respond) ErrorUnauthorized

func (r *Respond) ErrorUnauthorized(w http.ResponseWriter, err error)

func (*Respond) SendJSON

func (r *Respond) SendJSON(w http.ResponseWriter, responseData interface{})

type Responder

type Responder interface {
	SendJSON(w http.ResponseWriter, responseData interface{})

	ErrorUnauthorized(w http.ResponseWriter, err error)
	ErrorBadRequest(w http.ResponseWriter, err error)
	ErrorForbidden(w http.ResponseWriter, err error)
	ErrorInternal(w http.ResponseWriter, err error)
}

func NewResponder

func NewResponder(logger *zap.Logger) (Responder, error)

Jump to

Keyboard shortcuts

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