config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2014 License: BSD-3-Clause, MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidFilePath indicates that a file path outside of the tree or
	// repository root directory was specified in the config.
	ErrInvalidFilePath = errors.New("invalid file path specified in config (above config root dir or source unit dir)")
)
View Source
var Filename = "Srcfile"

Filename is the name of the file that configures a directory tree or repository. It is intended to be used by repository authors.

Functions

This section is empty.

Types

type External

type External struct {
	// Scanners is the default set of scanners to use. If not specified, all
	// scanners in the SRCLIBPATH will be used.
	Scanners []*toolchain.ToolRef
}

An External configuration file, represented by this struct, can set system- and user-level settings for srclib.

var SrclibPathConfig External

SrclibPathConfig is stored in SRCLIBPATH/.srclibconfig.

type Options

type Options struct {
	Repo   string `long:"repo" description:"repository URI" value-name:"URI"`
	Subdir string `long:"subdir" description:"subdirectory in repository" value-name:"DIR"`
}

type Repository

type Repository struct {
	// URI is the repository's clone URI.
	URI repo.URI `json:",omitempty"`

	// Tree is the configuration for the top-level directory tree in the
	// repository.
	Tree
}

Repository represents the config for an entire repository.

func ReadRepository

func ReadRepository(dir string, repoURI repo.URI) (*Repository, error)

ReadRepository parses and validates the configuration for a repository. If no Srcfile exists, it returns the default configuration for the repository. If an overridden configuration is specified for the repository (hard-coded in the Go code), then it is used instead of the Srcfile or the default configuration.

type Tree

type Tree struct {
	// SourceUnits is a list of source units in the repository, either specified
	// manually in the Srcfile or discovered automatically by the scanner.
	SourceUnits []*unit.SourceUnit `json:",omitempty"`

	// Scanners to use to scan for source units in this tree.
	Scanners []*toolchain.ToolRef `json:",omitempty"`

	// SkipDirs is a list of directory trees that are skipped. That is, any
	// source units (produced by scanners) whose Dir is in a skipped dir tree is
	// not processed further.
	SkipDirs []string `json:",omitempty"`

	// Config is an arbitrary key-value property map. Properties are copied
	// verbatim to each source unit that is scanned in this tree.
	Config map[string]interface{} `json:",omitempty"`
}

Tree represents the config for a directory and its subdirectories.

func ReadCached added in v0.0.9

func ReadCached(buildStore *buildstore.RepositoryStore, commitID string) (*Tree, error)

ReadCached reads a Tree's configuration from all of its source unit definition files in the .srclib-cache directory underneath dir. It does not read the Srcfile; the Srcfile's directives are already baked into the cached source unit definition files.

Jump to

Keyboard shortcuts

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