Documentation
¶
Overview ¶
Package config manages the sql-archiver configuration file.
The config file is stored at $HOME/.config/sql-archiver/config.yaml and holds a list of saved connection profiles under the "connections" key:
connections:
- name: "local"
host: "localhost:1433"
user: "sa"
password: "secret"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteConnection ¶
DeleteConnection removes the connection with the given name from the config file. If no connection with that name exists the call is a no-op.
func LoadConnections ¶
func LoadConnections() ([]domain.Connection, error)
LoadConnections reads all saved connections from the config file. If the config file does not exist or contains no connections, an empty slice is returned without an error.
func SaveConnection ¶
func SaveConnection(c domain.Connection) error
SaveConnection writes a connection to the config file. If a connection with the same Name already exists it is replaced; otherwise it is appended.
Types ¶
This section is empty.