Documentation
¶
Index ¶
- Constants
- Variables
- func ArrayContainsString(slice []string, element string) bool
- func GetPHPWebserverTypes() []string
- func GetTerminalWidthHeight() (int, int)
- func GetValidDatabaseVersions() []string
- func GetValidMariaDBVersions() []string
- func GetValidMySQLVersions() []string
- func GetValidOmitContainers() []string
- func GetValidPHPVersions() []string
- func GetValidPostgresVersions() []string
- func GetValidWebserverTypes() []string
- func GetWSL2NetworkingMode() (string, error)
- func GetWSLConfigPath() string
- func GetWSLDistro() string
- func GrepStringInBuffer(buffer string, needle string) []string
- func IsAppleSilicon() bool
- func IsCodespaces() bool
- func IsDevcontainer() bool
- func IsIPAddress(ip string) bool
- func IsInteger(s string) bool
- func IsLetter(s string) bool
- func IsLinux() bool
- func IsMacOS() bool
- func IsPathOnWindowsFilesystem(path string) bool
- func IsValidDatabaseVersion(dbType string, dbVersion string) bool
- func IsValidMariaDBVersion(v string) bool
- func IsValidMySQLVersion(v string) bool
- func IsValidOmitContainers(containerList []string) bool
- func IsValidPHPVersion(phpVersion string) bool
- func IsValidPostgresVersion(v string) bool
- func IsValidWebserverType(webserverType string) bool
- func IsWSL2() bool
- func IsWSL2HostAddressLoopbackEnabled() bool
- func IsWSL2MirroredMode() bool
- func IsWindows() bool
- func ParseURL(rawURL string) (scheme string, urlWithoutPort string, port string)
- func ParseWSLConfigHostAddressLoopback(content string) bool
- func PathWithSlashesToArray(path string) []string
- func PosString(slice []string, element string) int
- func RandomString(length int) string
- func RemoveItemFromSlice(slice []string, item string) []string
Constants ¶
const ( MariaDB55 = "5.5" MariaDB100 = "10.0" MariaDB101 = "10.1" MariaDB102 = "10.2" MariaDB103 = "10.3" MariaDB104 = "10.4" MariaDB105 = "10.5" MariaDB106 = "10.6" MariaDB107 = "10.7" MariaDB108 = "10.8" MariaDB1011 = "10.11" MariaDB114 = "11.4" MariaDB118 = "11.8" )
MariaDB Versions
const ( MySQL55 = "5.5" MySQL56 = "5.6" MySQL57 = "5.7" MySQL80 = "8.0" MySQL84 = "8.4" )
Oracle MySQL versions
const ( PHP56 = "5.6" PHP70 = "7.0" PHP71 = "7.1" PHP72 = "7.2" PHP73 = "7.3" PHP74 = "7.4" PHP80 = "8.0" PHP81 = "8.1" PHP82 = "8.2" PHP83 = "8.3" PHP84 = "8.4" PHP85 = "8.5" )
PHP Versions
const ( Postgres18 = "18" Postgres17 = "17" Postgres16 = "16" Postgres15 = "15" Postgres14 = "14" Postgres13 = "13" Postgres12 = "12" Postgres11 = "11" Postgres10 = "10" Postgres9 = "9" )
PostgreSQL Versions
const ( MariaDB = "mariadb" MySQL = "mysql" Postgres = "postgres" )
Database Types
const ( DdevSSHAgentContainer = "ddev-ssh-agent" DBContainer = "db" WebContainer = "web" RouterContainer = "ddev-router" )
Container types used with ddev
const ( WebserverNginxFPM = "nginx-fpm" WebserverApacheFPM = "apache-fpm" WebserverGeneric = "generic" )
Webserver types
const ( AppTypeNone = "" AppTypeBackdrop = "backdrop" AppTypeCakePHP = "cakephp" AppTypeCodeIgniter = "codeigniter" AppTypeCraftCms = "craftcms" AppTypeDrupal6 = "drupal6" AppTypeDrupal7 = "drupal7" AppTypeDrupal8 = "drupal8" AppTypeDrupal9 = "drupal9" AppTypeDrupal10 = "drupal10" AppTypeDrupal11 = "drupal11" AppTypeDrupal12 = "drupal12" // AppTypeDrupal is an alias for "most recent Drupal version" AppTypeDrupal = "drupal" AppTypeGeneric = "generic" AppTypeLaravel = "laravel" AppTypeSilverstripe = "silverstripe" AppTypeSymfony = "symfony" AppTypeMagento = "magento" AppTypeMagento2 = "magento2" AppTypePHP = "php" AppTypeShopware6 = "shopware6" AppTypeTYPO3 = "typo3" AppTypeWordPress = "wordpress" )
App types
const ( // DdevDefaultRouterHTTPPort is the default router HTTP port DdevDefaultRouterHTTPPort = "80" // DdevDefaultRouterHTTPSPort is the default router HTTPS port DdevDefaultRouterHTTPSPort = "443" // DdevDefaultMailpitHTTPPort is the default router port for Mailpit DdevDefaultMailpitHTTPPort = "8025" DdevDefaultMailpitHTTPSPort = "8026" DdevDefaultXHGuiHTTPPort = "8143" DdevDefaultXHGuiHTTPSPort = "8142" // DdevDefaultTLD is the top-level-domain used by default, can be overridden DdevDefaultTLD = "ddev.site" DefaultDefaultContainerTimeout = "120" InternetDetectionTimeoutDefault = 3000 TraefikMonitorPortDefault = "10999" MinimumDockerSpaceWarning = 5000000 // 5GB in KB (to compare against df reporting in KB) )
Ports and other defaults
const AppTypeDrupalLatestStable = AppTypeDrupal11
const DdevFileSignature = "#ddev-generated"
DdevFileSignature is the text we use to detect whether a settings file is managed by us. If this string is found, we assume we can replace/update the file.
const DdevSilentNoWarn = "#ddev-silent-no-warn"
DdevSilentNoWarn suppresses warnings about custom configuration
const MariaDBDefaultVersion = MariaDB118
MariaDBDefaultVersion is the default MariaDB version
const NodeJSDefault = "24"
const PHPDefault = PHP84
PHPDefault is the default PHP version, overridden by $DDEV_PHP_VERSION
const PostgresConfigDir = "/etc/postgresql"
PostgresConfigDir is in-container location of PostgreSQL config
const PostgresDefaultVersion = Postgres14
PostgresDefaultVersion is the default PostgreSQL version
const (
// ProviderDefault contains the name of the default provider which will be used if one is not otherwise specified.
ProviderDefault = "default"
)
Providers TODO: This should be removed as many providers will now be valid
Variables ¶
var ComposerDefault = "2"
ComposerDefault will get latest Composer v2
var FailOnHookFailDefault = false
FailOnHookFailDefault is the default value for app.FailOnHookFail
var GoroutineLimit = 10
GoroutineLimit is the number of goroutines allowed at exit in parts of some tests Can be overridden by setting DDEV_TEST_GOROUTINE_LIMIT=<somenumber>
var InstrumentationTags = map[string]string{}
InstrumentationTags contains the tags to be sent to telemetry
var NoBindMountsDefault = false
NoBindMountsDefault is default value for globalconfig.DDEVGlobalConfig.NoBindMounts
var PerformanceModeDefault = types.PerformanceModeEmpty
PerformanceModeDefault is default value for app.PerformanceMode
var PreinstalledPHPVersions = map[string]bool{ PHP82: true, PHP83: true, PHP84: true, PHP85: true, }
PreinstalledPHPVersions is list of preinstalled versions (already in ddev-php-base and ddev-webserver
var SimpleFormatting = false
SimpleFormatting is turned on by DDEV_USE_SIMPLE_FORMATTING and makes ddev list and describe, etc. use simpler formatting
var ValidMariaDBVersions = map[string]bool{ MariaDB55: true, MariaDB100: true, MariaDB101: true, MariaDB102: true, MariaDB103: true, MariaDB104: true, MariaDB105: true, MariaDB106: true, MariaDB107: true, MariaDB108: true, MariaDB1011: true, MariaDB114: true, MariaDB118: true, }
ValidMariaDBVersions is the versions of MariaDB that are valid
var ValidMySQLVersions = map[string]bool{ MySQL55: true, MySQL56: true, MySQL57: true, MySQL80: true, MySQL84: true, }
ValidMySQLVersions is the versions of MySQL that are valid
var ValidOmitContainers = map[string]bool{ DBContainer: true, DdevSSHAgentContainer: true, }
ValidOmitContainers is the list of things that can be omitted
var ValidPHPVersions = map[string]bool{ PHP56: true, PHP70: true, PHP71: true, PHP72: true, PHP73: true, PHP74: true, PHP80: true, PHP81: true, PHP82: true, PHP83: true, PHP84: true, PHP85: true, }
ValidPHPVersions should be updated whenever PHP versions are added or removed, and should be used to ensure user-supplied values are valid.
var ValidPostgresVersions = map[string]bool{ Postgres18: true, Postgres17: true, Postgres16: true, Postgres15: true, Postgres14: true, Postgres13: true, Postgres12: true, Postgres11: true, Postgres10: true, Postgres9: true, }
ValidPostgresVersions is the versions of PostgreSQL that are valid
var ValidWebserverTypes = map[string]bool{ WebserverNginxFPM: true, WebserverApacheFPM: true, WebserverGeneric: true, }
ValidWebserverTypes should be updated whenever supported webserver types are added or removed, and should be used to ensure user-supplied values are valid.
var WebserverDefault = WebserverNginxFPM
WebserverDefault is the default webserver type, overridden by $DDEV_WEBSERVER_TYPE
var XHProfModeDefault = types.XHProfModeEmpty
XHProfModeDefault is default value for app.XHProfMode
Functions ¶
func ArrayContainsString ¶
ArrayContainsString returns true if slice contains element
func GetPHPWebserverTypes ¶ added in v1.24.3
func GetPHPWebserverTypes() []string
GetPHPWebserverTypes is a helper function that returns a list of valid webserver types for PHP apps. It excludes Generic so tests that don't involve PHP can eliminate "generic"
func GetTerminalWidthHeight ¶
GetTerminalWidthHeight returns width, height if on terminal or 80, 0 if not. If we can't get terminal info, we'll assume 80x24
func GetValidDatabaseVersions ¶
func GetValidDatabaseVersions() []string
GetValidDatabaseVersions returns a slice of valid versions with the format mariadb:10.5/mysql:5.7/postgres:14
func GetValidMariaDBVersions ¶
func GetValidMariaDBVersions() []string
GetValidMariaDBVersions is a helper function that returns a list of valid MariaDB versions.
func GetValidMySQLVersions ¶
func GetValidMySQLVersions() []string
GetValidMySQLVersions is a helper function that returns a list of valid MySQL versions.
func GetValidOmitContainers ¶
func GetValidOmitContainers() []string
GetValidOmitContainers is a helper function that returns a list of valid containers for OmitContainers.
func GetValidPHPVersions ¶
func GetValidPHPVersions() []string
GetValidPHPVersions is a helper function that returns a list of valid PHP versions.
func GetValidPostgresVersions ¶
func GetValidPostgresVersions() []string
GetValidPostgresVersions is a helper function that returns a list of valid PostgreSQL versions.
func GetValidWebserverTypes ¶
func GetValidWebserverTypes() []string
GetValidWebserverTypes is a helper function that returns a list of valid webserver types.
func GetWSL2NetworkingMode ¶ added in v1.24.5
GetWSL2NetworkingMode returns the current WSL2 networking mode, normally either "nat" or "mirrored".
func GetWSLConfigPath ¶ added in v1.25.0
func GetWSLConfigPath() string
GetWSLConfigPath returns the path to the Windows .wslconfig file when running in WSL2, or empty string if not found/accessible.
func GetWSLDistro ¶
func GetWSLDistro() string
GetWSLDistro returns the WSL2 distro name if on Linux
func GrepStringInBuffer ¶
GrepStringInBuffer finds strings that match needle
func IsAppleSilicon ¶ added in v1.22.0
func IsAppleSilicon() bool
IsAppleSilicon returns true if running on macOS M Series
func IsCodespaces ¶
func IsCodespaces() bool
IsCodespaces returns true if running on GitHub Codespaces
func IsDevcontainer ¶ added in v1.25.0
func IsDevcontainer() bool
IsDevcontainer returns true if running in any Devcontainer (including Codespaces)
func IsIPAddress ¶
IsIPAddress returns true if ip is ipv4 or ipv6 address
func IsLinux ¶ added in v1.24.8
func IsLinux() bool
IsLinux returns true if running on Linux or inside WSL2
func IsPathOnWindowsFilesystem ¶ added in v1.25.0
IsPathOnWindowsFilesystem checks if the given path is on the Windows filesystem when running in WSL2. The Windows filesystem is mounted under /mnt/ in WSL2.
func IsValidDatabaseVersion ¶
IsValidDatabaseVersion checks if the version is valid for the provided database type
func IsValidMariaDBVersion ¶
IsValidMariaDBVersion is a helper function to determine if a MariaDB version is valid, returning true if the supplied MariaDB version is valid and false otherwise.
func IsValidMySQLVersion ¶
IsValidMySQLVersion is a helper function to determine if a MySQL version is valid, returning true if the supplied version is valid and false otherwise.
func IsValidOmitContainers ¶
IsValidOmitContainers is a helper function to determine if a the OmitContainers array is valid
func IsValidPHPVersion ¶
IsValidPHPVersion is a helper function to determine if a PHP version is valid, returning true if the supplied PHP version is valid and false otherwise.
func IsValidPostgresVersion ¶
IsValidPostgresVersion is a helper function to determine if a PostgreSQL version is valid, returning true if the supplied version is valid and false otherwise.
func IsValidWebserverType ¶
IsValidWebserverType is a helper function to determine if a webserver type is valid, returning true if the supplied webserver type is valid and false otherwise.
func IsWSL2HostAddressLoopbackEnabled ¶ added in v1.25.0
func IsWSL2HostAddressLoopbackEnabled() bool
IsWSL2HostAddressLoopbackEnabled checks if hostAddressLoopback=true is set in the Windows .wslconfig file. This setting is required for WSL2 mirrored networking mode to allow containers to connect back to the Windows host. Returns true if enabled, false otherwise.
func IsWSL2MirroredMode ¶ added in v1.24.5
func IsWSL2MirroredMode() bool
IsWSL2MirroredMode returns true if running WSL2 in mirrored mode.
func IsWindows ¶ added in v1.24.8
func IsWindows() bool
IsWindows returns true if running on Windows
func ParseURL ¶ added in v1.24.5
ParseURL parses a URL and returns the scheme, URL without port, and port If the URL doesn't have an explicit port, returns the default port for the scheme
func ParseWSLConfigHostAddressLoopback ¶ added in v1.25.0
ParseWSLConfigHostAddressLoopback parses .wslconfig content and returns true if hostAddressLoopback=true is found under [experimental] section.
func PathWithSlashesToArray ¶ added in v1.22.5
PathWithSlashesToArray returns an array of all possible paths separated by slashes out of a single one. i.e. path/to/file will return {"path", "path/to", "path/to/file"}
func PosString ¶
PosString returns the first index of element in slice. If slice does not contain element, returns -1.
func RandomString ¶
RandomString creates a random string with a set length
func RemoveItemFromSlice ¶
RemoveItemFromSlice returns a slice with item removed If the item does not exist, the slice is unchanged This is quite slow in the scheme of things, so shouldn't be used without examination
Types ¶
This section is empty.