Documentation
¶
Index ¶
- Variables
- func ReadOobeSummaryColumns() []string
- func SetDefaultConfig() error
- func SetDefaultLog() error
- func WriteMysqlConfig(mysqlConfig *MysqlConfig) error
- func WriteOobeSummaryColumns(cols []string) error
- func WriteOpenObserveConfig(cfg OpenObserveConfig) error
- func WritePostgresConfig(postgresConfig *PostgresConfig) error
- func WriteRedisConfig(redisConfig *RedisConfig) error
- func WriteSqliteConfig(sqliteConfig *SqliteConfig) error
- func WriteUIConfig(uiConfig *UIConfig) error
- type MysqlConfig
- type OpenObserveConfig
- type PostgresConfig
- type RedisConfig
- type SqlConfig
- type SqliteConfig
- type UIConfig
Constants ¶
This section is empty.
Variables ¶
var ConfigFile = dataPath + "/config.yaml"
ConfigFile is the canonical on-disk config location (YAML). Older versions stored JSON in config.json next to it; that file is migrated automatically on load (see migrateLegacyConfig) and left in place.
var LogFile = dataPath + "/sqltui.log"
Functions ¶
func ReadOobeSummaryColumns ¶
func ReadOobeSummaryColumns() []string
ReadOobeSummaryColumns returns the user-configured OpenObserve summary columns. Returns nil when not set (caller should use the default timestamp+body selection).
func SetDefaultConfig ¶
func SetDefaultConfig() error
SetDefaultConfig makes sure a config file exists: it migrates a legacy JSON config if present, creates a default YAML file otherwise, and tightens the permissions of a pre-existing file.
func SetDefaultLog ¶
func SetDefaultLog() error
func WriteMysqlConfig ¶
func WriteMysqlConfig(mysqlConfig *MysqlConfig) error
func WriteOobeSummaryColumns ¶
WriteOobeSummaryColumns saves the selected column names to the OpenObserve config section.
func WriteOpenObserveConfig ¶
func WriteOpenObserveConfig(cfg OpenObserveConfig) error
func WritePostgresConfig ¶
func WritePostgresConfig(postgresConfig *PostgresConfig) error
func WriteRedisConfig ¶
func WriteRedisConfig(redisConfig *RedisConfig) error
func WriteSqliteConfig ¶
func WriteSqliteConfig(sqliteConfig *SqliteConfig) error
func WriteUIConfig ¶
Types ¶
type MysqlConfig ¶
type MysqlConfig struct {
UserName string `json:"userName" yaml:"userName"`
Password string `json:"password" yaml:"password"`
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
DbName string `json:"dbName" yaml:"dbName"`
}
func ReadMySqlConfig ¶
func ReadMySqlConfig() (*MysqlConfig, error)
type OpenObserveConfig ¶
type OpenObserveConfig struct {
UserName string `yaml:"user_name,omitempty"`
Password string `yaml:"password,omitempty"`
Host string `yaml:"host,omitempty"`
Port string `yaml:"port,omitempty"`
Org string `yaml:"org,omitempty"`
SummaryColumns []string `yaml:"summary_columns,omitempty"`
}
func ReadOpenObserveConfig ¶
func ReadOpenObserveConfig() OpenObserveConfig
type PostgresConfig ¶
type PostgresConfig struct {
UserName string `json:"userName" yaml:"userName"`
Password string `json:"password" yaml:"password"`
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
DbName string `json:"dbName" yaml:"dbName"`
SslMode string `json:"sslMode" yaml:"sslMode"`
}
func ReadPostgresConfig ¶
func ReadPostgresConfig() (*PostgresConfig, error)
type RedisConfig ¶
type RedisConfig struct {
UserName string `json:"userName" yaml:"userName"`
Password string `json:"password" yaml:"password"`
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
RdbNum string `json:"rdbNum" yaml:"rdbNum"`
}
func ReadRedisConfig ¶
func ReadRedisConfig() (*RedisConfig, error)
type SqlConfig ¶
type SqlConfig struct {
Mysql *MysqlConfig `json:"mysql" yaml:"mysql"`
Redis *RedisConfig `json:"redis" yaml:"redis"`
Sqlite *SqliteConfig `json:"sqlite" yaml:"sqlite"`
Postgres *PostgresConfig `json:"postgres" yaml:"postgres"`
OpenObserve *OpenObserveConfig `json:"openobserve" yaml:"openobserve"`
UI *UIConfig `json:"ui" yaml:"ui"`
}
type SqliteConfig ¶
type SqliteConfig struct {
FilePath string `json:"filePath" yaml:"filePath"`
}
func ReadSqliteConfig ¶
func ReadSqliteConfig() (*SqliteConfig, error)
type UIConfig ¶
type UIConfig struct {
Theme string `json:"theme" yaml:"theme"`
ShowBorders bool `json:"showBorders" yaml:"showBorders"`
ShowRowNumbers bool `json:"showRowNumbers" yaml:"showRowNumbers"`
}
UIConfig holds viewer preferences persisted between runs.
func DefaultUIConfig ¶
func DefaultUIConfig() *UIConfig
DefaultUIConfig returns the UI preferences used when none are saved.