configkeywords

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 10 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

Overview

Package configkeywords answers the keywords of an object or node configuration, raw or evaluated, as a list of keyword items.

The daemon api answers them, and om answers them the same way when it reads the configuration itself, with --local or with the daemon down: the two answers are the same list, rendered by the same code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasPattern

func HasPattern(l []string) bool

HasPattern says whether a keyword of the selection is a pattern, which answers a list whatever the number of keys it matched.

func IsPattern

func IsPattern(s string) bool

IsPattern says whether a keyword of a selection stands for the keys it matches rather than for one key.

The section is a resource selector element, the same as a --rid one: a driver group, as "container", or a pattern, as "cont*", matches the sections of the resources it names. The option is a pattern when it holds one, as "*" or "stop_*", and matches the options the keywords of the section have, whether the configuration sets them or not.

A pattern filters: a section without the keyword is skipped, and matching nothing is no error. A keyword naming one key selects it, as it always did.

func Node

func Node(nodename string, o Options) (api.KeywordItems, error)

Node answers the keywords of the configuration of the local node, named nodename in the items.

The keys of the whole configuration are the ones the node configuration sets. The value of a keyword is the one that applies to the node, from its configuration or the cluster's, and a keyword set nowhere still evaluates, to its default. A pattern matches the sections of both, as a heartbeat is configured in the cluster's.

func Object

func Object(p naming.Path, o Options) (api.KeywordItems, error)

Object answers the keywords of the configuration of an object.

A keyword selection is a user input, so a key it names and can not evaluate is an error, which is xconfig.ErrNoKeyword for a keyword that does not exist. The keys a pattern matches, or the whole configuration, are not: failing on the first one would hide all the others, so each item says what failed.

Types

type Options

type Options struct {
	// Keywords are the keywords to answer, and none is the whole
	// configuration.
	//
	// The section of one is a resource selector element when it is a
	// driver group or a pattern, and its option is a pattern when it
	// holds one: see IsPattern.
	Keywords []string

	// Evaluate answers the evaluated value of each keyword beside its
	// raw value.
	Evaluate bool

	// Impersonate is the node the values are evaluated as, the local
	// node when empty.
	Impersonate string

	// Redact hides the value of the secret keywords, for a reader not
	// allowed to see them.
	Redact bool
}

Options says which keywords to answer, and how.

Jump to

Keyboard shortcuts

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