appconfig

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 17 Imported by: ? 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

View Source
const SchemaVersion = 1

Variables

This section is empty.

Functions

func ApplyAddr

func ApplyAddr(cfg *Config, addr string)

func ApplyEnv

func ApplyEnv(cfg *Config)

func DefaultPath

func DefaultPath() string

func ResolvePaths

func ResolvePaths(paths []string) []string

func ResolveTempDir

func ResolveTempDir(value string) string

func TempMemoryLimitBytes

func TempMemoryLimitBytes(limitMB int64) int64

Types

type Config

type Config struct {
	SchemaVersion int                    `json:"schema_version" yaml:"schema_version" toml:"schema_version"`
	Server        ServerConfig           `json:"server" yaml:"server" toml:"server"`
	Database      DatabaseConfig         `json:"database" yaml:"database" toml:"database"`
	Runtime       RuntimeConfig          `json:"runtime" yaml:"runtime" toml:"runtime"`
	Convert       ConvertConfig          `json:"convert" yaml:"convert" toml:"convert"`
	Transform     recordmap.Config       `json:"transform" yaml:"transform" toml:"transform"`
	Canonical     canonical.Config       `json:"canonical" yaml:"canonical" toml:"canonical"`
	Export        ExportConfig           `json:"export" yaml:"export" toml:"export"`
	SendUpdates   updateout.Config       `json:"send_updates" yaml:"send_updates" toml:"send_updates"`
	Edge          EdgeConfig             `json:"edge" yaml:"edge" toml:"edge"`
	Notifications NotificationsConfig    `json:"notifications" yaml:"notifications" toml:"notifications"`
	UI            UIConfig               `json:"ui" yaml:"ui" toml:"ui"`
	ColumnLabels  map[string]string      `json:"column_labels" yaml:"column_labels" toml:"column_labels"`
	Extra         map[string]interface{} `json:"extra,omitempty" yaml:"extra,omitempty" toml:"extra,omitempty"`
}

func Default

func Default() Config

func (Config) Addr

func (c Config) Addr() string

type ConvertConfig

type ConvertConfig struct {
	Output   string `json:"output" yaml:"output" toml:"output"`
	Format   string `json:"format" yaml:"format" toml:"format"`
	Watch    bool   `json:"watch" yaml:"watch" toml:"watch"`
	Debounce string `json:"debounce" yaml:"debounce" toml:"debounce"`
	Raw      bool   `json:"raw" yaml:"raw" toml:"raw"`
	Table    string `json:"table,omitempty" yaml:"table,omitempty" toml:"table,omitempty"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Path          string `json:"path" yaml:"path" toml:"path"`
	Charmap       string `json:"charmap" yaml:"charmap" toml:"charmap"`
	DirectAccess  bool   `json:"direct_access" yaml:"direct_access" toml:"direct_access"`
	RTLConversion bool   `json:"rtl_conversion" yaml:"rtl_conversion" toml:"rtl_conversion"`
	Raw           bool   `json:"raw" yaml:"raw" toml:"raw"`
}

type EdgeConfig

type EdgeConfig struct {
	Enabled     bool   `json:"enabled" yaml:"enabled" toml:"enabled"`
	TargetURL   string `json:"target_url" yaml:"target_url" toml:"target_url"`
	Token       string `json:"token,omitempty" yaml:"token,omitempty" toml:"token,omitempty"`
	SourceID    string `json:"source_id" yaml:"source_id" toml:"source_id"`
	Debounce    string `json:"debounce" yaml:"debounce" toml:"debounce"`
	MaxUploadMB int64  `json:"max_upload_mb" yaml:"max_upload_mb" toml:"max_upload_mb"`
	UploadDir   string `json:"upload_dir" yaml:"upload_dir" toml:"upload_dir"`
}

type ExportConfig

type ExportConfig struct {
	SQLitePath     string `json:"sqlite_path,omitempty" yaml:"sqlite_path,omitempty" toml:"sqlite_path,omitempty"`
	SQLiteTable    string `json:"sqlite_table,omitempty" yaml:"sqlite_table,omitempty" toml:"sqlite_table,omitempty"`
	MySQLDSN       string `json:"mysql_dsn,omitempty" yaml:"mysql_dsn,omitempty" toml:"mysql_dsn,omitempty"`
	MySQLTable     string `json:"mysql_table,omitempty" yaml:"mysql_table,omitempty" toml:"mysql_table,omitempty"`
	BatchSize      int    `json:"batch_size,omitempty" yaml:"batch_size,omitempty" toml:"batch_size,omitempty"`
	Reconciliation string `json:"reconciliation,omitempty" yaml:"reconciliation,omitempty" toml:"reconciliation,omitempty"`
	DryRun         bool   `json:"dry_run,omitempty" yaml:"dry_run,omitempty" toml:"dry_run,omitempty"`
}

type IPCConfig

type IPCConfig struct {
	Enabled bool   `json:"enabled" yaml:"enabled" toml:"enabled"`
	Path    string `json:"path" yaml:"path" toml:"path"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Manager, error)

func LoadFiles

func LoadFiles(paths []string) (*Manager, error)

func (*Manager) Get

func (m *Manager) Get() Config

func (*Manager) Path

func (m *Manager) Path() string

func (*Manager) Paths

func (m *Manager) Paths() []string

func (*Manager) Reload

func (m *Manager) Reload() error

func (*Manager) Replace

func (m *Manager) Replace(cfg Config) error

func (*Manager) Save

func (m *Manager) Save() error

func (*Manager) Update

func (m *Manager) Update(fn func(*Config)) error

func (*Manager) Watch

func (m *Manager) Watch(onChange func(Config)) (*fsnotify.Watcher, error)

type NotificationsConfig

type NotificationsConfig struct {
	Enabled            bool `json:"enabled" yaml:"enabled" toml:"enabled"`
	Native             bool `json:"native" yaml:"native" toml:"native"`
	InApp              bool `json:"in_app" yaml:"in_app" toml:"in_app"`
	ClientConnected    bool `json:"client_connected" yaml:"client_connected" toml:"client_connected"`
	ClientDisconnected bool `json:"client_disconnected" yaml:"client_disconnected" toml:"client_disconnected"`
	FileUpdated        bool `json:"file_updated" yaml:"file_updated" toml:"file_updated"`
	RowUpdated         bool `json:"row_updated" yaml:"row_updated" toml:"row_updated"`
	IncludeRowValues   bool `json:"include_row_values" yaml:"include_row_values" toml:"include_row_values"`
	MaxRows            int  `json:"max_rows" yaml:"max_rows" toml:"max_rows"`
}

type RowIconAppearance

type RowIconAppearance struct {
	Icon  string `json:"icon" yaml:"icon" toml:"icon"`
	Color string `json:"color" yaml:"color" toml:"color"`
	Label string `json:"label" yaml:"label" toml:"label"`
}

type RowIconRule

type RowIconRule struct {
	ID       string `json:"id" yaml:"id" toml:"id"`
	Field    string `json:"field" yaml:"field" toml:"field"`
	Operator string `json:"operator" yaml:"operator" toml:"operator"`
	Value    string `json:"value" yaml:"value" toml:"value"`
	Icon     string `json:"icon" yaml:"icon" toml:"icon"`
	Color    string `json:"color" yaml:"color" toml:"color"`
	Label    string `json:"label" yaml:"label" toml:"label"`
	Disabled bool   `json:"disabled,omitempty" yaml:"disabled,omitempty" toml:"disabled,omitempty"`
}

RowIconRule is evaluated in slice order against transformed canonical keys. Disabled is deliberately negative so omitted config remains enabled.

type RuntimeConfig

type RuntimeConfig struct {
	TempDir           string `json:"temp_dir" yaml:"temp_dir" toml:"temp_dir"`
	TempStrategy      string `json:"temp_strategy" yaml:"temp_strategy" toml:"temp_strategy"`
	TempMemoryLimitMB int64  `json:"temp_memory_limit_mb" yaml:"temp_memory_limit_mb" toml:"temp_memory_limit_mb"`
	Debug             bool   `json:"debug" yaml:"debug" toml:"debug"`
}

type ServerConfig

type ServerConfig struct {
	Host     string    `json:"host" yaml:"host" toml:"host"`
	Port     int       `json:"port" yaml:"port" toml:"port"`
	Watch    bool      `json:"watch" yaml:"watch" toml:"watch"`
	Debounce string    `json:"debounce" yaml:"debounce" toml:"debounce"`
	HTTP     bool      `json:"http" yaml:"http" toml:"http"`
	IPC      IPCConfig `json:"ipc" yaml:"ipc" toml:"ipc"`
}

type UIConfig

type UIConfig struct {
	Theme                   string            `json:"theme" yaml:"theme" toml:"theme"`
	Language                string            `json:"language" yaml:"language" toml:"language"`
	AutoScrollToChanged     bool              `json:"auto_scroll_to_changed" yaml:"auto_scroll_to_changed" toml:"auto_scroll_to_changed"`
	HighlightChanges        bool              `json:"highlight_changes" yaml:"highlight_changes" toml:"highlight_changes"`
	RTLTextDirection        bool              `json:"rtl_text_direction" yaml:"rtl_text_direction" toml:"rtl_text_direction"`
	EnablePagination        bool              `json:"enable_pagination" yaml:"enable_pagination" toml:"enable_pagination"`
	PageSize                int               `json:"page_size" yaml:"page_size" toml:"page_size"`
	PlayNotificationSound   bool              `json:"play_notification_sound" yaml:"play_notification_sound" toml:"play_notification_sound"`
	NotificationSoundSource string            `json:"notification_sound_source" yaml:"notification_sound_source" toml:"notification_sound_source"`
	ShowFooter              bool              `json:"show_footer" yaml:"show_footer" toml:"show_footer"`
	LastUpdateDisplayMode   string            `json:"last_update_display_mode" yaml:"last_update_display_mode" toml:"last_update_display_mode"`
	EnableRowColoring       bool              `json:"enable_row_coloring" yaml:"enable_row_coloring" toml:"enable_row_coloring"`
	RowColorGroup           string            `json:"row_color_group" yaml:"row_color_group" toml:"row_color_group"`
	RowColorSubgroup        string            `json:"row_color_subgroup" yaml:"row_color_subgroup" toml:"row_color_subgroup"`
	RowColorNoStock         string            `json:"row_color_no_stock" yaml:"row_color_no_stock" toml:"row_color_no_stock"`
	RowColorHasStock        string            `json:"row_color_has_stock" yaml:"row_color_has_stock" toml:"row_color_has_stock"`
	EnableRowIcons          bool              `json:"enable_row_icons" yaml:"enable_row_icons" toml:"enable_row_icons"`
	ColumnWidths            map[string]int    `json:"column_widths" yaml:"column_widths" toml:"column_widths"`
	RowIconRules            []RowIconRule     `json:"row_icon_rules" yaml:"row_icon_rules" toml:"row_icon_rules"`
	RowIconFallback         RowIconAppearance `json:"row_icon_fallback" yaml:"row_icon_fallback" toml:"row_icon_fallback"`
}

Jump to

Keyboard shortcuts

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