localrun

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0, NCSA Imports: 20 Imported by: 1

Documentation

Overview

Package localrun provides helper methods for locally building a Kythe indexed repo.

Index

Constants

This section is empty.

Variables

View Source
var LanguageMap map[string]Language = makeLanguageMap()

LanguageMap is a mapping from the string name of each language to the enum value.

Functions

This section is empty.

Types

type Language

type Language int

Language defines

const (
	Cxx Language
	Go
	Java
	Jvm
	Protobuf
	Python    // TODO: Python isn't shipping in Kythe right now by default.
	Textproto // TODO: Textproto isn't shipping in Kythe right now by default.
	TypeScript
)

This list must be kept in sync with Language.String.

func KnownLanguage

func KnownLanguage(s string) (Language, bool)

func (Language) String

func (l Language) String() string

String provides the string representation of this enum value.

func (Language) Valid

func (l Language) Valid() bool

Valid determines of the provided language is a valid enum value.

type LanguageSet

type LanguageSet map[Language]struct{}

LanguageSet is a set implementation that tracks langages.

func AllLanguages

func AllLanguages() LanguageSet

AllLanguages returns a language set that contains all available languages.

func (LanguageSet) Has

func (ls LanguageSet) Has(l Language) bool

Has checks if the provided language is in the set.

func (LanguageSet) Set

func (ls LanguageSet) Set(l Language)

Set the provided language in the set.

func (LanguageSet) String

func (ls LanguageSet) String() string

String implements Stringer.String.

type Runner

type Runner struct {
	// Generally useful configuration
	KytheRelease   string
	WorkingDir     string
	OutputDir      string
	WorkerPoolSize int
	CacheSize      *datasize.Size

	// Building/extracting options.
	Languages LanguageSet
	Targets   []string

	// Serving configuration options.
	Port            int
	Hostname        string
	PublicResources string

	// Timeout for indexing.
	Timeout time.Duration
	// contains filtered or unexported fields
}

Runner is responsible for indexing the repo with Kythe.

func (*Runner) Extract

func (r *Runner) Extract(ctx context.Context) error

Extract builds the provided targets and extracts compilation results.

func (*Runner) Index

func (r *Runner) Index(ctx context.Context) error

Index indexes the extracted data. Index is a reimplementation of the https://github.com/kythe/kythe/blob/master/kythe/release/kythe.sh script's --index mode.

func (*Runner) PostProcess

func (r *Runner) PostProcess(ctx context.Context) error

PostProcess postprocesses the supplied indexed data.

func (*Runner) Serve

func (r *Runner) Serve(ctx context.Context) error

Serve starts an http server on the provided port and allows web inspection of the indexed data.

Directories

Path Synopsis
cmd
localrun
Binary localrun is a small binary that can be used to build, extract, index, and serve any bazel repo.
Binary localrun is a small binary that can be used to build, extract, index, and serve any bazel repo.

Jump to

Keyboard shortcuts

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