config

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultManager

type DefaultManager struct {
}

DefaultManager implements the Manager interface

func (*DefaultManager) GetBoolWithDefault

func (m *DefaultManager) GetBoolWithDefault(key string, defaultValue bool) bool

GetBoolWithDefault gets a boolean configuration value by key, returns default if not found or invalid

func (*DefaultManager) GetDurationWithDefault added in v0.1.6

func (m *DefaultManager) GetDurationWithDefault(key string, defaultValue time.Duration) time.Duration

GetDurationWithDefault gets a duration configuration value by key, returns default if not found or invalid

func (*DefaultManager) GetInt

func (m *DefaultManager) GetInt(key string) (int, error)

GetInt gets an integer configuration value by key, returns error if not found or invalid

func (*DefaultManager) GetIntWithDefault

func (m *DefaultManager) GetIntWithDefault(key string, defaultValue int) int

GetIntWithDefault gets an integer configuration value by key, returns default if not found or invalid

func (*DefaultManager) GetModelConfig

func (m *DefaultManager) GetModelConfig() ModelConfig

GetModelConfig returns the default model configuration from environment variables or defaults

func (*DefaultManager) GetString

func (m *DefaultManager) GetString(key string) (string, error)

GetString gets a configuration value by key, returns error if not found

func (*DefaultManager) GetStringWithDefault

func (m *DefaultManager) GetStringWithDefault(key, defaultValue string) string

GetStringWithDefault gets a configuration value by key, returns default if not found

func (*DefaultManager) RequireString

func (m *DefaultManager) RequireString(key string) string

RequireString gets a configuration value by key, panics if not found

type Manager

type Manager interface {
	GetString(key string) (string, error)
	GetStringWithDefault(key, defaultValue string) string
	RequireString(key string) string
	GetInt(key string) (int, error)
	GetIntWithDefault(key string, defaultValue int) int
	GetBoolWithDefault(key string, defaultValue bool) bool
	GetDurationWithDefault(key string, defaultValue time.Duration) time.Duration
	GetModelConfig() ModelConfig
}

Manager provides configuration management functionality

func NewConfigManager

func NewConfigManager() Manager

NewConfigManager creates a new default config manager

type ModelConfig

type ModelConfig struct {
	ModelName   string
	MaxTokens   int32
	Temperature float32
	TopP        float32
}

ModelConfig represents the default model configuration

Jump to

Keyboard shortcuts

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