config

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MPL-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (ac *AppConfig) AddProvider(provider *typ.Provider) error

AddProvider adds a new provider using Provider struct

func (*AppConfig) AddProviderByName

func (ac *AppConfig) AddProviderByName(name, apiBase, token string) error

AddProviderByName adds a new AI provider configuration by name, API base, and token

func (*AppConfig) ConfigDir

func (ac *AppConfig) ConfigDir() string

func (*AppConfig) DeleteProvider

func (ac *AppConfig) DeleteProvider(name string) error

DeleteProvider removes a provider by name

func (*AppConfig) FetchAndSaveProviderModels

func (ac *AppConfig) FetchAndSaveProviderModels(providerName string) error

FetchAndSaveProviderModels fetches models from a provider and saves them

func (*AppConfig) GetDebug

func (ac *AppConfig) GetDebug() bool

GetDebug returns debug setting

func (*AppConfig) GetGUIDebug

func (ac *AppConfig) GetGUIDebug() bool

GetGUIDebug returns the GUI debug setting

func (*AppConfig) GetGUIPort

func (ac *AppConfig) GetGUIPort() int

GetGUIPort returns the GUI port setting (0 means use ServerPort)

func (*AppConfig) GetGUIVerbose

func (ac *AppConfig) GetGUIVerbose() bool

GetGUIVerbose returns the GUI verbose setting

func (*AppConfig) GetGlobalConfig

func (ac *AppConfig) GetGlobalConfig() *config.Config

GetGlobalConfig returns the global configuration manager

func (*AppConfig) GetJWTSecret

func (ac *AppConfig) GetJWTSecret() string

GetJWTSecret returns the JWT secret for token generation

func (*AppConfig) GetOpenBrowser

func (ac *AppConfig) GetOpenBrowser() bool

GetOpenBrowser returns the open browser setting

func (*AppConfig) GetProviderByName

func (ac *AppConfig) GetProviderByName(name string) (*typ.Provider, error)

GetProviderByName returns a provider by name

func (*AppConfig) GetProviderByUUID

func (ac *AppConfig) GetProviderByUUID(uuid string) (*typ.Provider, error)

GetProviderByUUID returns a provider by uuid

func (*AppConfig) GetServerPort

func (ac *AppConfig) GetServerPort() int

GetServerPort returns the configured server port

func (*AppConfig) GetVerbose

func (ac *AppConfig) GetVerbose() bool

GetVerbose returns verbose setting

func (*AppConfig) GetVersion

func (ac *AppConfig) GetVersion() string

func (*AppConfig) ListProviders

func (ac *AppConfig) ListProviders() []*typ.Provider

ListProviders returns all providers

func (*AppConfig) Save

func (ac *AppConfig) Save() error

Save saves the configuration to file

func (*AppConfig) SetDebug

func (ac *AppConfig) SetDebug(debug bool) error

SetDebug updates debug setting

func (*AppConfig) SetGUIDebug

func (ac *AppConfig) SetGUIDebug(debug bool) error

SetGUIDebug updates the GUI debug setting

func (*AppConfig) SetGUIPort

func (ac *AppConfig) SetGUIPort(port int) error

SetGUIPort updates the GUI port setting

func (*AppConfig) SetGUIVerbose

func (ac *AppConfig) SetGUIVerbose(verbose bool) error

SetGUIVerbose updates the GUI verbose setting

func (*AppConfig) SetOpenBrowser

func (ac *AppConfig) SetOpenBrowser(openBrowser bool) error

SetOpenBrowser updates the open browser setting

func (*AppConfig) SetServerPort

func (ac *AppConfig) SetServerPort(port int) error

SetServerPort updates the server port

func (*AppConfig) SetVerbose

func (ac *AppConfig) SetVerbose(verbose bool) error

SetVerbose updates verbose setting

func (*AppConfig) SetVersion

func (ac *AppConfig) SetVersion(version string)

func (*AppConfig) UpdateProvider

func (ac *AppConfig) UpdateProvider(uuid string, provider *typ.Provider) error

UpdateProvider updates an existing provider by UUID

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

Jump to

Keyboard shortcuts

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