Documentation
¶
Index ¶
- func GetAllUrlQueryValues[T any](query url.Values, valueKey string, parser Parser[T]) (*[]T, error)
- func GetContextValue[T any](ctx context.Context, valueKey string) (*T, error)
- func GetUrlQueryValue[T any](query url.Values, valueKey string, parser Parser[T]) (*T, error)
- func HandlePing() func(w http.ResponseWriter, r *http.Request)
- func MapUuidHeader(header string) func(next http.Handler) http.Handler
- func MapUuidQueries(w http.ResponseWriter, r *url.URL, query string, trg *[]uuid.UUID) error
- func UnmarshalJsonAndValidate(logger *zap.SugaredLogger, rw http.ResponseWriter, r *http.Request, ...) bool
- func UnmarshalJsonAndValidateWithError(rw http.ResponseWriter, r *http.Request, data interface{}) error
- func WriteCreateRessourceResponse(w http.ResponseWriter, r *http.Request, id uuid.UUID)
- type CreateRessourceResponse
- type GetContextValueError
- type GetUrlQueryValueError
- type HandlerFuncWithError
- type Parser
- type UrlQueryTypes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllUrlQueryValues ¶
func GetContextValue ¶
func GetUrlQueryValue ¶
func HandlePing ¶
func HandlePing() func(w http.ResponseWriter, r *http.Request)
func MapUuidQueries ¶
func UnmarshalJsonAndValidate ¶
func UnmarshalJsonAndValidate(logger *zap.SugaredLogger, rw http.ResponseWriter, r *http.Request, data interface{}) bool
returns true when unmarshal succeeded, otherwise writes error to response and returns false expects a pointer to a dto
func UnmarshalJsonAndValidateWithError ¶
func UnmarshalJsonAndValidateWithError(rw http.ResponseWriter, r *http.Request, data interface{}) error
expects a pointer to a dto
Types ¶
type CreateRessourceResponse ¶
type GetContextValueError ¶
type GetContextValueError struct { standardisedError.StandardisedError Param string `json:"param"` }
define custom error to catch later in withErrorHandler
func (*GetContextValueError) Error ¶
func (m *GetContextValueError) Error() string
func (*GetContextValueError) GetStandardisedError ¶
func (m *GetContextValueError) GetStandardisedError() *standardisedError.StandardisedError
type GetUrlQueryValueError ¶
type GetUrlQueryValueError struct { standardisedError.StandardisedError Param string `json:"param"` }
define custom error to catch later in withErrorHandler
func (*GetUrlQueryValueError) Error ¶
func (m *GetUrlQueryValueError) Error() string
func (*GetUrlQueryValueError) GetStandardisedError ¶
func (m *GetUrlQueryValueError) GetStandardisedError() *standardisedError.StandardisedError
type HandlerFuncWithError ¶
type HandlerFuncWithError func(http.ResponseWriter, *http.Request) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.