handlers

package
v0.0.0-...-0601c6c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, msg string, logger ...*log.Logger)

func Forbidden

func Forbidden(w http.ResponseWriter, msg string, logger ...*log.Logger)

func InternalServerError

func InternalServerError(w http.ResponseWriter, msg string, logger ...*log.Logger)

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter, logger ...*log.Logger)

func Response

func Response(w http.ResponseWriter, status int, data interface{}, logger ...*log.Logger)

func Unauthorized

func Unauthorized(w http.ResponseWriter, msg string, logger ...*log.Logger)

func UnprocessableEntity

func UnprocessableEntity(w http.ResponseWriter, msg string, errors map[string][]string, logger ...*log.Logger)

Types

type CreateUser

type CreateUser struct {
	UserService user.UnixInterface
	Logger      *log.Logger
	Validator   *validator.Validate
}

func (CreateUser) ServeHTTP

func (h CreateUser) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DeleteUser

type DeleteUser struct {
	UnixUserService user.UnixInterface
	Logger          *log.Logger
	Validator       *validator.Validate
}

func (DeleteUser) ServeHTTP

func (d DeleteUser) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message,omitempty"`
}

type HealthCheck

type HealthCheck struct {
}

func (HealthCheck) ServeHTTP

func (h HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ValidationErrorResponse

type ValidationErrorResponse struct {
	Message string              `json:"message,omitempty"`
	Errors  map[string][]string `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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