Back to

Package models

Latest Go to latest

The latest major version is .

Published: Apr 15, 2020 | License: MIT | Module:


Package models is intended to expose all types or interfaces that may be needed to interract with various emf subpackages, but exclusively in situations where functionality from inside these packages is not needed. For example, the endpoint package in each EMF service can register routes to a router.Group but should not otherwise control routing.



const MethodPostGob = context.MethodPostGob

MethodPostGob is the HTTP Method string to enable Gob encoding for a POST request

const MethodPutGob = context.MethodPutGob

MethodPutGob is the HTTP Method string to enable Gob encoding for a POST request

const UUIDRegex = middleware.UUIDRegex

UUIDRegex is a regular expression that matches UUIDv4


var ErrorFromComponent = errors.ErrorFromComponent

ErrorFromComponent is a generic error for use with errors.As to check the error's component name

Example: if errors.Is(err, emf.ErrorFromComponent("kmc")) {
var ErrorResponseCode = errors.ErrorResponseCode

ErrorResponseCode is a generic error for use with errors.Is to check against the StatusCode

Example: if errors.Is(err, emf.ErrorResponseCode(401)) {
var ErrorType = errors.ErrorType

ErrorType is a generic error for use with error.Is comparisons:

Example: errors.Is(err, emf.ErrorType("sp.400.RequestPayloadInvalid"))
var WrapRequest = middleware.WrapRequest

WrapRequest is the constructor for a RequestWrapperMiddleware

var WrapResponse = middleware.WrapResponse

WrapResponse is the constructor for a ResponseWrapperMiddleware

type BuildConfig

type BuildConfig = configurer.BuildConfig

BuildConfig provides the logger and the info endpoint access to hard-coded build configuration

type ConfigReader

type ConfigReader = configurer.ConfigReader

ConfigReader defines the interface for read-only config file access

type Context

type Context = context.EMFContext

Context is the EMF Context method set

type ContextType

type ContextType = context.EMFContextType

ContextType is the EMF Context Type

type DataPoint

type DataPoint = configurer.DataPoint

DataPoint represents a data point value

type EMFError

type EMFError = errors.EMFError

EMFError is the Error Interface created by a EMFErrorHandler

type EMFErrorHandler

type EMFErrorHandler = errors.EMFErrorHandler

EMFErrorHandler is the Error Handler Interface exposed by the EMFContext

type EMFErrorType

type EMFErrorType = errors.EMFErrorType

EMFErrorType is the Error Type created by a EMFErrorHandler

type HTTPClient

type HTTPClient = router.HTTPClient

HTTPClient issues HTTP Requests and performs error handling.

type HandlerFunc

type HandlerFunc = router.HandlerFunc

HandlerFunc is equivalent to the echo HandlerFunc interface to avoid the middleware package having to import it

type Logger

type Logger = echo.Logger

Logger is the type of the echo Logger

type Middleware

type Middleware = router.Middleware

Middleware is the type of our modified echo Middleware

type RequestHandler

type RequestHandler = context.RequestHandler

RequestHandler is the subset of a Context used for HTTP Requests

type RequestHandlerType

type RequestHandlerType = context.RequestHandlerType

RequestHandlerType is the subset of a Context used for HTTP Requests

type Router

type Router = router.Router

Router is the type of the echo Router

type RouterGroup

type RouterGroup = router.Group

RouterGroup is the type of the echo Router Group

type SimpleErrorType

type SimpleErrorType = errors.SimpleErrorType

SimpleErrorType is the Simpler Error Type returned by the error_handler middleware

type TypedError

type TypedError = errors.TypedError

TypedError is the TypedError Interface created by a EMFErrorHandler

type User

type User = *jwt.Token

User is an internal representation of a user per HTTP request.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier