Documentation
¶
Overview ¶
Package envelopemw implements Gin-Gonic middleware to be used as a way to guarantee the response normalization throw the envelope defined structure.
Index ¶
Constants ¶
View Source
const ( // EnvID defines the slate.api.rest.envelopemw package base environment // variable name. EnvID = rest.EnvID + "_ENVELOPE" )
View Source
const ( // ID defines the default id used to register // the application envelope middleware and related services. ID = rest.ID + ".envelope" )
Variables ¶
View Source
var ( // ServiceIDConfigPath defines the config path that used to store the // application service identifier. ServiceIDConfigPath = env.String(EnvID+"_SERVICE_ID_CONFIG_PATH", "slate.api.rest.service.id") // FormatAcceptListConfigPath defines the config path that used toLogAcceptListErrorMessage // store the application accepted mime types formats. FormatAcceptListConfigPath = env.String(EnvID+"_FORMAT_ACCEPT_LIST_CONFIG_PATH", "slate.api.rest.accept") // EndpointIDConfigPathFormat defines the format of the configuration // path where the endpoint identification number can be retrieved. EndpointIDConfigPathFormat = env.String(EnvID+"_ENDPOINT_ID_CONFIG_PATH_FORMAT", "slate.api.rest.endpoints.%s.id") // LogLevel @todo doc LogLevel = env.String(EnvID+"_LOG_LEVEL", "error") // LogChannel @todo doc LogChannel = env.String(EnvID+"_LOG_CHANNEL", "rest") // LogServiceErrorMessage @todo doc LogServiceErrorMessage = env.String(EnvID+"_LOG_SERVICE_ERROR_MESSAGE", "Invalid service id") // LogAcceptListErrorMessage @todo doc LogAcceptListErrorMessage = env.String(EnvID+"_LOG_ACCEPT_LIST_ERROR_MESSAGE", "Invalid accept list") // LogEndpointErrorMessage @todo doc LogEndpointErrorMessage = env.String(EnvID+"_LOG_ENDPOINT_ERROR_MESSAGE", "Invalid endpoint id") )
Functions ¶
This section is empty.
Types ¶
type MiddlewareGenerator ¶
type MiddlewareGenerator func(string) (rest.Middleware, error)
MiddlewareGenerator @todo doc
func NewMiddlewareGenerator ¶
NewMiddlewareGenerator returns a middleware generator function based on the application configuration. This middleware generator function should be called with the corresponding endpoint name, so it can generate the appropriate middleware function.
Click to show internal directories.
Click to hide internal directories.