base

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 4 Imported by: 7

Documentation

Overview

Package base provides a generic base module that can be extended with different configurations.

Index

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.

Jump to

Keyboard shortcuts

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