Documentation
¶
Index ¶
- Constants
- func DefaultConfig() *viper.Viper
- type Http
- type HttpModule
- type Server
- func (s *Server) AddModule(modules ...HttpModule) error
- func (s *Server) GetApiRoute() *gin.RouterGroup
- func (s *Server) GetAppID() string
- func (s *Server) GetConfig() *viper.Viper
- func (s *Server) GetEngine() *gin.Engine
- func (s *Server) GetServer() *http.Server
- func (s *Server) Run()
- func (s *Server) Stop()
- func (s *Server) Use(handle ...middleware.Object) *gin.Engine
Constants ¶
View Source
const ( Application = "application" Port = "port" Timeout = "timeout" Read = "read" Write = "write" Mode = "mode" Enable = "enable" Version = "version" Key = "key" Value = "value" AppId = "appId" BaseRoute = "apiBaseRoute" UploadPath = "uploadPath" )
View Source
const ( I18n = "i18n" DefaultLanguage = "defaultLanguage" File = "file" Path = "Path" Type = "type" )
View Source
const ( Default_ = "default" Cors = "cors" AllowAllOrigin = "allowAllOrigin" AllowOrigins = "allowOrigins" AllowHeaders = "allowHeaders" AllowMethods = "allowMethods" )
View Source
const ( LOG = "log" Format = "format" Level = "level" MaxAge = "maxAge" Filename = "filename" )
View Source
const TimeFormat = "2006/05/26:15:04:05 +0800"
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
Types ¶
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
func (*Http) GetGateway ¶
func (*Http) GetI18n ¶
func (h *Http) GetI18n() *i18n.I18nMessageHandler
func (*Http) SetGateway ¶
type HttpModule ¶
type HttpModule interface { SetI18n(moduleName string) GetI18n() *i18n.I18nMessageHandler SetGateway(s *Server) GetGateway() *Server Setup() }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
var (
Gateway *Server
)
func (*Server) AddModule ¶
func (s *Server) AddModule(modules ...HttpModule) error
func (*Server) GetApiRoute ¶
func (s *Server) GetApiRoute() *gin.RouterGroup
Click to show internal directories.
Click to hide internal directories.