tooldata

package
v0.0.0-...-565800d Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

package tooldata provides routines for locating and reading tool specific data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFilePath

func ConfigFilePath(jirix *jiri.X) (string, error)

ConfigFilePath returns the path to the tools configuration file.

func DataDirPath

func DataDirPath(jirix *jiri.X, toolName string) (string, error)

DataDirPath returns the path to the data directory of the given tool.

func OncallRotationPath

func OncallRotationPath(jirix *jiri.X) (string, error)

OncallRotationPath returns the path to the oncall rotation file.

func SaveConfig

func SaveConfig(jirix *jiri.X, config *Config) error

SaveConfig writes the given configuration to the tools configuration file.

func ThirdPartyBinPath

func ThirdPartyBinPath(jirix *jiri.X, name string) (string, error)

ThirdPartyBinPath returns the path to the given third-party tool taking into account the host and the target Go architecture.

Types

type APICheckProjectsOpt

type APICheckProjectsOpt map[string]struct{}

APICheckProjectsOpt is the type that can be used to pass the Config factory a API check projects option.

type Config

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

Config holds configuration common to jiri tools.

func LoadConfig

func LoadConfig(jirix *jiri.X) (*Config, error)

LoadConfig returns the configuration stored in the tools configuration file.

func NewConfig

func NewConfig(opts ...ConfigOpt) *Config

NewConfig is the Config factory.

func (Config) APICheckProjects

func (c Config) APICheckProjects() map[string]struct{}

APICheckProjects returns the set of project names for which the API check is required.

func (Config) CopyrightCheckProjects

func (c Config) CopyrightCheckProjects() map[string]struct{}

CopyrightCheckProjects returns the set of project names for which the copyright check is required.

func (Config) GoPath

func (c Config) GoPath(jirix *jiri.X) string

GoPath computes and returns the GOPATH environment variable based on the current jiri configuration.

func (Config) GoWorkspaces

func (c Config) GoWorkspaces() []string

GoWorkspaces returns the Go workspaces included in the config.

func (Config) GroupTests

func (c Config) GroupTests(groups []string) []string

GroupTests returns a list of Jenkins tests associated with the given test groups.

func (Config) JenkinsMatrixJobs

func (c Config) JenkinsMatrixJobs() map[string]JenkinsMatrixJobInfo

JenkinsMatrixJobs returns the set of Jenkins matrix jobs.

func (Config) ProjectTests

func (c Config) ProjectTests(projects []string) []string

ProjectTests returns a list of Jenkins tests associated with the given projects by the config.

func (Config) Projects

func (c Config) Projects() []string

Projects returns a list of projects included in the config.

func (Config) TestDependencies

func (c Config) TestDependencies(test string) []string

TestDependencies returns a list of dependencies for the given test.

func (Config) TestParts

func (c Config) TestParts(test string) []string

TestParts returns a list of strings that identify different test parts.

func (Config) VDLPath

func (c Config) VDLPath(jirix *jiri.X) string

VDLPath computes and returns the VDLPATH environment variable based on the current jiri configuration.

func (Config) VDLWorkspaces

func (c Config) VDLWorkspaces() []string

VDLWorkspaces returns the VDL workspaces included in the config.

type ConfigOpt

type ConfigOpt interface {
	// contains filtered or unexported methods
}

ConfigOpt is an interface for Config factory options.

type CopyrightCheckProjectsOpt

type CopyrightCheckProjectsOpt map[string]struct{}

CopyrightCheckProjectsOpt is the type that can be used to pass the Config factory a copyright check projects option.

type GoWorkspacesOpt

type GoWorkspacesOpt []string

GoWorkspacesOpt is the type that can be used to pass the Config factory a Go workspace option.

type JenkinsMatrixJobInfo

type JenkinsMatrixJobInfo struct {
	HasArch  bool `xml:"arch,attr"`
	HasOS    bool `xml:"OS,attr"`
	HasParts bool `xml:"parts,attr"`
	// ShowOS determines whether to show OS label in job summary.
	// It is possible that a job (e.g. jiri-go-race) has an OS axis but
	// the axis only has a single value in order to constrain where its
	// sub-builds run. In such cases, we do not want to show the OS label.
	ShowOS bool   `xml:"showOS,attr"`
	Name   string `xml:",chardata"`
}

type JenkinsMatrixJobsOpt

type JenkinsMatrixJobsOpt map[string]JenkinsMatrixJobInfo

JenkinsMatrixJobsOpt is the type that can be used to pass the Config factory a Jenkins matrix jobs option.

type OncallRotation

type OncallRotation struct {
	Shifts  []OncallShift `xml:"shift"`
	XMLName xml.Name      `xml:"rotation"`
}

func LoadOncallRotation

func LoadOncallRotation(jirix *jiri.X) (*OncallRotation, error)

LoadOncallRotation parses the default oncall schedule file.

type OncallShift

type OncallShift struct {
	Primary   string `xml:"primary"`
	Secondary string `xml:"secondary"`
	Date      string `xml:"startDate"`
}

func Oncall

func Oncall(jirix *jiri.X, targetTime time.Time) (*OncallShift, error)

Oncall finds the oncall shift at the given time from the oncall configuration file by comparing timestamps.

type ProjectTestsOpt

type ProjectTestsOpt map[string][]string

ProjectTestsOpt is the type that can be used to pass the Config factory a project tests option.

type TestDependenciesOpt

type TestDependenciesOpt map[string][]string

TestDependenciesOpt is the type that can be used to pass the Config factory a test dependencies option.

type TestGroupsOpt

type TestGroupsOpt map[string][]string

TestGroupsOpt is the type that can be used to pass the Config factory a test groups option.

type TestPartsOpt

type TestPartsOpt map[string][]string

TestPartsOpt is the type that can be used to pass the Config factory a test parts option.

type VDLWorkspacesOpt

type VDLWorkspacesOpt []string

VDLWorkspacesOpt is the type that can be used to pass the Config factory a VDL workspace option.

Jump to

Keyboard shortcuts

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