doc

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: 13 Imported by: ? 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 (
	ErrBadRequest = errors.New("driver and section filters are mutually exclusive")
)

Functions

func AddObjectKeywordGrants

func AddObjectKeywordGrants(items api.KeywordDefinitionItems, kind naming.Kind)

AddObjectKeywordGrants says, on each keyword of an object of kind, the grant setting it through the api needs, as the keyword operation policy says it: the grant, the sentence the documentation shows, and whether the grant is needed whatever the value.

A keyword of a driver, as the rcmd of a kvm container, also needs the grant choosing the driver does: a user who may not set the type of the section may not set any keyword of it, so a keyword whose drivers are all refused to that user is reported needing the grant whatever its value. A type refused or not by the rest of the section, as the ip ones, is no such driver: the keywords of a netns address are a namespace administrator's when the address is drawn from a cluster network.

func ConvertKeywordGroups

func ConvertKeywordGroups(groups []keywords.DriverGroup) api.KeywordGroupItems

ConvertKeywordGroups returns the api items of the groups of keywords, in their order, each list empty rather than null.

func ConvertKeywordStore

func ConvertKeywordStore(store keywords.Store) api.KeywordDefinitionItems

func DriverGrant

func DriverGrant(kind naming.Kind, section, typ string) string

DriverGrant returns the grant choosing the driver typ of the group section of an object of kind needs, empty when any user may choose it, or when whether one may depends on the rest of the section, as the ip ones.

func FilterKeywordStore

func FilterKeywordStore(store keywords.Store, driver, section, option *string, path naming.Path, getConfigProvider func() (ConfigProvider, error)) (keywords.Store, error)

func FindKeywords

func FindKeywords(kw string, withDriver bool, get func(section, option *string) (api.KeywordDefinitionItems, error)) (api.KeywordDefinitionItems, error)

FindKeywords returns the documentation of the keywords a --kw value names, from the first of its lookups finding some.

A value naming no keyword is an error, rather than an empty documentation: nothing printed reads as a keyword with no text. A lookup failing is a lookup finding nothing, as a bare word that is not a section fails as a section, unless it is the only one.

func KeywordGrant

func KeywordGrant(kind naming.Kind, section, option string, types []string) (string, bool)

KeywordGrant returns the grant setting a keyword of an object of kind needs through the api, empty when any user granted on the namespace may set it, and whether it is needed whatever the value. types are the drivers the keyword belongs to.

func KeywordGrantDoc

func KeywordGrantDoc(kind naming.Kind, section, option string, types []string) string

KeywordGrantDoc returns the sentence the documentation of a keyword of an object of kind shows about the grant setting it needs, or an empty string when any user granted on the namespace may set it: the grantDoc of the api. types are the drivers the keyword belongs to.

Types

type ConfigProvider

type ConfigProvider interface {
	Config() *xconfig.T
}

type KeywordQuery

type KeywordQuery struct {
	Section *string
	Option  *string
}

KeywordQuery is a lookup of the keyword documentation, by section and option, either nil for any.

func KeywordQueries

func KeywordQueries(s string, withDriver bool) []KeywordQuery

KeywordQueries returns the lookups a --kw value is tried as, in order, until one finds keywords.

The value is [<section>.]<option>. A bare word is first an option, in any section, as the flag says, and then a section, listing its keywords. With a driver, a bare word is only an option: the driver names the section.

Jump to

Keyboard shortcuts

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