metadata

package
v0.0.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2019 License: Apache-2.0, NCSA Imports: 9 Imported by: 2

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

func Parse(r io.Reader) (Rules, error)

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

func (rs Rules) MarshalJSON() ([]byte, error)

MarshalJSON encodes the specified rule set as a JSON file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL