util

package
v0.0.0-...-95de4b9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(c echo.Context, httpCode int, errorCode, errorMessage string, err error) error

func GetDetailedErrorMessage

func GetDetailedErrorMessage(err error) string

func IntFromString

func IntFromString(name string, contents string) int

func PropogateError

func PropogateError(err error, message string)

func Recover

func Recover() echo.MiddlewareFunc

Recover returns a middleware which recovers from panics anywhere in the chain and handles the control to the centralized HTTPErrorHandler.

Types

type FieldLogger

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

func NewFieldLogger

func NewFieldLogger() *FieldLogger

type FpContext

type FpContext struct {
	echo.Context
	// contains filtered or unexported fields
}

The context used for REST calls - to provide the field logger and convenience methods.

func NewFpContext

func NewFpContext(c echo.Context) *FpContext

func (*FpContext) BoolFromQuery

func (fc *FpContext) BoolFromQuery(name string, defaultValue bool) bool

func (*FpContext) Float64FromQuery

func (fc *FpContext) Float64FromQuery(name string) float64

func (*FpContext) IntFromQuery

func (fc *FpContext) IntFromQuery(name string, defaultValue int) int

func (*FpContext) Log

func (fc *FpContext) Log(name string, v string)

func (*FpContext) LogBool

func (fc *FpContext) LogBool(name string, v bool)

func (*FpContext) LogError

func (fc *FpContext) LogError(message string, err error)

func (*FpContext) LogInt

func (fc *FpContext) LogInt(name string, v int)

func (*FpContext) LogInt64

func (fc *FpContext) LogInt64(name string, v int64)

func (*FpContext) LogStringArray

func (fc *FpContext) LogStringArray(name string, v []string)

func (*FpContext) OptionalFloat64FromQuery

func (fc *FpContext) OptionalFloat64FromQuery(name string, defaultValue float64) float64

func (*FpContext) RequestComplete

func (fc *FpContext) RequestComplete()

func (*FpContext) Time

func (fc *FpContext) Time(name string, action func() error) error

type InternalError

type InternalError struct {
	Message string
	Err     error
}

func (*InternalError) Error

func (ie *InternalError) Error() string

type InvalidRequest

type InvalidRequest struct {
	Message string
	Err     error
}

func (*InvalidRequest) Error

func (ir *InvalidRequest) Error() string

Jump to

Keyboard shortcuts

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