config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath expands the tilde (~) in a path to the user's home directory.

func WriteConfig

func WriteConfig(cfg *Config) error

WriteConfig writes the configuration atomically to the default path.

Types

type Config

type Config struct {
	ServerURL string `json:"server_url"`
	Token     string `json:"token"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Timeout   int    `json:"timeout"`
}

Config represents the application configuration.

func ReadConfig

func ReadConfig() (*Config, error)

ReadConfig reads the configuration from the default path, overriding with environment variables.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid.

Jump to

Keyboard shortcuts

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