Documentation
¶
Overview ¶
Package rest implements a REST application and auxiliary.
Index ¶
Constants ¶
View Source
const ( // ID defines a base id of all other rest // package instances registered in the application container. ID = api.ID + ".rest" // EngineID defines the id to be used as the // container registration id of the rest engine instance. EngineID = ID + ".engine" // ProcessID defines the id to be used as the // container registration id of the rest watchdog process. ProcessID = ID + ".process" // EndpointRegisterTag defines the tag to be used as the // identification of a controller's registration instance. EndpointRegisterTag = ID + ".register" )
View Source
const ( // EnvID defines the slate.api.rest package base environment variable name. EnvID = api.EnvID + "_REST" )
Variables ¶
View Source
var ( // ConfigPath defines the configuration location where is // defined the REST service configuration. ConfigPath = env.String(EnvID+"_CONFIG_PATH", "slate.api.rest") // WatchdogName defines the default REST service watchdog name. WatchdogName = env.String(EnvID+"_WATCHDOG_NAME", "rest") // Port defines the default rest service port. Port = env.Int(EnvID+"_PORT", 80) // LogChannel defines the default logging channel. LogChannel = env.String(EnvID+"_LOG_CHANNEL", "rest") // LogLevel defines the default logging level. LogLevel = env.String(EnvID+"_LOG_LEVEL", "info") // LogStartMessage defines the default service start logging message. LogStartMessage = env.String(EnvID+"_LOG_START_MESSAGE", "[service:rest] service starting ...") // LogErrorMessage defines the default service error logging message. LogErrorMessage = env.String(EnvID+"_LOG_ERROR_MESSAGE", "[service:rest] service error") // LogEndMessage defines the default service end logging message. LogEndMessage = env.String(EnvID+"_LOG_END_MESSAGE", "[service:rest] service terminated") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface { gin.IRoutes Delims(left, right string) *gin.Engine HandleContext(c *gin.Context) LoadHTMLFiles(files ...string) LoadHTMLGlob(pattern string) NoMethod(handlers ...gin.HandlerFunc) NoRoute(handlers ...gin.HandlerFunc) Routes() (routes gin.RoutesInfo) Run(addr ...string) (err error) RunFd(fd int) (err error) RunListener(listener net.Listener) (err error) RunTLS(addr, certFile, keyFile string) (err error) RunUnix(file string) (err error) SecureJsonPrefix(prefix string) *gin.Engine ServeHTTP(w http.ResponseWriter, req *http.Request) SetFuncMap(funcMap template.FuncMap) SetHTMLTemplate(tpl *template.Template) }
Engine interface for the gin-gonic engine object.
type IEndpointRegister ¶
IEndpointRegister defines an interface to an instance that is able to register endpoints to the REST engine/service
type Middleware ¶
type Middleware func(gin.HandlerFunc) gin.HandlerFunc
Middleware defines a type of data that represents a rest method middleware function.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package envelopemw implements Gin-Gonic middleware to be used as a way to guarantee the response normalization throw the envelope defined structure.
|
Package envelopemw implements Gin-Gonic middleware to be used as a way to guarantee the response normalization throw the envelope defined structure. |
Package logmw implements Gin-Gonic middleware to be used as a way to provide a REST logging normalized process.
|
Package logmw implements Gin-Gonic middleware to be used as a way to provide a REST logging normalized process. |
Click to show internal directories.
Click to hide internal directories.