config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Usage                 = "usage"
	ConfigMissing         = "config_missing"
	ConfigInvalid         = "config_invalid"
	ConnectFailed         = "connect_failed"
	BaseNotFound          = "base_not_found"
	BaseNotMarked         = "base_not_marked"
	BaseOpen              = "base_open"
	DatabaseInUse         = "database_in_use"
	DatabaseExists        = "database_exists"
	ServerResources       = "server_resources"
	Canceled              = "canceled"
	RefillFailed          = "refill_failed"
	UnmanagedDatabase     = "unmanaged_database"
	UnmanagedFile         = "unmanaged_file"
	BranchNotFound        = "branch_not_found"
	NotGitRepo            = "not_git_repo"
	DetachedHead          = "detached_head"
	InsufficientPrivilege = "insufficient_privilege"
	Internal              = "internal"
)

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) string

func ParseAdminURL

func ParseAdminURL(raw string) (*url.URL, error)

func RedactConnectionDetails

func RedactConnectionDetails(message string) string

Types

type Config

type Config struct {
	AdminURL *url.URL
	Base     string
	PoolSize int
	Strategy string
}

func Load

func Load(cwd string, flags Overrides, lookupEnv func(string) (string, bool)) (Config, error)

func (Config) DatabaseURL

func (c Config) DatabaseURL(database string) string

func (Config) MaintenanceDB

func (c Config) MaintenanceDB() string

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Hint    string `json:"hint,omitempty"`
	Cause   error  `json:"-"`
}

func NewError

func NewError(code, message, hint string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorResponse

type ErrorResponse struct {
	Error *Error `json:"error"`
}

func NewErrorResponse

func NewErrorResponse(err error) ErrorResponse

type Overrides

type Overrides struct {
	AdminURL *string
	Base     *string
	PoolSize *string
	Strategy *string
}

Jump to

Keyboard shortcuts

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