config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBaseURL is the public Yunxiao OpenAPI host used by the Node reference server.
	DefaultBaseURL = "https://openapi-rdc.aliyuncs.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StaticConfig

type StaticConfig struct {
	Port                  int      `mapstructure:"port"`
	SSEBaseURL            string   `mapstructure:"sse_base_url"`
	LogLevel              string   `mapstructure:"log_level"`
	BaseURL               string   `mapstructure:"base_url"`
	AccessToken           string   `mapstructure:"access_token"`
	InsecureSkipTLSVerify bool     `mapstructure:"insecure_skip_tls_verify"`
	ReadOnly              bool     `mapstructure:"read_only"`
	EnabledTools          []string `mapstructure:"enabled_tools"`
	DisabledTools         []string `mapstructure:"disabled_tools"`
	EnabledDomains        []string `mapstructure:"enabled_domains"`
	DisabledDomains       []string `mapstructure:"disabled_domains"`
	CompactMode           bool     `mapstructure:"compact"`
	RequestTimeoutSeconds int      `mapstructure:"request_timeout_seconds"`
}

StaticConfig contains configuration that is fixed when the server starts.

func LoadConfig

func LoadConfig(configPath string, v *viper.Viper) (*StaticConfig, error)

LoadConfig loads configuration from defaults, optional YAML, environment, and flags.

func (*StaticConfig) GetPortString

func (c *StaticConfig) GetPortString() string

GetPortString returns the configured HTTP listen address.

func (*StaticConfig) Validate

func (c *StaticConfig) Validate() error

Validate checks whether the configuration can be used to start the server.

Jump to

Keyboard shortcuts

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