/
stylenode.go
38 lines (31 loc) · 947 Bytes
/
stylenode.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
package nodes
import (
"net/http"
"github.com/gorilla/mux"
)
type StyleNode struct {
TextNode `bson:",inline"`
}
////////////////////////////////////////////////////////////////////////////////
func init() {
RegisterNodeType(StyleNode{}, func(engine *Engine) Node {
node := Node(NewStyleNode(engine))
return node
})
}
////////////////////////////////////////////////////////////////////////////////
func (n *StyleNode) RegisterRoute(route string, router *mux.Router) {
router.HandleFunc(route, func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("Content here."))
})
}
////////////////////////////////////////////////////////////////////////////////
func (n *StyleNode) IsChildAllowed(typeName string) bool {
return false
}
////////////////////////////////////////////////////////////////////////////////
func NewStyleNode(engine *Engine) *StyleNode {
node := StyleNode{}
node.Init(node, engine)
return &node
}