Documentation ¶
Overview ¶
Package metadata provides support code for processing Kythe metadata records, of the type generated by instrumented code generators for cross-language linkage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct {
// The Begin and End fields represent a half-closed interval of byte
// positions to match. Begin is inclusive, End is exclusive.
Begin, End int
EdgeIn string // edge kind to match over the anchor spanned
EdgeOut string // outbound edge kind to emit
VName *spb.VName // the vname to create an edge to or from
Reverse bool // whether to draw to vname (false) or from it (true)
}
A Rule denotes a single metadata rule, associating type linkage information for an anchor spanning a given range of text.
type Rules ¶
type Rules []Rule
Rules are a collection of metadata rules.
func FromGeneratedCodeInfo ¶
func FromGeneratedCodeInfo(msg *protopb.GeneratedCodeInfo, vname *spb.VName) Rules
FromGeneratedCodeInfo constructs a set of rules from the corresponding protobuf descriptor message and the vname of the metadata file from which the generated descriptor was loaded.
func Parse ¶
Parse parses a single JSON metadata object from r and returns the corresponding rules. It is an error if there are extra data after the metadata object, or if the type tag of the object does not match the current format code.
func (Rules) MarshalJSON ¶
MarshalJSON encodes the specified rule set as a JSON file.