config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config resolves XDG-compliant paths for the yomiro CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() (string, error)

CacheDir returns ${XDG_CACHE_HOME:-$HOME/.cache}/yomiro, ensuring it exists.

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns ${XDG_CONFIG_HOME:-$HOME/.config}/yomiro, ensuring it exists.

func CredentialsFile

func CredentialsFile() (string, error)

CredentialsFile returns the fallback credentials path used when keyring is unavailable.

func GwConfigFile

func GwConfigFile() (string, error)

GwConfigFile returns the gateway daemon config path.

func SaveGwConfig

func SaveGwConfig(path string, c *GwConfig) error

func StateDir

func StateDir() (string, error)

StateDir returns ${XDG_STATE_HOME:-$HOME/.local/state}/yomiro, ensuring it exists.

Types

type ConnectorsConfig

type ConnectorsConfig struct {
	Enabled []string `yaml:"enabled"`
}

type DaemonConfig

type DaemonConfig struct {
	AutoStart            bool `yaml:"auto_start"`
	ReconnectMaxBackoffS int  `yaml:"reconnect_max_backoff_s"`
	HeartbeatIntervalS   int  `yaml:"heartbeat_interval_s"`
}

type DatabaseConfig

type DatabaseConfig struct {
	URL                 string   `yaml:"url"`
	ReadOnly            bool     `yaml:"read_only"`
	MaxConnections      int      `yaml:"max_connections"`
	QueryTimeoutSeconds int      `yaml:"query_timeout_seconds"`
	AllowedSchemas      []string `yaml:"allowed_schemas"`
	AllowedTables       []string `yaml:"allowed_tables"`
	BlockedColumns      []string `yaml:"blocked_columns"`
	MaxRowsPerQuery     int      `yaml:"max_rows_per_query"`
}

type GatewayIdentity

type GatewayIdentity struct {
	ID      string `yaml:"id"`
	Version string `yaml:"version"`
}

type GwConfig

type GwConfig struct {
	Platform   PlatformConfig   `yaml:"platform"`
	Gateway    GatewayIdentity  `yaml:"gateway"`
	Database   DatabaseConfig   `yaml:"database,omitempty"`
	Connectors ConnectorsConfig `yaml:"connectors"`
	Daemon     DaemonConfig     `yaml:"daemon"`
	Logging    LoggingConfig    `yaml:"logging"`
}

func LoadGwConfig

func LoadGwConfig(path string) (*GwConfig, error)

type LoggingConfig

type LoggingConfig struct {
	Level     string `yaml:"level"`
	AuditPath string `yaml:"audit_path"`
}

type PlatformConfig

type PlatformConfig struct {
	Endpoint string `yaml:"endpoint"`
	TokenRef string `yaml:"token_ref"`
}

Jump to

Keyboard shortcuts

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