Documentation
¶
Index ¶
- Variables
- func AddObjectKeywordGrants(items api.KeywordDefinitionItems, kind naming.Kind)
- func ConvertKeywordStore(store keywords.Store) api.KeywordDefinitionItems
- func DriverGrant(kind naming.Kind, section, typ string) string
- func FilterKeywordStore(store keywords.Store, driver, section, option *string, path naming.Path, ...) (keywords.Store, error)
- func FindKeywords(kw string, withDriver bool, ...) (api.KeywordDefinitionItems, error)
- func KeywordGrant(kind naming.Kind, section, option string, types []string) (string, bool)
- func KeywordGrantDoc(kind naming.Kind, section, option string, types []string) string
- type ConfigProvider
- type KeywordQuery
Constants ¶
This section is empty.
Variables ¶
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 ConvertKeywordStore ¶
func ConvertKeywordStore(store keywords.Store) api.KeywordDefinitionItems
func DriverGrant ¶
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 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 ¶
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 ¶
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 KeywordQuery ¶
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.