Documentation ¶
Overview ¶
File: http-engine.go
This file defines the http engine interface and its implementation. The http engine is responsible for handling RESTful requests. This framework uses gin as the default http engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMethodValidity ¶ added in v0.0.6
func CheckMethodValidity(method string)
func MergeRestPath ¶ added in v0.0.6
Common util functions
func RuntimeFuncName ¶ added in v0.0.6
func RuntimeFuncName(f interface{}) string
Get the name of the function. the split the fi
Types ¶
type IServerEngine ¶
type IServerEngine interface { // Registers a controller to the engine RegisterController(rootPath string, controller controller.IController) // Run the server on the specified port Run(option ServerRuntimeOption) // Stop the server gracefully // Must implement a timeout if there is a possibility of a hanging. Stop() // Add middleware to the engine. // This will be native to the engine's core AddMiddleware(middleware ...interface{}) // Add static file serving to the engine. // The config is specific to certain engines if they support it. AddStatic(prefix, root string, config ...interface{}) }
The engine must implement this interface to be used in the app.
type NullEngine ¶
type NullEngine struct { IServerEngine // contains filtered or unexported fields }
func NewNullEngine ¶
func NewNullEngine() *NullEngine
func (*NullEngine) RegisterController ¶
func (e *NullEngine) RegisterController(rootPath string, instance controller.IController)
func (*NullEngine) Run ¶
func (e *NullEngine) Run(option ServerRuntimeOption)
func (*NullEngine) Stop ¶
func (e *NullEngine) Stop()
type ServerEngineOption ¶
type ServerEngineOption struct {
GlobalApiPrefix string
}
type ServerRuntimeOption ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.