Documentation
¶
Overview ¶
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.
Index ¶
- Constants
- Variables
- type BuildConfig
- type ConfigReader
- type Context
- type ContextType
- type DataPoint
- type EMFError
- type EMFErrorHandler
- type EMFErrorType
- type HTTPClient
- type HandlerFunc
- type Logger
- type Middleware
- type RequestHandler
- type RequestHandlerType
- type Router
- type RouterGroup
- type SimpleErrorType
- type TypedError
- type User
Constants ¶
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
Variables ¶
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
Functions ¶
This section is empty.
Types ¶
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 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 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 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