Documentation
¶
Index ¶
- Variables
- func IsValidLanguage(lang string) bool
- func MaskAPIKey(apiKey string, showFirst int) string
- func MaskConfigAPIKeys(data map[string]interface{})
- type Manager
- func (m *Manager) Append(key string, value interface{}) error
- func (m *Manager) Get(key string) (interface{}, bool)
- func (m *Manager) GetClientConfig() (*types.ClientConfig, error)
- func (m *Manager) GetFileIgnore() []string
- func (m *Manager) GetPath() string
- func (m *Manager) GetPrompt(isRich bool) string
- func (m *Manager) GetSupportedKeys() []string
- func (m *Manager) GetTranslationPrompt() string
- func (m *Manager) List() (string, error)
- func (m *Manager) ListWithoutPrompt() map[string]interface{}
- func (m *Manager) Remove(key string, value string) error
- func (m *Manager) Reset(promptOnly bool) error
- func (m *Manager) Set(key string, value interface{}) error
- func (m *Manager) SetProvider(provider, apiKey, apiBase, model string) error
- func (m *Manager) UpdateProviderConfig(provider string, configs map[string]string) error
Constants ¶
This section is empty.
Variables ¶
var OutputLanguageMap = map[string]string{
"en": "English",
"zh-cn": "Simplified Chinese",
"zh-tw": "Traditional Chinese",
"fr": "French",
"vi": "Vietnamese",
"ja": "Japanese",
"ko": "Korean",
"ru": "Russian",
"tr": "Turkish",
"id": "Indonesian",
"th": "Thai",
"de": "German",
"es": "Spanish",
"pt": "Portuguese",
"it": "Italian",
"ar": "Arabic",
"hi": "Hindi",
"el": "Greek",
"pl": "Polish",
"nl": "Dutch",
"sv": "Swedish",
"fi": "Finnish",
"hu": "Hungarian",
"cs": "Czech",
"ro": "Romanian",
"bg": "Bulgarian",
"uk": "Ukrainian",
"he": "Hebrew",
"lt": "Lithuanian",
"la": "Latin",
"ca": "Catalan",
"sr": "Serbian",
"sl": "Slovenian",
"mk": "Macedonian",
"lv": "Latvian",
"bn": "Bengali",
"ta": "Tamil",
"te": "Telugu",
"ml": "Malayalam",
"si": "Sinhala",
"fa": "Persian",
"ur": "Urdu",
"pa": "Punjabi",
"mr": "Marathi",
}
OutputLanguageMap maps language codes to their names
Functions ¶
func IsValidLanguage ¶
IsValidLanguage checks if a language code is valid
func MaskAPIKey ¶
MaskAPIKey masks an API key by showing only the first few characters and replacing the rest with asterisks
func MaskConfigAPIKeys ¶
func MaskConfigAPIKeys(data map[string]interface{})
MaskConfigAPIKeys recursively masks all API keys in a map
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles configuration management
func (*Manager) GetClientConfig ¶
func (m *Manager) GetClientConfig() (*types.ClientConfig, error)
GetClientConfig retrieves the client configuration
func (*Manager) GetFileIgnore ¶
GetFileIgnore returns the file ignore patterns
func (*Manager) GetSupportedKeys ¶
GetSupportedKeys returns a list of supported configuration keys
func (*Manager) GetTranslationPrompt ¶
GetTranslationPrompt retrieves the translation prompt
func (*Manager) ListWithoutPrompt ¶
ListWithoutPrompt returns all configuration as a map without the prompt section
func (*Manager) Reset ¶
Reset resets the configuration to default values If promptOnly is true, only reset the prompt section
func (*Manager) SetProvider ¶
SetProvider sets the provider configuration