Documentation
¶
Index ¶
- func GetConfigPath() (string, error)
- type Config
- func (c *Config) GetEndpoints() []Endpoint
- func (c *Config) GetLanguage() string
- func (c *Config) GetLogLevel() int
- func (c *Config) GetPort() int
- func (c *Config) GetWebDAV() *WebDAVConfig
- func (c *Config) GetWindowSize() (width, height int)
- func (c *Config) Save(path string) error
- func (c *Config) UpdateEndpoints(endpoints []Endpoint)
- func (c *Config) UpdateLanguage(language string)
- func (c *Config) UpdateLogLevel(level int)
- func (c *Config) UpdatePort(port int)
- func (c *Config) UpdateWebDAV(webdav *WebDAVConfig)
- func (c *Config) UpdateWindowSize(width, height int)
- func (c *Config) Validate() error
- type Endpoint
- type WebDAVConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigPath ¶
GetConfigPath returns the default config file path
Types ¶
type Config ¶
type Config struct {
Port int `json:"port"`
Endpoints []Endpoint `json:"endpoints"`
LogLevel int `json:"logLevel"` // 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR
Language string `json:"language"` // UI language: en, zh-CN
WindowWidth int `json:"windowWidth"` // Window width in pixels
WindowHeight int `json:"windowHeight"` // Window height in pixels
WebDAV *WebDAVConfig `json:"webdav,omitempty"` // WebDAV synchronization config
// contains filtered or unexported fields
}
Config represents the application configuration
func (*Config) GetEndpoints ¶
GetEndpoints returns a copy of endpoints (thread-safe)
func (*Config) GetLanguage ¶ added in v0.8.0
GetLanguage returns the configured language (thread-safe)
func (*Config) GetLogLevel ¶ added in v0.4.0
GetLogLevel returns the configured log level (thread-safe)
func (*Config) GetWebDAV ¶ added in v1.3.0
func (c *Config) GetWebDAV() *WebDAVConfig
GetWebDAV returns the WebDAV configuration (thread-safe)
func (*Config) GetWindowSize ¶ added in v1.1.2
GetWindowSize returns the configured window size (thread-safe)
func (*Config) UpdateEndpoints ¶
UpdateEndpoints updates the endpoints (thread-safe)
func (*Config) UpdateLanguage ¶ added in v0.8.0
UpdateLanguage updates the language (thread-safe)
func (*Config) UpdateLogLevel ¶ added in v0.4.0
UpdateLogLevel updates the log level (thread-safe)
func (*Config) UpdatePort ¶
UpdatePort updates the port (thread-safe)
func (*Config) UpdateWebDAV ¶ added in v1.3.0
func (c *Config) UpdateWebDAV(webdav *WebDAVConfig)
UpdateWebDAV updates the WebDAV configuration (thread-safe)
func (*Config) UpdateWindowSize ¶ added in v1.1.2
UpdateWindowSize updates the window size (thread-safe)
type Endpoint ¶
type Endpoint struct {
Name string `json:"name"`
APIUrl string `json:"apiUrl"`
APIKey string `json:"apiKey"`
Enabled bool `json:"enabled"`
Transformer string `json:"transformer,omitempty"` // Transformer type: claude, openai, gemini, deepseek
Model string `json:"model,omitempty"` // Target model name for non-Claude APIs
Remark string `json:"remark,omitempty"` // Optional remark for the endpoint
}
Endpoint represents a single API endpoint configuration
type WebDAVConfig ¶ added in v1.3.0
type WebDAVConfig struct {
URL string `json:"url"` // WebDAV server URL
Username string `json:"username"` // Username
Password string `json:"password"` // Password
ConfigPath string `json:"configPath"` // Config backup path (default /ccNexus/config)
StatsPath string `json:"statsPath"` // Stats backup path (default /ccNexus/stats)
}
WebDAVConfig represents WebDAV synchronization configuration