Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContainerID defines the slate.slaterest package container entry id base string. ContainerID = slate.ContainerID + ".slaterest" // ContainerEngineID defines the default id used to register the // application gin engine instance in the application container. ContainerEngineID = ContainerID + ".engine" )
View Source
const ( // EnvID defines the slate.slaterest package base environment variable name. EnvID = slate.EnvID + "_SREST" )
Variables ¶
View Source
var ( // ConfigPortPath contains the config path of the server port to be used. ConfigPortPath = senv.String(EnvID+"_CONFIG_PORT_PATH", "server.port") // LogChannel contains the name of the logging channel to be used on // the slaterest application messages. LogChannel = senv.String(EnvID+"_LOG_CHANNEL", "exec") )
Functions ¶
Types ¶
type Application ¶
type Application struct { slate.Application // contains filtered or unexported fields }
Application defines an object for a slaterest api project.
func NewApplication ¶
func NewApplication() *Application
NewApplication used to instantiate a new application.
func (Application) Engine ¶
func (a Application) Engine() Engine
Engine returns the reference to the instantiated gin-gonic engine
func (Application) Run ¶
func (a Application) Run(addr ...string) (err error)
Run method will boot the application, if not yet, and the start the underlying gin server.
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 Middleware ¶
type Middleware func(gin.HandlerFunc) gin.HandlerFunc
Middleware defines a type of data that represents a rest method middleware function.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.