analysis

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Overview

Package analysis defines interfaces used to locate and analyze compilation units and their inputs.

Package analysis contains the CompilationAnalyzer and Fetcher interfaces. CompilationAnalyzers are a generic interface to a process that analyzes apb.CompilationUnits, gathering their needed file data from a FileDataService. Fetchers express the ability to read file contents from index files, local files, index packs, and other storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompilationAnalyzer added in v0.0.8

type CompilationAnalyzer interface {
	// Analyze calls f on each analysis output resulting from the analysis of the
	// given apb.CompilationUnit.  If f returns an error, f is no longer called
	// and Analyze returns with the same error.
	Analyze(ctx context.Context, req *apb.AnalysisRequest, f OutputFunc) error
}

A CompilationAnalyzer analyzes compilations, retrieving all necessary file data from a FileDataService, and returns a stream arbitrary outputs.

type Fetcher

type Fetcher interface {
	// Fetch retrieves the contents of a single file.  At least one of path and
	// digest must be provided; both are preferred.  The implementation may
	// return an error if both are not set.
	Fetch(path, digest string) ([]byte, error)
}

A Fetcher provides the ability to fetch file contents from storage.

type FileDataService added in v0.0.8

type FileDataService struct {
	// contains filtered or unexported fields
}

FileDataService implements the apb.FileDataServiceServer interface backed by a set of Fetchers. A Fetcher can be added/removed dynamically.

func (*FileDataService) AddFetcher added in v0.0.8

func (s *FileDataService) AddFetcher(f Fetcher)

AddFetcher adds the given Fetcher to the set of Fetchers used by Get.

func (*FileDataService) Clear added in v0.0.8

func (s *FileDataService) Clear()

Clear removes all Fetchers from use by Get.

func (*FileDataService) Get added in v0.0.8

Get implements the apb.FileDataServiceServer interface.

func (*FileDataService) RemoveFetcher added in v0.0.8

func (s *FileDataService) RemoveFetcher(f Fetcher)

RemoveFetcher removes the given Fetcher from the set of Fetchers used by Get.

type OutputFunc added in v0.0.8

type OutputFunc func(out *apb.AnalysisOutput) error

OutputFunc handles a single AnalysisOutput.

func EntryOutput added in v0.0.8

func EntryOutput(f func(*spb.Entry) error) OutputFunc

EntryOutput returns an OutputFunc that unmarshals each output's value as an Entry and calls f on it.

Directories

Path Synopsis
Package driver contains a Driver implementation that sends analyses to a CompilationAnalyzer based on a Queue of compilations.
Package driver contains a Driver implementation that sends analyses to a CompilationAnalyzer based on a Queue of compilations.
Package local implements CompilationAnalyzer utilities for local analyses.
Package local implements CompilationAnalyzer utilities for local analyses.
Package remote contains kythe/go/platform/analysis implementations backed by remote RPC servers.
Package remote contains kythe/go/platform/analysis implementations backed by remote RPC servers.

Jump to

Keyboard shortcuts

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