config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides configuration management for CoreMCP. It supports YAML configuration files and environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server  ServerConfig   `mapstructure:"server"`
	Logging LoggingConfig  `mapstructure:"logging"`
	Sources []SourceConfig `mapstructure:"sources"`
}

Config represents the complete CoreMCP configuration.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the CoreMCP configuration from a YAML file. It supports environment variables with COREMCP_ prefix and provides sensible defaults. The path parameter can be a directory or a full file path.

type LoggingConfig

type LoggingConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

type ServerConfig

type ServerConfig struct {
	Name      string `mapstructure:"name"`
	Version   string `mapstructure:"version"`
	Transport string `mapstructure:"transport"`
	Port      int    `mapstructure:"port"`
}

ServerConfig holds server-related configuration.

type SourceConfig

type SourceConfig struct {
	Name     string `mapstructure:"name"`
	Type     string `mapstructure:"type"` // mssql, firebird, postgres
	DSN      string `mapstructure:"dsn"`  // Data Source Name (Connection String)
	ReadOnly bool   `mapstructure:"readonly"`
}

Jump to

Keyboard shortcuts

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