helper

package
v0.0.0-...-f616806 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONBody

func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error

DecodeJSONBody decodes a request body in json form and returns a malformed request error type if any errors do occur

func ExtractIDFromRequest

func ExtractIDFromRequest(r *http.Request) uint32

ExtractIdFromRequest takes as input a request object and extracts an id from it

func ProcessAggregatedErrors

func ProcessAggregatedErrors(w http.ResponseWriter, aggregatedErr *authentication.AggregatedError) bool

ProcessAggregatedErrors processes aggregated errors

func ProcessAggregatedErrorsInTest

func ProcessAggregatedErrorsInTest(t *testing.T, aggregatedErr *authentication.AggregatedError) bool

ProcessAggregatedErrorsInTest processes aggregated errors while running and writing unit test cases

func ProcessMalformedRequest

func ProcessMalformedRequest(w http.ResponseWriter, err error)

ProcessMalformedRequest handles aggregated errors occuring from interactions with various external services

Types

type MalformedRequest

type MalformedRequest struct {
	Status int
	Msg    string
}

MalformedRequest is a custom error type

func (*MalformedRequest) Error

func (mr *MalformedRequest) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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