Documentation
¶
Index ¶
- func IsSkippedModuleError(err error) bool
- func Load(ctx context.Context, opts LoadOptions) error
- func NewSkippedModuleError(moduleID string, err error) error
- type DisabledErrorFactory
- type FeatureGates
- type IconContributor
- type IconDefinition
- type IconDefinitionFunc
- type IconLibrary
- type IconLibraryFunc
- type LoadOptions
- type Manifest
- type MenuContributor
- type MenuItemsFunc
- type Module
- type RegisterFunc
- type SkipDependencyFunc
- type Translator
- type TranslatorAware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSkippedModuleError ¶ added in v0.32.0
IsSkippedModuleError returns true when the error indicates the current module should be skipped.
func Load ¶
func Load(ctx context.Context, opts LoadOptions) error
Load registers modules after validating dependencies, feature flags, and ordering.
func NewSkippedModuleError ¶ added in v0.32.0
NewSkippedModuleError marks a module as intentionally skipped while continuing startup.
Types ¶
type DisabledErrorFactory ¶
DisabledErrorFactory builds feature-disabled errors for modules.
type FeatureGates ¶
type FeatureGates = fggate.FeatureGate
FeatureGates evaluates feature enablement.
type IconContributor ¶ added in v0.25.0
type IconContributor interface {
IconLibraries() []IconLibrary
IconDefinitions() []IconDefinition
}
IconContributor optionally lets a module contribute icon libraries and definitions.
type IconDefinition ¶ added in v0.25.0
type IconDefinition struct {
ID string `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
Type string `json:"type"`
Library string `json:"library"`
Content string `json:"content"`
Keywords []string `json:"keywords"`
Category string `json:"category"`
Trusted bool `json:"trusted"`
}
IconDefinition represents a single icon contribution from a module.
type IconDefinitionFunc ¶ added in v0.25.0
type IconDefinitionFunc func(icon IconDefinition) error
IconDefinitionFunc forwards contributed icon definitions to the host.
type IconLibrary ¶ added in v0.25.0
type IconLibrary struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CDN string `json:"cdn"`
CSSClass string `json:"css_class"`
RenderMode string `json:"render_mode"`
Priority int `json:"priority"`
Trusted bool `json:"trusted"`
}
IconLibrary represents an icon library contribution from a module.
type IconLibraryFunc ¶ added in v0.25.0
type IconLibraryFunc func(lib IconLibrary) error
IconLibraryFunc forwards contributed icon libraries to the host.
type LoadOptions ¶
type LoadOptions struct {
Modules []Module `json:"modules"`
Gates FeatureGates `json:"gates"`
DefaultLocale string `json:"default_locale"`
Translator Translator `json:"translator"`
DisabledError DisabledErrorFactory `json:"disabled_error"`
Register RegisterFunc `json:"register"`
SkipDependency SkipDependencyFunc `json:"skip_dependency"`
AddMenuItems MenuItemsFunc `json:"add_menu_items"`
AddIconLibrary IconLibraryFunc `json:"add_icon_library"`
AddIconDefinition IconDefinitionFunc `json:"add_icon_definition"`
RegisterDefaults func() error `json:"register_defaults"`
}
LoadOptions configures module loading.
type Manifest ¶
type Manifest struct {
ID string `json:"id"`
NameKey string `json:"name_key"`
DescriptionKey string `json:"description_key"`
Dependencies []string `json:"dependencies"`
FeatureFlags []string `json:"feature_flags"`
}
Manifest captures identifying metadata and dependencies for a module.
type MenuContributor ¶
type MenuContributor interface {
MenuItems(locale string) []navinternal.MenuItem
}
MenuContributor optionally lets a module contribute navigation items.
type MenuItemsFunc ¶
type MenuItemsFunc func(ctx context.Context, items []navinternal.MenuItem) error
MenuItemsFunc forwards contributed menu items to the host.
type Module ¶
type Module interface {
Manifest() Manifest
}
Module exposes manifest metadata used for ordering and validation.
type RegisterFunc ¶
RegisterFunc executes module registration using host-provided context.
type SkipDependencyFunc ¶ added in v0.32.0
SkipDependencyFunc handles modules skipped because one of their dependencies was skipped earlier in the load order.
type Translator ¶
type Translator = helpers.Translator
Translator resolves i18n keys into localized strings.
type TranslatorAware ¶
type TranslatorAware interface {
WithTranslator(Translator)
}
TranslatorAware receives a translator before registration.