cfgtypes

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSet

type ConfigSet string

ConfigSet is a configuration service Config Set string.

A config set consists of a domain and a series of path components: domain/target/refs...

  • Service config sets are config sets in the "services" domain, with the service name as the target.
  • Project config sets are config sets in the "projects" domain. The target is the project name.

func ProjectConfigSet

func ProjectConfigSet(name ProjectName) ConfigSet

ProjectConfigSet returns the config set for the specified project.

func RefConfigSet

func RefConfigSet(name ProjectName, ref string) ConfigSet

RefConfigSet returns the config set for the specified project and ref. If ref is empty, this will equal the ProjectConfigSet value.

func ServiceConfigSet

func ServiceConfigSet(name string) ConfigSet

ServiceConfigSet returns the name of a config set for the specified service.

func (ConfigSet) Split

func (cs ConfigSet) Split() (domain, target, ref string)

Split splits a ConfigSet into its domain, target, and ref components.

func (ConfigSet) SplitProject

func (cs ConfigSet) SplitProject() (project ProjectName, projectConfigSet ConfigSet, ref string)

SplitProject splits a project-rooted config set (projects/<name>[/...]) into its project name, project config set, and ref components.

For example, "projects/foo/bar/baz" is a config set that belongs to project "foo". It will be parsed into:

  • project: "foo"
  • projectConfigSet: "projects/foo"
  • ref: "bar/baz"

If configSet is not a project config set, empty strings will be returned.

type ProjectName

type ProjectName string

ProjectName is a luci-config project name.

A valid project name may only include:

  • Lowercase letters [a-z]
  • Numbers [0-9]
  • Hyphen (-)
  • Underscore (_)

It also must begin with a letter.

See: https://github.com/luci/luci-py/blob/8e594074929871a9761d27e814541bc0d7d84744/appengine/components/components/config/common.py#L41

func (*ProjectName) Set

func (p *ProjectName) Set(v string) error

Set implements flag.Value.

func (*ProjectName) String

func (p *ProjectName) String() string

String implements flag.Value.

func (ProjectName) Validate

func (p ProjectName) Validate() error

Validate returns an error if the supplied ProjectName is not a valid project name.

Jump to

Keyboard shortcuts

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