configmanager

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package configmanager provides centralized configuration management using Viper. This file contains the interfaces for configuration management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterName

func GetClusterName(config any) (string, error)

GetClusterName extracts the cluster name from supported Kind or K3d config structures.

Types

type ConfigManager

type ConfigManager[T any] interface {
	// LoadConfig loads the configuration from files and environment variables.
	// Returns the previously loaded config if already loaded.
	// If timer is provided, timing information will be included in the success notification.
	LoadConfig(tmr timer.Timer) error

	// GetConfig returns the currently loaded configuration.
	// If the configuration has not been loaded yet, it returns nil.
	GetConfig() *T
}

ConfigManager provides configuration management functionality.

type MockConfigManager

type MockConfigManager[T any] struct {
	mock.Mock
}

MockConfigManager is an autogenerated mock type for the ConfigManager type

func NewMockConfigManager

func NewMockConfigManager[T any](t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConfigManager[T]

NewMockConfigManager creates a new instance of MockConfigManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockConfigManager[T]) EXPECT

func (_m *MockConfigManager[T]) EXPECT() *MockConfigManager_Expecter[T]

func (*MockConfigManager[T]) GetConfig

func (_mock *MockConfigManager[T]) GetConfig() *T

GetConfig provides a mock function for the type MockConfigManager

func (*MockConfigManager[T]) LoadConfig

func (_mock *MockConfigManager[T]) LoadConfig(tmr timer.Timer) error

LoadConfig provides a mock function for the type MockConfigManager

type MockConfigManager_Expecter

type MockConfigManager_Expecter[T any] struct {
	// contains filtered or unexported fields
}

func (*MockConfigManager_Expecter[T]) GetConfig

GetConfig is a helper method to define mock.On call

func (*MockConfigManager_Expecter[T]) LoadConfig

func (_e *MockConfigManager_Expecter[T]) LoadConfig(tmr interface{}) *MockConfigManager_LoadConfig_Call[T]

LoadConfig is a helper method to define mock.On call

  • tmr timer.Timer

type MockConfigManager_GetConfig_Call

type MockConfigManager_GetConfig_Call[T any] struct {
	*mock.Call
}

MockConfigManager_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'

func (*MockConfigManager_GetConfig_Call[T]) Return

func (*MockConfigManager_GetConfig_Call[T]) Run

func (*MockConfigManager_GetConfig_Call[T]) RunAndReturn

func (_c *MockConfigManager_GetConfig_Call[T]) RunAndReturn(run func() *T) *MockConfigManager_GetConfig_Call[T]

type MockConfigManager_LoadConfig_Call

type MockConfigManager_LoadConfig_Call[T any] struct {
	*mock.Call
}

MockConfigManager_LoadConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadConfig'

func (*MockConfigManager_LoadConfig_Call[T]) Return

func (*MockConfigManager_LoadConfig_Call[T]) Run

func (*MockConfigManager_LoadConfig_Call[T]) RunAndReturn

Directories

Path Synopsis
Package helpers provides common functionality for config managers to eliminate duplication.
Package helpers provides common functionality for config managers to eliminate duplication.
Package k3d provides configuration management for K3d v1alpha5.SimpleConfig configurations.
Package k3d provides configuration management for K3d v1alpha5.SimpleConfig configurations.
Package kind provides configuration management for Kind cluster configurations.
Package kind provides configuration management for Kind cluster configurations.
Package configmanager provides configuration management for KSail v1alpha1.Cluster configurations.
Package configmanager provides configuration management for KSail v1alpha1.Cluster configurations.
Package testutils provides common test utilities for config manager testing.
Package testutils provides common test utilities for config manager testing.

Jump to

Keyboard shortcuts

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