Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateSecurePassword(length int) string
- func GetSystemResourceLimits() (int, int, error)
- func ParseRAMString(ramStr string) (int, error)
- func PostgresURI(password string, port int, database string) string
- func ValidateBasicResourceBounds(cpuCores, ramMB int) error
- func ValidateInstanceName(name string) error
- func ValidateSystemResources(cpuCores, ramMB int) error
- type Counter
Constants ¶
View Source
const ( // OddkNetworkName is the name of the custom Docker bridge network. OddkNetworkName = "oddk-bridge" // GatewayIP is the bridge gateway address that PostgreSQL instances // publish their ports on. It is host-local: not reachable from outside // the host without a tunnel. GatewayIP = "10.88.0.1" // OddkSubnet is the bridge network's subnet; GatewayIP lives inside it. OddkSubnet = "10.88.0.0/16" )
ODDK's Docker bridge network. These are the single source of truth for the network name and gateway address; every instance's PostgreSQL binds to the gateway, helper containers attach to the network, and the CLI prints connection strings pointing at the gateway.
Variables ¶
View Source
var BackupCounter = NewCounter()
BackupCounter is a global counter for backup naming
Functions ¶
func GenerateSecurePassword ¶
func GetSystemResourceLimits ¶
func ParseRAMString ¶
func PostgresURI ¶ added in v0.1.78
PostgresURI builds a libpq/pgx URL with the password percent-encoded. Auto-generated secrets are base64url and happen to be URL-safe; passwords set via NEW_PGPASSWORD are not, and a raw %s interpolation breaks on @ : / and %.
func ValidateInstanceName ¶
ValidateInstanceName checks that a new instance name is safe to embed in Docker names, URLs and file paths. Existing instances are not re-validated.
func ValidateSystemResources ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.