Documentation
¶
Index ¶
- func SetBinBase64(data map[string]string)
- func SetBinBytes(data map[string][]byte)
- type APIServer
- func (this *APIServer) API(path string, handle func(ctx gcore.Ctx), ext ...string)
- func (s *APIServer) ActiveConnCount() int64
- func (this *APIServer) AddMiddleware0(m gcore.Middleware)
- func (this *APIServer) AddMiddleware1(m gcore.Middleware)
- func (this *APIServer) AddMiddleware2(m gcore.Middleware)
- func (this *APIServer) AddMiddleware3(m gcore.Middleware)
- func (this *APIServer) Address() string
- func (this *APIServer) Ctx() gcore.Ctx
- func (this *APIServer) Ext(ext string)
- func (this *APIServer) GracefulStop()
- func (this *APIServer) Group(path string) gcore.APIServer
- func (s *APIServer) Init(cfg gcore.Config) (err error)
- func (this *APIServer) InjectListeners(l []net.Listener)
- func (this *APIServer) Listener() net.Listener
- func (this *APIServer) ListenerFactory() func(addr string) (net.Listener, error)
- func (this *APIServer) Listeners() []net.Listener
- func (this *APIServer) Logger() gcore.Logger
- func (this *APIServer) PrintRouteTable(w io.Writer)
- func (this *APIServer) Router() gcore.HTTPRouter
- func (this *APIServer) Run() (err error)
- func (s *APIServer) ServeEmbedFS(fs embed.FS, urlPath string)
- func (s *APIServer) ServeFiles(rootPath, urlPath string)
- func (this *APIServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (this *APIServer) Server() *http.Server
- func (this *APIServer) SetErrorHandler(handle func(ctx gcore.Ctx, err interface{}))
- func (this *APIServer) SetListenerFactory(listenerFactory func(addr string) (net.Listener, error))
- func (this *APIServer) SetLog(l gcore.Logger)
- func (this *APIServer) SetLogger(l gcore.Logger)
- func (this *APIServer) SetNotFoundHandler(handle func(ctx gcore.Ctx))
- func (this *APIServer) SetTLSFile(certFile, keyFile string)
- func (this *APIServer) ShowErrorStack(isShow bool)
- func (this *APIServer) Start() (err error)
- func (this *APIServer) Stop()
- type HTTPServer
- func (s *HTTPServer) ActiveConnCount() int64
- func (s *HTTPServer) AddFuncMap(f map[string]interface{})
- func (s *HTTPServer) AddMiddleware0(m gcore.Middleware)
- func (s *HTTPServer) AddMiddleware1(m gcore.Middleware)
- func (s *HTTPServer) AddMiddleware2(m gcore.Middleware)
- func (s *HTTPServer) AddMiddleware3(m gcore.Middleware)
- func (s *HTTPServer) Close()
- func (s *HTTPServer) Config() gcore.Config
- func (s *HTTPServer) Ctx() gcore.Ctx
- func (s *HTTPServer) GracefulStop()
- func (s *HTTPServer) Init(cfg gcore.Config) (err error)
- func (s *HTTPServer) InjectListeners(l []net.Listener)
- func (s *HTTPServer) Listen() (err error)
- func (s *HTTPServer) ListenTLS() (err error)
- func (s *HTTPServer) Listener() net.Listener
- func (this *HTTPServer) ListenerFactory() func(addr string) (net.Listener, error)
- func (s *HTTPServer) Listeners() []net.Listener
- func (s *HTTPServer) Logger() gcore.Logger
- func (s *HTTPServer) PrintRouteTable(w io.Writer)
- func (s *HTTPServer) Router() gcore.HTTPRouter
- func (s *HTTPServer) ServeEmbedFS(fs embed.FS, urlPath string)
- func (s *HTTPServer) ServeFiles(rootPath, urlPath string)
- func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *HTTPServer) Server() *http.Server
- func (s *HTTPServer) SessionStore() gcore.SessionStorage
- func (s *HTTPServer) SetBinBytes(binData map[string][]byte)
- func (s *HTTPServer) SetConfig(c gcore.Config)
- func (s *HTTPServer) SetCtx(ctx gcore.Ctx)
- func (s *HTTPServer) SetErrorHandler(fn func(ctx gcore.Ctx, tpl gcore.Template, err interface{}))
- func (this *HTTPServer) SetListenerFactory(listenerFactory func(addr string) (net.Listener, error))
- func (s *HTTPServer) SetLog(l gcore.Logger)
- func (s *HTTPServer) SetLogger(l gcore.Logger)
- func (s *HTTPServer) SetNotFoundHandler(fn func(ctx gcore.Ctx, tpl gcore.Template))
- func (s *HTTPServer) SetRouter(r gcore.HTTPRouter)
- func (s *HTTPServer) SetSessionStore(st gcore.SessionStorage)
- func (s *HTTPServer) SetTpl(t gcore.Template)
- func (s *HTTPServer) Start() (err error)
- func (s *HTTPServer) Stop()
- func (s *HTTPServer) Tpl() gcore.Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetBinBase64 ¶
SetBinBase64 key is file path no slash prefix, value is file base64 encoded bytes contents.
func SetBinBytes ¶
SetBinBytes key is file path no slash prefix, value is file's bytes contents.
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
func NewAPIServerForProvider ¶
func NewDefaultAPIServer ¶
func (*APIServer) ActiveConnCount ¶
func (*APIServer) AddMiddleware0 ¶
func (this *APIServer) AddMiddleware0(m gcore.Middleware)
func (*APIServer) AddMiddleware1 ¶
func (this *APIServer) AddMiddleware1(m gcore.Middleware)
func (*APIServer) AddMiddleware2 ¶
func (this *APIServer) AddMiddleware2(m gcore.Middleware)
func (*APIServer) AddMiddleware3 ¶
func (this *APIServer) AddMiddleware3(m gcore.Middleware)
func (*APIServer) GracefulStop ¶
func (this *APIServer) GracefulStop()
GracefulStop implements gcore.Service GracefulStop
func (*APIServer) InjectListeners ¶
InjectListeners implements gcore.Service InjectListeners
func (*APIServer) ListenerFactory ¶
func (*APIServer) PrintRouteTable ¶
PrintRouteTable dump all routes into `w`, if `w` is nil, os.Stdout will be used.
func (*APIServer) Router ¶
func (this *APIServer) Router() gcore.HTTPRouter
func (*APIServer) ServeFiles ¶
func (*APIServer) ServeHTTP ¶
func (this *APIServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*APIServer) SetErrorHandler ¶
func (*APIServer) SetListenerFactory ¶
func (*APIServer) SetNotFoundHandler ¶
func (*APIServer) SetTLSFile ¶
func (*APIServer) ShowErrorStack ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(ctx gcore.Ctx) *HTTPServer
func (*HTTPServer) ActiveConnCount ¶
func (s *HTTPServer) ActiveConnCount() int64
func (*HTTPServer) AddFuncMap ¶
func (s *HTTPServer) AddFuncMap(f map[string]interface{})
AddFuncMap adds helper functions to template
func (*HTTPServer) AddMiddleware0 ¶
func (s *HTTPServer) AddMiddleware0(m gcore.Middleware)
func (*HTTPServer) AddMiddleware1 ¶
func (s *HTTPServer) AddMiddleware1(m gcore.Middleware)
func (*HTTPServer) AddMiddleware2 ¶
func (s *HTTPServer) AddMiddleware2(m gcore.Middleware)
func (*HTTPServer) AddMiddleware3 ¶
func (s *HTTPServer) AddMiddleware3(m gcore.Middleware)
func (*HTTPServer) Close ¶
func (s *HTTPServer) Close()
func (*HTTPServer) Config ¶
func (s *HTTPServer) Config() gcore.Config
func (*HTTPServer) Ctx ¶
func (s *HTTPServer) Ctx() gcore.Ctx
func (*HTTPServer) GracefulStop ¶
func (s *HTTPServer) GracefulStop()
GracefulStop implements service.Service GracefulStop
func (*HTTPServer) Init ¶
func (s *HTTPServer) Init(cfg gcore.Config) (err error)
Init implements service.Service Init
func (*HTTPServer) InjectListeners ¶
func (s *HTTPServer) InjectListeners(l []net.Listener)
InjectListeners implements service.Service InjectListeners
func (*HTTPServer) Listen ¶
func (s *HTTPServer) Listen() (err error)
func (*HTTPServer) ListenTLS ¶
func (s *HTTPServer) ListenTLS() (err error)
func (*HTTPServer) Listener ¶
func (s *HTTPServer) Listener() net.Listener
func (*HTTPServer) ListenerFactory ¶
func (this *HTTPServer) ListenerFactory() func(addr string) (net.Listener, error)
func (*HTTPServer) Listeners ¶
func (s *HTTPServer) Listeners() []net.Listener
Listeners implements service.Service Listeners
func (*HTTPServer) Logger ¶
func (s *HTTPServer) Logger() gcore.Logger
func (*HTTPServer) PrintRouteTable ¶
func (s *HTTPServer) PrintRouteTable(w io.Writer)
PrintRouteTable dump all routes into `w`, if `w` is nil, os.Stdout will be used.
func (*HTTPServer) Router ¶
func (s *HTTPServer) Router() gcore.HTTPRouter
func (*HTTPServer) ServeEmbedFS ¶
func (s *HTTPServer) ServeEmbedFS(fs embed.FS, urlPath string)
func (*HTTPServer) ServeFiles ¶
func (s *HTTPServer) ServeFiles(rootPath, urlPath string)
func (*HTTPServer) ServeHTTP ¶
func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HTTPServer) Server ¶
func (s *HTTPServer) Server() *http.Server
func (*HTTPServer) SessionStore ¶
func (s *HTTPServer) SessionStore() gcore.SessionStorage
func (*HTTPServer) SetBinBytes ¶
func (s *HTTPServer) SetBinBytes(binData map[string][]byte)
SetBinBytes key is file path no slash prefix, value is file's bytes contents.
func (*HTTPServer) SetConfig ¶
func (s *HTTPServer) SetConfig(c gcore.Config)
func (*HTTPServer) SetCtx ¶
func (s *HTTPServer) SetCtx(ctx gcore.Ctx)
func (*HTTPServer) SetErrorHandler ¶
func (s *HTTPServer) SetErrorHandler(fn func(ctx gcore.Ctx, tpl gcore.Template, err interface{}))
func (*HTTPServer) SetListenerFactory ¶
func (this *HTTPServer) SetListenerFactory(listenerFactory func(addr string) (net.Listener, error))
func (*HTTPServer) SetLog ¶
func (s *HTTPServer) SetLog(l gcore.Logger)
SetLog implements service.Service SetLog
func (*HTTPServer) SetLogger ¶
func (s *HTTPServer) SetLogger(l gcore.Logger)
func (*HTTPServer) SetNotFoundHandler ¶
func (s *HTTPServer) SetNotFoundHandler(fn func(ctx gcore.Ctx, tpl gcore.Template))
func (*HTTPServer) SetRouter ¶
func (s *HTTPServer) SetRouter(r gcore.HTTPRouter)
func (*HTTPServer) SetSessionStore ¶
func (s *HTTPServer) SetSessionStore(st gcore.SessionStorage)
func (*HTTPServer) SetTpl ¶
func (s *HTTPServer) SetTpl(t gcore.Template)
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() (err error)
Start implements service.Service Start
func (*HTTPServer) Tpl ¶
func (s *HTTPServer) Tpl() gcore.Template