config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir returns the OS-standard data directory for ATB. On Windows: %LOCALAPPDATA%\atb\data On macOS: ~/Library/Application Support/atb/data On Linux/other: $XDG_DATA_HOME/atb/data or ~/.local/share/atb/data

func DefaultPath

func DefaultPath() string

DefaultPath returns the default config file path. On Windows: %LOCALAPPDATA%\atb\config.toml On macOS: ~/Library/Application Support/atb/config.toml On Linux/other: $XDG_CONFIG_HOME/atb/config.toml or ~/.config/atb/config.toml

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath expands a leading ~ to the user's home directory.

func Save

func Save(cfg Config, path string) error

Save writes cfg to path as TOML, creating parent directories as needed.

Types

type Config

type Config struct {
	General  GeneralConfig  `toml:"general"`
	Fetch    FetchConfig    `toml:"fetch"`
	Download DownloadConfig `toml:"download"`
}

Config holds all configuration for atb.

func Default

func Default() Config

Default returns a Config populated with sensible defaults.

func Load

func Load(path string) (Config, error)

Load reads a TOML config from path. If the file does not exist, it returns the default config without error.

type DownloadConfig

type DownloadConfig struct {
	Parallel       int    `toml:"parallel"`
	OutputDir      string `toml:"output_dir"`
	CheckDiskSpace bool   `toml:"check_disk_space"`
	MinFreeSpaceGB int    `toml:"min_free_space_gb"`
}

DownloadConfig holds settings for genome downloads.

type FetchConfig

type FetchConfig struct {
	BaseURL  string `toml:"base_url"`
	Parallel int    `toml:"parallel"`
}

FetchConfig holds settings for metadata fetching.

type GeneralConfig

type GeneralConfig struct {
	DataDir       string `toml:"data_dir"`
	DefaultFormat string `toml:"default_format"`
}

GeneralConfig holds general application settings.

Jump to

Keyboard shortcuts

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