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 ¶
ServiceConfigSet returns the name of a config set for the specified service.
func (ConfigSet) Split ¶
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.
func (ProjectName) Validate ¶
func (p ProjectName) Validate() error
Validate returns an error if the supplied ProjectName is not a valid project name.