grapher

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2015 License: BSD-3-Clause, MIT Imports: 18 Imported by: 0

Documentation

Overview

TODO(sqs): remove this file

Index

Constants

This section is empty.

Variables

View Source
var Graphers = make(map[reflect.Type]Grapher)

Graphers holds all registered graphers.

Functions

func NormalizeData

func NormalizeData(unitType, dir string, o *Output) error

NormalizeData sorts data and performs other postprocessing.

func PopulateImpliedFields added in v0.0.31

func PopulateImpliedFields(repo, commitID, unitType, unit string, o *Output)

PopulateImpliedFields fills in fields on graph data objects that individual toolchains leave blank but that are implied by the source unit the graph data objects were built from.

func Register

func Register(emptySourceUnit unit.SourceUnit, grapher Grapher)

Register sets the grapher to be used for source units of the given type. If Register is called twice with the same name or if grapher is nil, it panics

func UnresolvedInternalRefs added in v0.0.31

func UnresolvedInternalRefs(currentRepoURI string, refs []*graph.Ref, defs []*graph.Def) map[graph.DefKey][]*graph.Ref

UnresolvedInternalRefs returns a map of unresolved internal refs, keyed on the (nonexistent) defs they point to. CurrentRepoURI must be the repo URI of the repo the refs and defs were built from. It is used to determine whether a ref is an internal ref or not. Only internal refs can be checked in this way because checking resolution to external defs would require loading external data, which is outside the scope of this function.

Types

type GraphUnitRule added in v0.0.7

type GraphUnitRule struct {
	Unit *unit.SourceUnit
	Tool *srclib.ToolRef
	// contains filtered or unexported fields
}

func (*GraphUnitRule) Prereqs added in v0.0.7

func (r *GraphUnitRule) Prereqs() []string

func (*GraphUnitRule) Recipes added in v0.0.7

func (r *GraphUnitRule) Recipes() []string

func (*GraphUnitRule) SourceUnit added in v0.0.22

func (r *GraphUnitRule) SourceUnit() *unit.SourceUnit

func (*GraphUnitRule) Target added in v0.0.7

func (r *GraphUnitRule) Target() string

type Grapher

type Grapher interface {
	Graph(dir string, unit *unit.SourceUnit, c *config.Repository) (*Output, error)
}

type MultiError added in v0.0.16

type MultiError []error

func ValidateDefs added in v0.0.30

func ValidateDefs(defs []*graph.Def) (errs MultiError)

func ValidateRefs added in v0.0.16

func ValidateRefs(refs []*graph.Ref) (errs MultiError)

func (MultiError) Error added in v0.0.16

func (e MultiError) Error() string

type Output

type Output struct {
	Defs []*graph.Def `json:",omitempty"`
	Refs []*graph.Ref `json:",omitempty"`
	Docs []*graph.Doc `json:",omitempty"`
	Anns []*ann.Ann   `json:",omitempty"`
}

START Output OMIT Output is produced by grapher tools.

Jump to

Keyboard shortcuts

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