Documentation ¶
Index ¶
- func GetModManager() *modManager
- type HttpServer
- type Module
- type ModuleImpl
- func (mod *ModuleImpl) Init()
- func (mod *ModuleImpl) Register(path string, handler com.HandlerFunc, typeM string)
- func (mod *ModuleImpl) Run()
- func (mod *ModuleImpl) SetAddress(addr string)
- func (mod *ModuleImpl) SetCerts(keyPath string, certPath string)
- func (mod *ModuleImpl) SetCommand(name string, ...)
- func (mod *ModuleImpl) SetHubAddress(addr string)
- func (mod *ModuleImpl) SetHubPath(path string)
- func (mod *ModuleImpl) SetHubPort(port string)
- func (mod *ModuleImpl) SetHubProtocol(proto string)
- func (mod *ModuleImpl) SetHubServer(ip string, path string, port string, proto string)
- func (mod *ModuleImpl) SetPath(path string)
- func (mod *ModuleImpl) SetPort(port string)
- func (mod *ModuleImpl) SetProtocol(proto string)
- func (mod *ModuleImpl) SetServer(ip string, path string, port string, proto string)
- func (mod *ModuleImpl) Stop(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpServer ¶
func (*HttpServer) ShutdownHandler ¶
func (s *HttpServer) ShutdownHandler(w http.ResponseWriter, r *http.Request)
func (*HttpServer) WaitShutdown ¶
func (s *HttpServer) WaitShutdown()
type Module ¶
type Module interface { Init() Register(string, func(w http.ResponseWriter, r *http.Request), string) Run() Stop() SetServer() SetHubServer() SetCommand(string, func(r *com.Request, w http.ResponseWriter, re *http.Request, mod *ModuleImpl) (string, error)) }
Module - Module
type ModuleImpl ¶
type ModuleImpl struct { Mode string Name string InstanceName string Router *com.Router Hash string Secret string HubServer com.Server Server com.Server ResourcePath string Certs []string CustomCommands map[string]func(r *com.Request, w http.ResponseWriter, re *http.Request, mod *ModuleImpl) (string, error) }
ModuleImpl - Impl of Module
func (*ModuleImpl) Register ¶
func (mod *ModuleImpl) Register(path string, handler com.HandlerFunc, typeM string)
TODO ADD CUSTOM LOGGING Register - register http handler for path
func (*ModuleImpl) SetAddress ¶
func (mod *ModuleImpl) SetAddress(addr string)
SetAddress - Set address for server
func (*ModuleImpl) SetCerts ¶
func (mod *ModuleImpl) SetCerts(keyPath string, certPath string)
SetCerts - Set certificate and key for server
func (*ModuleImpl) SetCommand ¶
func (mod *ModuleImpl) SetCommand(name string, run func(r *com.Request, w http.ResponseWriter, re *http.Request, mod *ModuleImpl) (string, error))
SetCommand - set command
func (*ModuleImpl) SetHubAddress ¶
func (mod *ModuleImpl) SetHubAddress(addr string)
SetHubAddress - Set address for hub server
func (*ModuleImpl) SetHubPath ¶
func (mod *ModuleImpl) SetHubPath(path string)
SetHubPath - Set path for hub server
func (*ModuleImpl) SetHubPort ¶
func (mod *ModuleImpl) SetHubPort(port string)
SetHubPort - Set port for hub server
func (*ModuleImpl) SetHubProtocol ¶
func (mod *ModuleImpl) SetHubProtocol(proto string)
SetHubProtocol - Set protocol for hub server
func (*ModuleImpl) SetHubServer ¶
func (mod *ModuleImpl) SetHubServer(ip string, path string, port string, proto string)
SetHubServer -
func (*ModuleImpl) SetPath ¶
func (mod *ModuleImpl) SetPath(path string)
SetPath - Set path for server
func (*ModuleImpl) SetPort ¶
func (mod *ModuleImpl) SetPort(port string)
SetPort - Set port for server
func (*ModuleImpl) SetProtocol ¶
func (mod *ModuleImpl) SetProtocol(proto string)
SetProtocol - Set protocol for server
func (*ModuleImpl) SetServer ¶
func (mod *ModuleImpl) SetServer(ip string, path string, port string, proto string)
SetServer -
func (*ModuleImpl) Stop ¶
func (mod *ModuleImpl) Stop(w http.ResponseWriter, r *http.Request)
Stop - stop module
Click to show internal directories.
Click to hide internal directories.