config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Databases map[string]*DBConfig `yaml:"databases"`
}

type DBConfig

type DBConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DBName   string `yaml:"dbname"`
}

type Manager

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

func NewManager

func NewManager(configPath string) *Manager

func (*Manager) AddDatabase

func (m *Manager) AddDatabase(name string, config *DBConfig) error

func (*Manager) GetDatabase

func (m *Manager) GetDatabase(name string) (*DBConfig, bool)

func (*Manager) GetDatabases

func (m *Manager) GetDatabases() map[string]*DBConfig

func (*Manager) ListDatabases

func (m *Manager) ListDatabases() []*DBConfig

func (*Manager) Load

func (m *Manager) Load() error

func (*Manager) RemoveDatabase

func (m *Manager) RemoveDatabase(name string) error

func (*Manager) Save

func (m *Manager) Save() error

func (*Manager) UpdateDatabase

func (m *Manager) UpdateDatabase(name string, config *DBConfig) error

type Prompt

type Prompt struct{}

func NewPrompt

func NewPrompt() *Prompt

func (*Prompt) PromptDatabase

func (p *Prompt) PromptDatabase(defaultConfig *DBConfig) (string, *DBConfig, error)

Jump to

Keyboard shortcuts

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