github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/azure/arm/parser/armjson/node.go (about) 1 package armjson 2 3 import "github.com/khulnasoft-lab/defsec/pkg/types" 4 5 type Node interface { 6 Comments() []Node 7 Range() Range 8 Decode(target interface{}) error 9 Kind() Kind 10 Content() []Node 11 Metadata() types.Metadata 12 } 13 14 type Range struct { 15 Start Position 16 End Position 17 } 18 19 type Position struct { 20 Line int 21 Column int 22 } 23 24 type node struct { 25 raw interface{} 26 start Position 27 end Position 28 kind Kind 29 content []Node 30 comments []Node 31 metadata *types.Metadata 32 ref string 33 } 34 35 func (n *node) Range() Range { 36 return Range{ 37 Start: n.start, 38 End: Position{ 39 Column: n.end.Column - 1, 40 Line: n.end.Line, 41 }, 42 } 43 } 44 45 func (n *node) Comments() []Node { 46 return n.comments 47 } 48 49 func (n *node) End() Position { 50 return n.end 51 } 52 53 func (n *node) Kind() Kind { 54 return n.kind 55 } 56 57 func (n *node) Content() []Node { 58 return n.content 59 }