Exemplo n.º 1
0
// NewServerWith create a new server with given router and root filters
func NewServerWith(rt Router, filters RootFilters) *Server {
	if filters == nil {
		filters = NewRootFilters(nil)
	}
	if rt == nil {
		rt = NewRouter()
	}

	return &Server{
		Router:           rt,
		Attrs:            attrs.NewLocked(),
		RootFilters:      filters,
		ResMaster:        resource.NewMaster(),
		componentManager: newComponentManager(),
	}
}
Exemplo n.º 2
0
// newSession create a new session with given id
func NewSession(id string) *Session {
	return &Session{
		id:    id,
		Attrs: attrs.NewLocked(),
	}
}