Documentation ¶
Overview ¶
Package base provides a generic base module that can be extended with different configurations.
Index ¶
- type ConfigGetter
- type ConfigurableModule
- func (m *ConfigurableModule[T]) GetConfig(name string) (T, error)
- func (m *ConfigurableModule[T]) LoadModule(moduleName string, additionalFuncs starlark.StringDict) starlet.ModuleLoader
- func (m *ConfigurableModule[T]) SetConfig(name string, getter ConfigGetter[T])
- func (m *ConfigurableModule[T]) SetConfigValue(name string, value T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigGetter ¶
type ConfigGetter[T any] func() T
ConfigGetter is a function type that returns a value of type T.
type ConfigurableModule ¶
type ConfigurableModule[T any] struct { // contains filtered or unexported fields }
ConfigurableModule provides a generic base module that can be extended with different configurations.
func NewConfigurableModule ¶
func NewConfigurableModule[T any]() *ConfigurableModule[T]
NewConfigurableModule creates a new instance of ConfigurableModule.
func (*ConfigurableModule[T]) GetConfig ¶
func (m *ConfigurableModule[T]) GetConfig(name string) (T, error)
GetConfig retrieves the configuration value for a given name.
func (*ConfigurableModule[T]) LoadModule ¶
func (m *ConfigurableModule[T]) LoadModule(moduleName string, additionalFuncs starlark.StringDict) starlet.ModuleLoader
LoadModule returns a Starlark module loader with the given configurations and additional functions.
func (*ConfigurableModule[T]) SetConfig ¶
func (m *ConfigurableModule[T]) SetConfig(name string, getter ConfigGetter[T])
SetConfig sets a configuration getter for a given name.
func (*ConfigurableModule[T]) SetConfigValue ¶ added in v0.0.3
func (m *ConfigurableModule[T]) SetConfigValue(name string, value T)
SetConfigValue sets a configuration value for a given name.
Click to show internal directories.
Click to hide internal directories.