util

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadGatewayErrorHandler

func BadGatewayErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, err error, timeStamp time.Time)

func DeletionBodyInvalid

func DeletionBodyInvalid(ctx context.Context, w http.ResponseWriter, r *http.Request, err error, timeStamp time.Time)

func ErrorHandler

func ErrorHandler(ctx context.Context, w http.ResponseWriter, _ *http.Request, msg string, status int, details string, timestamp time.Time)

func ForbiddenErrorHandler

func ForbiddenErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, logMessage string, timeStamp time.Time)

func ParseBodyToDeletionDto

func ParseBodyToDeletionDto(ctx context.Context, r *http.Request, timestamp time.Time) (openapi.DeletionDto, error)

func StringPathParam

func StringPathParam(r *http.Request, key string) string

func StringQueryParam

func StringQueryParam(r *http.Request, key string) string

func Success

func Success(ctx context.Context, w http.ResponseWriter, _ *http.Request, response interface{})

func SuccessNoBody

func SuccessNoBody(ctx context.Context, w http.ResponseWriter, _ *http.Request, status int)

func SuccessWithStatus

func SuccessWithStatus(ctx context.Context, w http.ResponseWriter, _ *http.Request, response interface{}, status int)

func UnauthorizedErrorHandler

func UnauthorizedErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, logMessage string, timeStamp time.Time)

func UnexpectedErrorHandler

func UnexpectedErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, err error, timeStamp time.Time)

func WriteJson

func WriteJson(ctx context.Context, w http.ResponseWriter, v interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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