-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.go
60 lines (52 loc) · 800 Bytes
/
schema.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package libyango
/*
#include <libyang/libyang.h>
*/
import "C"
type SchemaNodeKind = uint
const (
Container SchemaNodeKind = 1 << iota
Choice
Leaf
LeafList
List
_
_
Case
Rpc
Action
Notification
_
Input
Output
AnyData SchemaNodeKind = 96
)
type SchemaModule struct {
ctx *Context
raw *C.struct_lys_module
}
type SchemaModules struct {
ctx *Context
index uint32
}
type SchemaNode struct {
ctx *Context
raw *C.struct_lysc_node
kind SchemaNodeKind
}
func SchemaModuleFromRaw(ctx *Context, raw *C.struct_lys_module) *SchemaModule {
return &SchemaModule{
ctx,
raw,
}
}
func NewSchemaModules(ctx *Context, skipInternal bool) *SchemaModules {
var index uint32 = 0
if skipInternal {
index = ctx.InternalModuleCount()
}
return &SchemaModules{
ctx,
index,
}
}