/
sitenode.go
39 lines (33 loc) · 1 KB
/
sitenode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package nodes
import (
"github.com/gorilla/mux"
//"net/http"
)
type SiteNode struct {
NodeBase `bson:",inline"`
Domain string `bson:"dm"`
EntryNodeId string `bson:"eid"`
}
////////////////////////////////////////////////////////////////////////////////
func init() {
RegisterNodeType(SiteNode{}, func(engine *Engine) Node {
node := Node(NewSiteNode(engine))
return node
})
}
////////////////////////////////////////////////////////////////////////////////
func (n *SiteNode) RegisterRoute(route string, router *mux.Router) {
//router.HandleFunc(n.assembleRoute(), func(w http.ResponseWriter, req *http.Request) {
// w.Write([]byte("Content here."))
//})
}
////////////////////////////////////////////////////////////////////////////////
func (n *SiteNode) IsChildAllowed(typeName string) bool {
return false
}
////////////////////////////////////////////////////////////////////////////////
func NewSiteNode(engine *Engine) *SiteNode {
node := SiteNode{}
node.Init(node, engine)
return &node
}