mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-25 14:12:16 +00:00
chore: Update Go dependencies and replace interface{} with any type alias
- Update charmbracelet/colorprofile from v0.4.1 to v0.4.3 - Update charmbracelet/x/ansi from v0.11.6 to v0.11.7 - Update clipperhouse/displaywidth from v0.9.0 to v0.11.0 - Update clipperhouse/uax29/v2 from v2.5.0 to v2.7.0 - Update davecgh/go-spew to v1.1.2-0.20180830191138-d8f796af33cc - Update fsnotify/fsnotify from v1.7.0 to v1.9.0 - Update google/go-cmp from v0.5.9 to v0.7.0 - Update lucasb-eyer/go-colorful from v1.3.0 to v1.4
This commit is contained in:
@@ -9,13 +9,13 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
ConfigFile string
|
||||
ConfigFile string
|
||||
Profile string
|
||||
APIEndpoint string
|
||||
APIToken string
|
||||
Verbose bool
|
||||
NoColor bool
|
||||
|
||||
|
||||
// Configuration sections
|
||||
API APIConfig `mapstructure:"api"`
|
||||
UI UIConfig `mapstructure:"ui"`
|
||||
@@ -24,11 +24,11 @@ type Config struct {
|
||||
}
|
||||
|
||||
type APIConfig struct {
|
||||
Endpoint string `mapstructure:"endpoint"`
|
||||
Timeout string `mapstructure:"timeout"`
|
||||
Retries int `mapstructure:"retries"`
|
||||
Token string `mapstructure:"token"`
|
||||
Insecure bool `mapstructure:"insecure"`
|
||||
Endpoint string `mapstructure:"endpoint"`
|
||||
Timeout string `mapstructure:"timeout"`
|
||||
Retries int `mapstructure:"retries"`
|
||||
Token string `mapstructure:"token"`
|
||||
Insecure bool `mapstructure:"insecure"`
|
||||
Headers map[string]string `mapstructure:"headers"`
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ type UIConfig struct {
|
||||
}
|
||||
|
||||
type PluginConfig struct {
|
||||
Enabled []string `mapstructure:"enabled"`
|
||||
Disabled []string `mapstructure:"disabled"`
|
||||
Config map[string]interface{} `mapstructure:"config"`
|
||||
Enabled []string `mapstructure:"enabled"`
|
||||
Disabled []string `mapstructure:"disabled"`
|
||||
Config map[string]any `mapstructure:"config"`
|
||||
}
|
||||
|
||||
type LoggingConfig struct {
|
||||
@@ -85,7 +85,7 @@ func NewConfig() *Config {
|
||||
Plugins: PluginConfig{
|
||||
Enabled: []string{},
|
||||
Disabled: []string{},
|
||||
Config: make(map[string]interface{}),
|
||||
Config: make(map[string]any),
|
||||
},
|
||||
Logging: LoggingConfig{
|
||||
Level: "info",
|
||||
@@ -174,46 +174,46 @@ func (c *Config) createDefaultConfig() error {
|
||||
}
|
||||
|
||||
configFile := filepath.Join(configDir, "config.yaml")
|
||||
|
||||
|
||||
// Create default config
|
||||
defaultConfig := map[string]interface{}{
|
||||
"api": map[string]interface{}{
|
||||
defaultConfig := map[string]any{
|
||||
"api": map[string]any{
|
||||
"endpoint": "http://localhost:8000",
|
||||
"timeout": "30s",
|
||||
"retries": 3,
|
||||
"insecure": false,
|
||||
},
|
||||
"ui": map[string]interface{}{
|
||||
"ui": map[string]any{
|
||||
"theme": "default",
|
||||
"colors": true,
|
||||
"pager": true,
|
||||
"table-style": "default",
|
||||
},
|
||||
"logging": map[string]interface{}{
|
||||
"logging": map[string]any{
|
||||
"level": "info",
|
||||
"format": "text",
|
||||
"output": "stdout",
|
||||
},
|
||||
"plugins": map[string]interface{}{
|
||||
"plugins": map[string]any{
|
||||
"enabled": []string{},
|
||||
"disabled": []string{},
|
||||
},
|
||||
"profiles": map[string]interface{}{
|
||||
"development": map[string]interface{}{
|
||||
"api": map[string]interface{}{
|
||||
"profiles": map[string]any{
|
||||
"development": map[string]any{
|
||||
"api": map[string]any{
|
||||
"endpoint": "http://dev-api:8000",
|
||||
"insecure": true,
|
||||
},
|
||||
"logging": map[string]interface{}{
|
||||
"logging": map[string]any{
|
||||
"level": "debug",
|
||||
},
|
||||
},
|
||||
"production": map[string]interface{}{
|
||||
"api": map[string]interface{}{
|
||||
"production": map[string]any{
|
||||
"api": map[string]any{
|
||||
"endpoint": "https://api.telecom-platform.com",
|
||||
"timeout": "60s",
|
||||
},
|
||||
"logging": map[string]interface{}{
|
||||
"logging": map[string]any{
|
||||
"level": "warn",
|
||||
},
|
||||
},
|
||||
@@ -232,9 +232,9 @@ func (c *Config) applyProfile(profileName string) error {
|
||||
}
|
||||
|
||||
// Apply profile configuration
|
||||
if profile, ok := profileData.(map[string]interface{}); ok {
|
||||
if profile, ok := profileData.(map[string]any); ok {
|
||||
// Apply API settings
|
||||
if api, ok := profile["api"].(map[string]interface{}); ok {
|
||||
if api, ok := profile["api"].(map[string]any); ok {
|
||||
if endpoint, ok := api["endpoint"].(string); ok {
|
||||
c.API.Endpoint = endpoint
|
||||
}
|
||||
@@ -250,7 +250,7 @@ func (c *Config) applyProfile(profileName string) error {
|
||||
}
|
||||
|
||||
// Apply UI settings
|
||||
if ui, ok := profile["ui"].(map[string]interface{}); ok {
|
||||
if ui, ok := profile["ui"].(map[string]any); ok {
|
||||
if theme, ok := ui["theme"].(string); ok {
|
||||
c.UI.Theme = theme
|
||||
}
|
||||
@@ -260,7 +260,7 @@ func (c *Config) applyProfile(profileName string) error {
|
||||
}
|
||||
|
||||
// Apply logging settings
|
||||
if logging, ok := profile["logging"].(map[string]interface{}); ok {
|
||||
if logging, ok := profile["logging"].(map[string]any); ok {
|
||||
if level, ok := logging["level"].(string); ok {
|
||||
c.Logging.Level = level
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user