Documentation ¶
Index ¶
- Constants
- func AddDateHeader(response rest.ResponseWriter)
- func CopyRequestTrace(sourceRequest *rest.Request, destinationRequest *http.Request) error
- func GetRequestLogger(request *rest.Request) log.Logger
- func GetRequestTraceRequest(request *rest.Request) string
- func GetRequestTraceSession(request *rest.Request) string
- func SetRequestErrors(request *rest.Request, errors []*Error)
- func SetRequestLogger(request *rest.Request, logger log.Logger)
- func SetRequestTraceRequest(request *rest.Request, traceRequest string)
- func SetRequestTraceSession(request *rest.Request, traceSession string)
- type API
- type Context
- type Error
- func ErrorAuthenticationTokenMissing() *Error
- func ErrorInternalServerFailure() *Error
- func ErrorJSONMalformed() *Error
- func ErrorLengthEqualTo(length int, limit int) *Error
- func ErrorLengthNotEqualTo(length int, limit int) *Error
- func ErrorLengthNotGreaterThan(length int, limit int) *Error
- func ErrorLengthNotGreaterThanOrEqualTo(length int, limit int) *Error
- func ErrorLengthNotInRange(length int, lowerLimit int, upperLimit int) *Error
- func ErrorLengthNotLessThan(length int, limit int) *Error
- func ErrorLengthNotLessThanOrEqualTo(length int, limit int) *Error
- func ErrorTypeNotArray(value interface{}) *Error
- func ErrorTypeNotBoolean(value interface{}) *Error
- func ErrorTypeNotFloat(value interface{}) *Error
- func ErrorTypeNotInteger(value interface{}) *Error
- func ErrorTypeNotObject(value interface{}) *Error
- func ErrorTypeNotString(value interface{}) *Error
- func ErrorTypeNotUnsignedInteger(value interface{}) *Error
- func ErrorUnauthenticated() *Error
- func ErrorUnauthorized() *Error
- func ErrorValueEmpty() *Error
- func ErrorValueEqualTo(value interface{}, limit interface{}) *Error
- func ErrorValueExists() *Error
- func ErrorValueFloatNotOneOf(value float64, allowedValues []float64) *Error
- func ErrorValueFloatOneOf(value float64, disallowedValues []float64) *Error
- func ErrorValueIntegerNotOneOf(value int, allowedValues []int) *Error
- func ErrorValueIntegerOneOf(value int, disallowedValues []int) *Error
- func ErrorValueNotEmpty() *Error
- func ErrorValueNotEqualTo(value interface{}, limit interface{}) *Error
- func ErrorValueNotExists() *Error
- func ErrorValueNotFalse() *Error
- func ErrorValueNotGreaterThan(value interface{}, limit interface{}) *Error
- func ErrorValueNotGreaterThanOrEqualTo(value interface{}, limit interface{}) *Error
- func ErrorValueNotInRange(value interface{}, lowerLimit interface{}, upperLimit interface{}) *Error
- func ErrorValueNotLessThan(value interface{}, limit interface{}) *Error
- func ErrorValueNotLessThanOrEqualTo(value interface{}, limit interface{}) *Error
- func ErrorValueNotTrue() *Error
- func ErrorValueStringNotOneOf(value string, allowedValues []string) *Error
- func ErrorValueStringOneOf(value string, disallowedValues []string) *Error
- func ErrorValueTimeNotAfter(value time.Time, limit time.Time, timeLayout string) *Error
- func ErrorValueTimeNotAfterNow(value time.Time, timeLayout string) *Error
- func ErrorValueTimeNotBefore(value time.Time, limit time.Time, timeLayout string) *Error
- func ErrorValueTimeNotBeforeNow(value time.Time, timeLayout string) *Error
- func ErrorValueTimeNotValid(value string, timeLayout string) *Error
- func GetRequestErrors(request *rest.Request) []*Error
- type Server
- type Service
- type Source
Constants ¶
View Source
const ( HTTPHeaderTraceRequest = "X-Tidepool-Trace-Request" HTTPHeaderTraceSession = "X-Tidepool-Trace-Session" )
Variables ¶
This section is empty.
Functions ¶
func AddDateHeader ¶ added in v1.10.0
func AddDateHeader(response rest.ResponseWriter)
func CopyRequestTrace ¶
func GetRequestTraceRequest ¶
func GetRequestTraceSession ¶
func SetRequestErrors ¶
func SetRequestTraceRequest ¶
func SetRequestTraceSession ¶
Types ¶
type Context ¶
type Context interface { Logger() log.Logger Request() *rest.Request Response() rest.ResponseWriter RespondWithError(err *Error) RespondWithInternalServerFailure(message string, failure ...interface{}) RespondWithStatusAndErrors(statusCode int, errors []*Error) RespondWithStatusAndData(statusCode int, data interface{}) }
type Error ¶
type Error struct { Code string `json:"code,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Status int `json:"status,string,omitempty"` Source *Source `json:"source,omitempty"` Meta interface{} `json:"meta,omitempty"` }
func ErrorAuthenticationTokenMissing ¶ added in v1.0.0
func ErrorAuthenticationTokenMissing() *Error
func ErrorInternalServerFailure ¶
func ErrorInternalServerFailure() *Error
func ErrorJSONMalformed ¶ added in v1.0.0
func ErrorJSONMalformed() *Error
func ErrorLengthEqualTo ¶ added in v1.0.0
func ErrorLengthNotEqualTo ¶ added in v1.0.0
func ErrorLengthNotGreaterThan ¶ added in v1.0.0
func ErrorLengthNotGreaterThanOrEqualTo ¶ added in v1.0.0
func ErrorLengthNotInRange ¶ added in v1.0.0
func ErrorLengthNotLessThan ¶ added in v1.0.0
func ErrorLengthNotLessThanOrEqualTo ¶ added in v1.0.0
func ErrorTypeNotArray ¶ added in v1.0.0
func ErrorTypeNotArray(value interface{}) *Error
func ErrorTypeNotBoolean ¶ added in v1.0.0
func ErrorTypeNotBoolean(value interface{}) *Error
func ErrorTypeNotFloat ¶ added in v1.0.0
func ErrorTypeNotFloat(value interface{}) *Error
func ErrorTypeNotInteger ¶ added in v1.0.0
func ErrorTypeNotInteger(value interface{}) *Error
func ErrorTypeNotObject ¶ added in v1.0.0
func ErrorTypeNotObject(value interface{}) *Error
func ErrorTypeNotString ¶ added in v1.0.0
func ErrorTypeNotString(value interface{}) *Error
func ErrorTypeNotUnsignedInteger ¶ added in v1.0.0
func ErrorTypeNotUnsignedInteger(value interface{}) *Error
func ErrorUnauthenticated ¶ added in v1.0.0
func ErrorUnauthenticated() *Error
func ErrorUnauthorized ¶ added in v1.0.0
func ErrorUnauthorized() *Error
func ErrorValueEmpty ¶ added in v1.0.0
func ErrorValueEmpty() *Error
func ErrorValueEqualTo ¶ added in v1.0.0
func ErrorValueEqualTo(value interface{}, limit interface{}) *Error
func ErrorValueExists ¶ added in v1.0.0
func ErrorValueExists() *Error
func ErrorValueFloatNotOneOf ¶ added in v1.0.0
func ErrorValueFloatOneOf ¶ added in v1.0.0
func ErrorValueIntegerNotOneOf ¶ added in v1.0.0
func ErrorValueIntegerOneOf ¶ added in v1.0.0
func ErrorValueNotEmpty ¶ added in v1.0.0
func ErrorValueNotEmpty() *Error
func ErrorValueNotEqualTo ¶ added in v1.0.0
func ErrorValueNotEqualTo(value interface{}, limit interface{}) *Error
func ErrorValueNotExists ¶ added in v1.0.0
func ErrorValueNotExists() *Error
func ErrorValueNotFalse ¶ added in v1.0.0
func ErrorValueNotFalse() *Error
func ErrorValueNotGreaterThan ¶ added in v1.0.0
func ErrorValueNotGreaterThan(value interface{}, limit interface{}) *Error
func ErrorValueNotGreaterThanOrEqualTo ¶ added in v1.0.0
func ErrorValueNotGreaterThanOrEqualTo(value interface{}, limit interface{}) *Error
func ErrorValueNotInRange ¶ added in v1.0.0
func ErrorValueNotInRange(value interface{}, lowerLimit interface{}, upperLimit interface{}) *Error
func ErrorValueNotLessThan ¶ added in v1.0.0
func ErrorValueNotLessThan(value interface{}, limit interface{}) *Error
func ErrorValueNotLessThanOrEqualTo ¶ added in v1.0.0
func ErrorValueNotLessThanOrEqualTo(value interface{}, limit interface{}) *Error
func ErrorValueNotTrue ¶ added in v1.0.0
func ErrorValueNotTrue() *Error
func ErrorValueStringNotOneOf ¶ added in v1.0.0
func ErrorValueStringOneOf ¶ added in v1.0.0
func ErrorValueTimeNotAfter ¶ added in v1.0.0
func ErrorValueTimeNotAfterNow ¶ added in v1.0.0
func ErrorValueTimeNotBefore ¶ added in v1.0.0
func ErrorValueTimeNotBeforeNow ¶ added in v1.0.0
func ErrorValueTimeNotValid ¶ added in v1.0.0
func GetRequestErrors ¶
func (*Error) WithSourceParameter ¶
func (*Error) WithSourcePointer ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.