Documentation
¶
Index ¶
- func DecodeConfig(defaultContentRole string, m map[string]any) (*config.ConfigNamespace[map[string]RoleConfig, RolesInternal], string, error)
- type Role
- type RoleConfig
- type RoleInternal
- type Roles
- type RolesInternal
- func (r RolesInternal) ForEachIndex() iter.Seq[int]
- func (r RolesInternal) Has(role string) bool
- func (r RolesInternal) IndexDefault() int
- func (r RolesInternal) IndexMatch(match predicate.P[string]) (iter.Seq[int], error)
- func (r RolesInternal) Len() int
- func (r RolesInternal) ResolveIndex(name string) int
- func (r RolesInternal) ResolveName(i int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeConfig ¶
func DecodeConfig(defaultContentRole string, m map[string]any) (*config.ConfigNamespace[map[string]RoleConfig, RolesInternal], string, error)
Types ¶
type RoleConfig ¶
type RoleConfig struct {
// The weight of the role.
// Used to determine the order of the roles.
// If zero, we use the role name.
Weight int
}
type RoleInternal ¶
type RoleInternal struct {
// Name is the name of the role, extracted from the key in the config.
Name string
// Whether this role is the default role.
// This will be rendered in the root.
// There is only be one default role.
Default bool
RoleConfig
}
type RolesInternal ¶
type RolesInternal struct {
Sorted []RoleInternal
// contains filtered or unexported fields
}
func (RolesInternal) ForEachIndex ¶
func (r RolesInternal) ForEachIndex() iter.Seq[int]
ForEachIndex returns an iterator for the indices of the roles.
func (RolesInternal) Has ¶
func (r RolesInternal) Has(role string) bool
func (RolesInternal) IndexDefault ¶
func (r RolesInternal) IndexDefault() int
func (RolesInternal) IndexMatch ¶
IndexMatch returns an iterator for the roles that match the filter.
func (RolesInternal) Len ¶
func (r RolesInternal) Len() int
func (RolesInternal) ResolveIndex ¶
func (r RolesInternal) ResolveIndex(name string) int
func (RolesInternal) ResolveName ¶
func (r RolesInternal) ResolveName(i int) string
Click to show internal directories.
Click to hide internal directories.