Documentation
¶
Index ¶
- type AppConfig
- func (ac *AppConfig) AddProvider(provider *typ.Provider) error
- func (ac *AppConfig) AddProviderByName(name, apiBase, token string) error
- func (ac *AppConfig) ConfigDir() string
- func (ac *AppConfig) DeleteProvider(name string) error
- func (ac *AppConfig) FetchAndSaveProviderModels(providerName string) error
- func (ac *AppConfig) GetDebug() bool
- func (ac *AppConfig) GetGUIDebug() bool
- func (ac *AppConfig) GetGUIPort() int
- func (ac *AppConfig) GetGUIVerbose() bool
- func (ac *AppConfig) GetGlobalConfig() *config.Config
- func (ac *AppConfig) GetJWTSecret() string
- func (ac *AppConfig) GetOpenBrowser() bool
- func (ac *AppConfig) GetProviderByName(name string) (*typ.Provider, error)
- func (ac *AppConfig) GetProviderByUUID(uuid string) (*typ.Provider, error)
- func (ac *AppConfig) GetServerPort() int
- func (ac *AppConfig) GetVerbose() bool
- func (ac *AppConfig) GetVersion() string
- func (ac *AppConfig) ListProviders() []*typ.Provider
- func (ac *AppConfig) Save() error
- func (ac *AppConfig) SetDebug(debug bool) error
- func (ac *AppConfig) SetGUIDebug(debug bool) error
- func (ac *AppConfig) SetGUIPort(port int) error
- func (ac *AppConfig) SetGUIVerbose(verbose bool) error
- func (ac *AppConfig) SetOpenBrowser(openBrowser bool) error
- func (ac *AppConfig) SetServerPort(port int) error
- func (ac *AppConfig) SetVerbose(verbose bool) error
- func (ac *AppConfig) SetVersion(version string)
- func (ac *AppConfig) UpdateProvider(uuid string, provider *typ.Provider) error
- type AppConfigOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
// contains filtered or unexported fields
}
AppConfig holds the application configuration
func NewAppConfig ¶
func NewAppConfig(opts ...AppConfigOption) (*AppConfig, error)
NewAppConfig creates a new application configuration with default options
func (*AppConfig) AddProvider ¶
AddProvider adds a new provider using Provider struct
func (*AppConfig) AddProviderByName ¶
AddProviderByName adds a new AI provider configuration by name, API base, and token
func (*AppConfig) DeleteProvider ¶
DeleteProvider removes a provider by name
func (*AppConfig) FetchAndSaveProviderModels ¶
FetchAndSaveProviderModels fetches models from a provider and saves them
func (*AppConfig) GetGUIDebug ¶
GetGUIDebug returns the GUI debug setting
func (*AppConfig) GetGUIPort ¶
GetGUIPort returns the GUI port setting (0 means use ServerPort)
func (*AppConfig) GetGUIVerbose ¶
GetGUIVerbose returns the GUI verbose setting
func (*AppConfig) GetGlobalConfig ¶
GetGlobalConfig returns the global configuration manager
func (*AppConfig) GetJWTSecret ¶
GetJWTSecret returns the JWT secret for token generation
func (*AppConfig) GetOpenBrowser ¶
GetOpenBrowser returns the open browser setting
func (*AppConfig) GetProviderByName ¶
GetProviderByName returns a provider by name
func (*AppConfig) GetProviderByUUID ¶
GetProviderByUUID returns a provider by uuid
func (*AppConfig) GetServerPort ¶
GetServerPort returns the configured server port
func (*AppConfig) GetVerbose ¶
GetVerbose returns verbose setting
func (*AppConfig) GetVersion ¶
func (*AppConfig) ListProviders ¶
ListProviders returns all providers
func (*AppConfig) SetGUIDebug ¶
SetGUIDebug updates the GUI debug setting
func (*AppConfig) SetGUIPort ¶
SetGUIPort updates the GUI port setting
func (*AppConfig) SetGUIVerbose ¶
SetGUIVerbose updates the GUI verbose setting
func (*AppConfig) SetOpenBrowser ¶
SetOpenBrowser updates the open browser setting
func (*AppConfig) SetServerPort ¶
SetServerPort updates the server port
func (*AppConfig) SetVerbose ¶
SetVerbose updates verbose setting
func (*AppConfig) SetVersion ¶
type AppConfigOption ¶
type AppConfigOption func(*appConfigOptions)
AppConfigOption defines a functional option for AppConfig
func WithConfigDir ¶
func WithConfigDir(dir string) AppConfigOption
WithConfigDir sets a custom config directory for AppConfig