Versions in this module Expand all Collapse all v1 v1.0.0 Aug 20, 2018 Changes in this version + const HTML + const JSON + const XML + const XML2 + var CorsAllowAll = cors.Options + type Callback interface + OnShutdown func(*Engine) error + OnStartup func(*Engine) error + type Engine struct + Config *libConfig.Instance + Context context.Context + Logger *libLogger.Instance + Module *module.Instance + Servers map[string]*Server + Utility *libUtility.Instance + func New(executeFile string, pathPrefix string, configName string, envPrefix string, ...) (engine *Engine) + func NewClassic(modules []*module.Module, configOptions map[string]libConfig.Option, ...) (engine *Engine) + func (e *Engine) GetBuiltinModule(moduleName string) (interface{}, error) + func (e *Engine) GetBuiltinModules() map[string]interface{} + func (e *Engine) GetConfigBool(key string) bool + func (e *Engine) GetConfigInt(key string) int + func (e *Engine) GetConfigInt64(key string) int64 + func (e *Engine) GetConfigString(key string) string + func (e *Engine) GetContextValue(key interface{}) interface{} + func (e *Engine) GetContextValueString(key string) string + func (e *Engine) GetLogger(name string) (*libLogger.Logger, error) + func (e *Engine) GetModule(moduleName string) (interface{}, error) + func (e *Engine) GetModules() map[string]interface{} + func (e *Engine) GetServer(name string) *Server + func (e *Engine) GetValue(key string) (interface{}, error) + func (e *Engine) GetValues() map[string]interface{} + func (e *Engine) InjectModule() error + func (e *Engine) InjectModuleByName(moduleNames ...string) error + func (e *Engine) ListenAndServe() + func (e *Engine) LoadCachedConfig(configFilePath string, cachedConfigFilePath string) + func (e *Engine) LoadConfig(configPath string, configName string) *Engine + func (e *Engine) LoadEnv(envPrefix string) *Engine + func (e *Engine) LoadEnvConfigFile(envPrefix string, dotEnvFile string) *Engine + func (e *Engine) LoadModuleFileConfig(moduleName string, configFile string, configProviders map[string]interface{}, ...) (err error) + func (e *Engine) LoadModuleJsonConfig(moduleName string, configData []byte, configProviders map[string]interface{}, ...) (err error) + func (e *Engine) LoadSystemConfig(configFilePath string, envPrefix string, dotEnvFile string) *Engine + func (e *Engine) NewClassicServer(name string, requestTimeoutHandlers ...routing.Handler) (server *Server) + func (e *Engine) NewServer(name string, port uint, gracefulStopTimeout time.Duration, ...) (server *Server) + func (e *Engine) RegisterUserModule(moduleName string, module module.ModuleInterface, forceOverwrites ...bool) (err error) + func (e *Engine) RegisterValue(key string, value interface{}, forceOverwrites ...bool) (err error) + func (e *Engine) ServeHTTP(res http.ResponseWriter, req *http.Request) + func (e *Engine) ServerListenAndServe(server *Server) + func (e *Engine) ServerServeHTTP(name string, server *Server, res http.ResponseWriter, req *http.Request) + func (e *Engine) SetConfigOptions(configOptions map[string]libConfig.Option) (err error) + func (e *Engine) SetContextValue(key, val interface{}) + func (e *Engine) SetPathPrefix(pathPrefix string) + func (e *Engine) SetServerLogFunc(name string, accessLogFunc access.LogWriterFunc, faultLogFunc fault.LogFunc, ...) *Engine + func (e *Engine) SetServerReuqestCallback(name string, reuqestCallback RouterCallback) *Engine + func (e *Engine) SetServerReuqestCors(name string, corsOptions cors.Options) *Engine + func (e *Engine) SetServerReuqestSlashRemover(name string, status int) *Engine + func (e *Engine) SetSystemLogWriter(systemLogWriter io.Writer) + func (e *Engine) Shutdown() (err error) + func (e *Engine) Startup() (err error) + func (e *Engine) SystemLog(args ...interface{}) + func (e *Engine) UnregisterUserModule(moduleNames ...string) (err error) + func (e *Engine) UnregisterValue(keys ...string) (context.Context, error) + func (e *Engine) UseModule(moduleNames ...string) (err error) + func (e *Engine) WithCallback(callback Callback) *Engine + func (e *Engine) WithLoggers(handlers []*LogHanlder) *Engine + func (e *Engine) WithValues(values map[string]interface{}) *Engine + type LogHanlder struct + Filename string + Formatter string + MaxLevel libLogger.Level + Name string + Type string + Writer string + type Option struct + EnvPrefix string + PathPrefix string + type RouterCallback interface + OnRequestShutdown func(*routing.Context) error + OnRequestStartup func(*routing.Context) error + type Server struct + Port uint + RouteGroups map[string]*ServerRouteGroup + Router *ServerRouter + func (s *Server) Connect(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) Delete(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) Get(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) GetRouteGroup(name string) *ServerRouteGroup + func (s *Server) GetRouter() *ServerRouter + func (s *Server) Options(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) Patch(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) Post(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) Proxy(host string, route string, upstream string) *Server + func (s *Server) Put(host string, route string, handlers ...routing.Handler) *Server + func (s *Server) SetLogFunc(accessLogFunc access.LogWriterFunc, faultLogFunc fault.LogFunc, ...) *Server + func (s *Server) SetReuqestCallback(reuqestCallback RouterCallback) *Server + func (s *Server) SetReuqestSlashRemover(status int) *Server + func (s *Server) SetServerReuqestCors(corsOptions cors.Options) *Server + func (s *Server) SystemLog(args ...interface{}) + func (s *Server) Trace(host string, route string, handlers ...routing.Handler) *Server + type ServerRouteGroup struct + func (g *ServerRouteGroup) AddRoute(method string, path string, handlers ...routing.Handler) + func (g *ServerRouteGroup) WithCallback(callback RouterCallback) *ServerRouteGroup + type ServerRouter struct + func (r *ServerRouter) AddRouteGroup(groupName string, modules []module.ModuleInterface, ...) *ServerRouteGroup + func (r *ServerRouter) AddTypeNegotiator(mime string, writer routing.DataWriter) *ServerRouter + func (r *ServerRouter) NewFileHandler(pathMap file.PathMap, opts ...file.ServerOptions) routing.Handler + func (r *ServerRouter) WithAccessLogger(loggerFunc access.LogWriterFunc) *ServerRouter + func (r *ServerRouter) WithCallback(callback RouterCallback) *ServerRouter + func (r *ServerRouter) WithCors(opts cors.Options) *ServerRouter + func (r *ServerRouter) WithErrorHandler(logf fault.LogFunc, errorf ...fault.ConvertErrorFunc) *ServerRouter + func (r *ServerRouter) WithLanguageNegotiator(languages ...string) *ServerRouter + func (r *ServerRouter) WithPanicLogger(logf fault.LogFunc) *ServerRouter + func (r *ServerRouter) WithRecoveryHandler(logf fault.LogFunc, errorf ...fault.ConvertErrorFunc) *ServerRouter + func (r *ServerRouter) WithSlashRemover(status int) *ServerRouter + func (r *ServerRouter) WithTypeNegotiator(formats ...string) *ServerRouter + type ServerRouterProxy struct + Host string + Route string + Upstream string + func (sp *ServerRouterProxy) FindStringSubmatchMap(s string) map[string]string + func (sp *ServerRouterProxy) MatchProxy(r *http.Request) (*url.URL, error) + type ServerRouterRoute struct + Handlers []routing.Handler + Host string + Method string + Route string + type State int8 + const STATE_INITIATE + const STATE_SHUTDOWN + const STATE_STARTUP