Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultConfigFilename = ".projectmemoryconfig" DefaultSQLitePath = ".projectmemory.db" DefaultLogLevel = "info" DefaultLogFormat = "text" )
Default configuration values
Variables ¶
This section is empty.
Functions ¶
func GetLoggerFromConfig ¶
GetLoggerFromConfig creates a gomcp logx.Logger based on the configuration
Types ¶
type Config ¶
type Config struct {
// Store contains storage-related configuration.
Store struct {
// SQLitePath is the path to the SQLite database file.
SQLitePath string `json:"sqlite_path" env:"SQLITE_PATH" validate:"required"`
} `json:"store"`
// Summarizer contains summarization-related configuration.
Summarizer struct {
// Provider is the name of the summarization provider to use.
Provider string `json:"provider" env:"SUMMARIZER_PROVIDER"`
// ApiKey is the API key for the summarization provider.
ApiKey string `json:"api_key" env:"SUMMARIZER_API_KEY"`
} `json:"summarizer"`
// Embedder contains embedding-related configuration.
Embedder struct {
// Provider is the name of the embedding provider to use.
Provider string `json:"provider" env:"EMBEDDER_PROVIDER"`
// Dimensions is the number of dimensions for the embeddings.
Dimensions int `json:"dimensions" env:"EMBEDDER_DIMENSIONS" validate:"min:1"`
// ApiKey is the API key for the embedding provider.
ApiKey string `json:"api_key" env:"EMBEDDER_API_KEY"`
} `json:"embedder"`
// Logging contains logging-related configuration.
Logging struct {
// Level is the minimum log level to display ("debug", "info", "warn", "error").
Level string `json:"level" env:"LOG_LEVEL" validate:"required"`
// Format is the log format to use ("text", "json").
Format string `json:"format" env:"LOG_FORMAT"`
} `json:"logging"`
// contains filtered or unexported fields
}
Config represents the ProjectMemory configuration
var ( // Global is the global configuration instance Global *Config )
Global configuration instance
func InitGlobal ¶
InitGlobal initializes the global configuration
func LoadConfig ¶
LoadConfig loads the configuration from the default path
func LoadConfigWithPath ¶
LoadConfigWithPath loads the configuration from a specific path
func NewConfig ¶
func NewConfig() *Config
NewConfig creates a new Config instance with default values
func (*Config) GetConfigPath ¶
GetConfigPath returns the path of the currently loaded configuration file
func (*Config) SaveToFile ¶
SaveToFile saves the configuration to the specified file
Click to show internal directories.
Click to hide internal directories.