config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the default config file path

Types

type Config

type Config struct {
	Workspace     *WorkspaceConfig `json:"workspace,omitempty"`
	Git           *GitConfig       `json:"git,omitempty"`
	Logging       *LoggingConfig   `json:"logging,omitempty"`
	TrustLevel    string           `json:"trust_level,omitempty"`
	RateLimit     *RateLimitConfig `json:"rate_limit,omitempty"`
	DryRun        bool             `json:"dry_run,omitempty"`
	GRPCEndpoints []string         `json:"grpc_endpoints,omitempty"`
	Transport     string           `json:"transport,omitempty"`
	HTTPPort      string           `json:"http_port,omitempty"`
	ApprovalMode  bool             `json:"approval_mode,omitempty"`
	ApprovalTTL   string           `json:"approval_ttl,omitempty"`
	Toolsets      string           `json:"toolsets,omitempty"`
}

Config represents the complete MCP server configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

func LoadConfig

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

LoadConfig loads configuration from a file, with fallback to defaults

func LoadConfigFromEnv

func LoadConfigFromEnv() (*Config, error)

LoadConfigFromEnv loads configuration from the default or specified config file and overlays environment variable overrides.

func (*Config) SaveConfig

func (c *Config) SaveConfig(configPath string) error

SaveConfig saves the configuration to a file

type GitConfig

type GitConfig struct {
	ConfigIsolation  bool   `json:"config_isolation"`
	CredentialHelper string `json:"credential_helper"`
	DefaultUserName  string `json:"default_user_name"`
	DefaultUserEmail string `json:"default_user_email"`
}

GitConfig holds git-specific configuration

type LoggingConfig

type LoggingConfig struct {
	Level    string `json:"level"`
	FilePath string `json:"file_path"`
	MaxSize  int    `json:"max_size_mb"`
}

LoggingConfig holds logging configuration

type RateLimitConfig

type RateLimitConfig struct {
	ChainTxPerMinute int `json:"chain_tx_per_minute"`
	ChainTxPerHour   int `json:"chain_tx_per_hour"`
}

RateLimitConfig holds rate limiting configuration for chain transactions.

type WorkspaceConfig

type WorkspaceConfig struct {
	BasePath string `json:"base_path"`
}

WorkspaceConfig holds workspace-specific configuration. This is defined here to avoid circular dependencies.

Jump to

Keyboard shortcuts

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