mirror of
https://github.com/astaxie/beego.git
synced 2024-06-01 19:33:29 +00:00
30 lines
338 B
Go
30 lines
338 B
Go
|
package goyaml2
|
||
|
|
||
|
const (
|
||
|
N_Map = iota
|
||
|
N_List
|
||
|
N_String
|
||
|
)
|
||
|
|
||
|
type Node interface {
|
||
|
Type() int
|
||
|
}
|
||
|
|
||
|
type MapNode map[string]interface{}
|
||
|
|
||
|
type ListNode []interface{}
|
||
|
|
||
|
type StringNode string
|
||
|
|
||
|
func (m *MapNode) Type() int {
|
||
|
return N_Map
|
||
|
}
|
||
|
|
||
|
func (l *ListNode) Type() int {
|
||
|
return N_List
|
||
|
}
|
||
|
|
||
|
func (s *StringNode) Type() int {
|
||
|
return N_String
|
||
|
}
|