Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayContainsString(slice []string, element string) bool
- func GetTerminalWidthHeight() (int, int)
- func GetValidDatabaseVersions() []string
- func GetValidMariaDBVersions() []string
- func GetValidMySQLVersions() []string
- func GetValidNodeVersions() []string
- func GetValidOmitContainers() []string
- func GetValidPHPVersions() []string
- func GetValidPostgresVersions() []string
- func GetValidWebserverTypes() []string
- func GetWSLDistro() string
- func GrepStringInBuffer(buffer string, needle string) []string
- func IsCodespaces() bool
- func IsGitpod() bool
- func IsIPAddress(ip string) bool
- func IsInteger(s string) bool
- func IsLetter(s string) bool
- func IsMacM1() bool
- func IsValidDatabaseVersion(dbType string, dbVersion string) bool
- func IsValidMariaDBVersion(MariaDBVersion string) bool
- func IsValidMySQLVersion(v string) bool
- func IsValidNodeVersion(v string) bool
- func IsValidOmitContainers(containerList []string) bool
- func IsValidPHPVersion(phpVersion string) bool
- func IsValidPostgresVersion(v string) bool
- func IsValidWebserverType(webserverType string) bool
- 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" )
MariaDB Versions
const ( MySQL55 = "5.5" MySQL56 = "5.6" MySQL57 = "5.7" MySQL80 = "8.0" )
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" )
PHP Versions
const ( Postgres15 = "15" Postgres14 = "14" Postgres13 = "13" Postgres12 = "12" Postgres11 = "11" Postgres10 = "10" Postgres9 = "9" )
Postgres Versions
const ( MariaDB = "mariadb" MySQL = "mysql" Postgres = "postgres" )
Database Types
const ( DdevSSHAgentContainer = "ddev-ssh-agent" DBAContainer = "dba" DBContainer = "db" WebContainer = "web" RouterContainer = "ddev-router" )
Container types used with ddev
const ( WebserverNginxFPM = "nginx-fpm" WebserverApacheFPM = "apache-fpm" )
Webserver types
const ( AppTypeBackdrop = "backdrop" AppTypeCraftCms = "craftcms" AppTypeDrupal6 = "drupal6" AppTypeDrupal7 = "drupal7" AppTypeDrupal8 = "drupal8" AppTypeDrupal9 = "drupal9" AppTypeDrupal10 = "drupal10" AppTypeLaravel = "laravel" 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" // DdevDefaultPHPMyAdminPort is the default router port for dba/PHPMyadmin DdevDefaultPHPMyAdminPort = "8036" DdevDefaultPHPMyAdminHTTPSPort = "8037" // DdevDefaultMailhogPort is the default router port for Mailhog DdevDefaultMailhogPort = "8025" DdevDefaultMailhogHTTPSPort = "8026" // DdevDefaultTLD is the top-level-domain used by default, can be overridden DdevDefaultTLD = "ddev.site" DefaultDefaultContainerTimeout = "120" InternetDetectionTimeoutDefault = 3000 MinimumDockerSpaceWarning = 5000000 // 5GB in KB (to compare against df reporting in KB) )
Ports and other defaults
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 MariaDBDefaultVersion = MariaDB104
MariaDBDefaultVersion is the default MariaDB version
const NodeJSDefault = "16"
const PHPDefault = PHP80
PHPDefault is the default PHP version, overridden by $DDEV_PHP_VERSION
const PostgresConfigDir = "/etc/postgresql"
PostgresConfigDir is in-container location of postgres config
const PostgresDefaultVersion = Postgres14
PostgresDefaultVersion is the default Postgres 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"
Composer version default - will get latest composer v2
var FailOnHookFailDefault = false
FailOnHookFailDefault is the default value for app.FailOnHookFail
var InstrumentationTags = map[string]string{}
InstrumentationTags contains the tags to be sent to Segment
var MutagenEnabledDefault = false
MutagenEnabledDefault is default value for app.MutagenEnabled
var NFSMountEnabledDefault = false
NFSMountEnabledDefault is default value for app.NFSMountEnabled
var NoBindMountsDefault = false
NoBindMountsDefault is default value for globalconfig.DDEVGlobalConfig.NoBindMounts
var SimpleFormatting = false
SimpleFormatting is turned on by DDEV_USE_SIMPLE_FORMATTING and makes ddev list and describe, etc. use simpler formatting
var UseTraefikDefault = false
UseTraefikDefault is the default value for globalconfig.DDEVGlobalConfig.UseTraefik
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, }
ValidMariaDBVersions is the versions of MariaDB that are valid
var ValidMySQLVersions = map[string]bool{ MySQL55: true, MySQL56: true, MySQL57: true, MySQL80: true, }
ValidMySQLVersions is the versions of MySQL that are valid
var ValidNodeJSVersions = []string{"14", "16", "18"}
var ValidOmitContainers = map[string]bool{ DBContainer: true, DdevSSHAgentContainer: true, DBAContainer: 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, }
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{ Postgres15: true, Postgres14: true, Postgres13: true, Postgres12: true, Postgres11: true, Postgres10: true, Postgres9: true, }
ValidPostgresVersions is the versions of Postgres that are valid
var ValidWebserverTypes = map[string]bool{ WebserverNginxFPM: true, WebserverApacheFPM: 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
Functions ¶
func ArrayContainsString ¶
ArrayContainsString returns true if slice contains element
func GetTerminalWidthHeight ¶
GetTerminalWidthHeight returns width, height if on terminal or 80, 0 if not. If we can't get terminal info, we'll just 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 GetValidNodeVersions ¶
func GetValidNodeVersions() []string
GetValidNodeVersions is a helper function that returns a list of valid nodejs 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 Postgres versions.
func GetValidWebserverTypes ¶
func GetValidWebserverTypes() []string
GetValidWebserverTypes is a helper function that returns a list of valid webserver types.
func GetWSLDistro ¶
func GetWSLDistro() string
GetWSLDistro returns the WSL2 distro name if on Linux
func GrepStringInBuffer ¶
GrepStringInBuffer finds strings that match needle
func IsCodespaces ¶
func IsCodespaces() bool
IsCodespaces returns true if running on Github Codespaces
func IsIPAddress ¶
IsIPAddress returns true if ip is ipv4 or ipv6 address
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 IsValidNodeVersion ¶
IsValidNodeVersion is a helper function to determine if a NodeJS version is valid
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 Postgres 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 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.