Documentation
¶
Overview ¶
Package config is the OpenObserve config-file model shared by the CLI and the desktop GUI: the on-disk YAML schema (named contexts + current context + shared defaults), file IO, and context helpers. Secrets are never stored here; they live in the OS keychain. The CLI's layered loader (flags/env/file) builds on this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
ConfigFilePath returns the YAML config file path inside dir.
func DefaultConfigDir ¶
DefaultConfigDir returns the per-user config directory (~/.angelmsger/openobserve).
func ResolveConfigDir ¶
ResolveConfigDir picks the config directory to use when --config was not supplied.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Scheme string `yaml:"scheme"`
Username string `yaml:"username,omitempty"`
}
AuthConfig is the per-context auth settings persisted to the file.
type Defaults ¶
type Defaults struct {
Format string `yaml:"format"`
Timeout time.Duration `yaml:"timeout"`
MaxRetries int `yaml:"max_retries"`
ReadOnly bool `yaml:"read_only,omitempty"`
}
Defaults are runtime defaults shared across contexts.
type File ¶
type File struct {
CurrentContext string
Contexts []NamedContext
Defaults Defaults
}
File is the parsed config file: named contexts plus shared defaults and the name of the current context.
func ReadFile ¶
ReadFile reads and parses the config file in dir. The bool return is false when the file does not exist.
func (File) Context ¶
func (f File) Context(name string) (NamedContext, bool)
Context returns the context whose name matches, case-insensitively.
func (File) ContextNames ¶
ContextNames returns every context name, in file order.
func (*File) Remove ¶
Remove deletes the context with the given (case-insensitive) name, preserving order. It reports whether a context was removed.
func (*File) Upsert ¶
func (f *File) Upsert(nc NamedContext)
Upsert inserts or replaces a context by case-insensitive name, preserving file order for existing entries.
type NamedContext ¶
type NamedContext struct {
Name string
BaseURL string
Org string
Auth AuthConfig
}
NamedContext is one named OpenObserve server profile inside the config file.