Пример #1
0
func NewServer() *Server {
	s := &Server{
		Broker: sarif.NewBroker(),
	}
	s.ModuleManager = services.NewModuleManager(s.instantiate)
	return s
}
Пример #2
0
func New(appName, moduleName string) *Server {
	if moduleName == "" {
		moduleName = "server"
	}
	app := core.NewApp(appName, moduleName)
	s := &Server{
		App: app,
	}
	s.ModuleManager = services.NewModuleManager(s.instantiate)
	if n, err := os.Hostname(); err == nil {
		s.ServerConfig.Name = n
	}
	return s
}