profiles

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProfileNotFound = errors.New("profile not found")

Functions

func DeleteProfile

func DeleteProfile(baseDir, name string) error

DeleteProfile function deletes a profiles from the official config file, if it exists. Then, removes the password from the OS keyring system. Finally, saves updated profiles set in the dblab's config file, without the given profile.

func ReadProfiles

func ReadProfiles(baseDir string) (map[string]command.Options, error)

ReadProfiles function reads the config file and returns all the profiles in the file.

func SaveProfile

func SaveProfile(baseDir, name string, profile command.Options) error

SaveProfile function creates the offical config path to the configuration file, if it does not exist. Then, saves the password in the OS keyring system. Finally, saves the profile in the dblab's config file.

Types

type Config

type Config struct {
	Profiles map[string]command.Options `json:"profiles"`
}

Config struct represents the profile configuration content. The configuration file is machine-driven, which means, is not meant to be manipulated by the user.

Jump to

Keyboard shortcuts

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