Documentation
¶
Overview ¶
Package configs contains the configuration for the application
Index ¶
Constants ¶
View Source
const ( DriverPostgres Driver = "pgx" DriverMySQL Driver = "mysql" DriverSQLite Driver = "sqlite" EnvDevelopment string = "development" EnvProduction string = "production" MinItemsPerPage int = 5 MaxItemsPerPage int = 10 )
View Source
const ( AnsiBackCursorToLineStart = "\x1b[1G" AnsiClearScreen = "\033[2J\033[H" AnsiHideCursor = "\x1b[?25l" AnsiShowCursor = "\x1b[?25h" AnsiAlternateScreen = "\x1b[?1049h" AnsiExitAlternateScreen = "\x1b[?1049l" )
Variables ¶
View Source
var Drivers = map[Driver]Driver{ "pgx": DriverPostgres, "mysql": DriverMySQL, "sqlite": DriverSQLite, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ConnectionConfig
AppConfig
}
func DefaultConfig ¶ added in v0.1.8
func DefaultConfig() Config
type ConfigFileFields ¶ added in v0.1.8
type ConfigFileFields struct {
Connections []ConnectionConfig `json:"connections"`
AppConfig
}
type ConfigService ¶ added in v0.1.8
type ConfigService interface {
LoadConfig(path ...string) (Config, error)
GetConfigPath() (string, error)
}
func NewConfigService ¶ added in v0.1.8
func NewConfigService(prompter Prompter) ConfigService
type ConfigServiceImpl ¶ added in v0.1.8
type ConfigServiceImpl struct {
// contains filtered or unexported fields
}
func (*ConfigServiceImpl) GetConfigPath ¶ added in v0.1.8
func (c *ConfigServiceImpl) GetConfigPath() (string, error)
func (*ConfigServiceImpl) LoadConfig ¶ added in v0.1.8
func (c *ConfigServiceImpl) LoadConfig(configPath ...string) (Config, error)
type ConnectionConfig ¶ added in v0.1.8
type Prompter ¶ added in v0.1.8
type Prompter interface {
AskConnection(connections []ConnectionConfig) (*ConnectionConfig, error)
}
type PrompterImpl ¶ added in v0.1.8
type PrompterImpl struct{}
func (*PrompterImpl) AskConnection ¶ added in v0.1.8
func (p *PrompterImpl) AskConnection(configs []ConnectionConfig) (*ConnectionConfig, error)
Click to show internal directories.
Click to hide internal directories.