nodeps

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

MariaDB Versions

View Source
const (
	MySQL55 = "5.5"
	MySQL56 = "5.6"
	MySQL57 = "5.7"
	MySQL80 = "8.0"
)

Oracle MySQL versions

View Source
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"
)

PHP Versions

View Source
const (
	Postgres16 = "16"
	Postgres15 = "15"
	Postgres14 = "14"
	Postgres13 = "13"
	Postgres12 = "12"
	Postgres11 = "11"
	Postgres10 = "10"
	Postgres9  = "9"
)

PostgreSQL Versions

View Source
const (
	MariaDB  = "mariadb"
	MySQL    = "mysql"
	Postgres = "postgres"
)

Database Types

View Source
const (
	DdevSSHAgentContainer = "ddev-ssh-agent"
	DBContainer           = "db"
	WebContainer          = "web"
	RouterContainer       = "ddev-router"
)

Container types used with ddev

View Source
const (
	WebserverNginxFPM      = "nginx-fpm"
	WebserverApacheFPM     = "apache-fpm"
	WebserverNginxGunicorn = "nginx-gunicorn"
)

Webserver types

View Source
const (
	AppTypeNone         = ""
	AppTypeBackdrop     = "backdrop"
	AppTypeCakePHP      = "cakephp"
	AppTypeCraftCms     = "craftcms"
	AppTypeDjango4      = "django4"
	AppTypeDrupal6      = "drupal6"
	AppTypeDrupal7      = "drupal7"
	AppTypeDrupal8      = "drupal8"
	AppTypeDrupal9      = "drupal9"
	AppTypeDrupal10     = "drupal10"
	AppTypeDrupal       = "drupal"
	AppTypeLaravel      = "laravel"
	AppTypeSilverstripe = "silverstripe"
	AppTypeMagento      = "magento"
	AppTypeMagento2     = "magento2"
	AppTypePHP          = "php"
	AppTypePython       = "python"
	AppTypeShopware6    = "shopware6"
	AppTypeTYPO3        = "typo3"
	AppTypeWordPress    = "wordpress"
)

App types

View Source
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"
	// 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

View Source
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.

View Source
const MariaDBDefaultVersion = MariaDB1011

MariaDBDefaultVersion is the default MariaDB version

View Source
const NodeJSDefault = "20"
View Source
const PHPDefault = PHP82

PHPDefault is the default PHP version, overridden by $DDEV_PHP_VERSION

View Source
const PostgresConfigDir = "/etc/postgresql"

PostgresConfigDir is in-container location of PostgreSQL config

View Source
const PostgresDefaultVersion = Postgres14

PostgresDefaultVersion is the default PostgreSQL version

View Source
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

View Source
var ComposerDefault = "2"

Composer version default - will get latest Composer v2

View Source
var FailOnHookFailDefault = false

FailOnHookFailDefault is the default value for app.FailOnHookFail

View Source
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>

View Source
var InstrumentationTags = map[string]string{}

InstrumentationTags contains the tags to be sent to telemetry

View Source
var NoBindMountsDefault = false

NoBindMountsDefault is default value for globalconfig.DDEVGlobalConfig.NoBindMounts

View Source
var PerformanceModeDefault = types.PerformanceModeEmpty

PerformanceModeDefault is default value for app.PerformanceMode

View Source
var SimpleFormatting = false

SimpleFormatting is turned on by DDEV_USE_SIMPLE_FORMATTING and makes ddev list and describe, etc. use simpler formatting

View Source
var UseNginxProxyRouter = false

UseNginxProxyRouter is used in testing to override the default setting for tests.

View Source
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,
}

ValidMariaDBVersions is the versions of MariaDB that are valid

View Source
var ValidMySQLVersions = map[string]bool{
	MySQL55: true,
	MySQL56: true,
	MySQL57: true,
	MySQL80: true,
}

ValidMySQLVersions is the versions of MySQL that are valid

View Source
var ValidOmitContainers = map[string]bool{
	DBContainer:           true,
	DdevSSHAgentContainer: true,
}

ValidOmitContainers is the list of things that can be omitted

View Source
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,
}

ValidPHPVersions should be updated whenever PHP versions are added or removed, and should be used to ensure user-supplied values are valid.

View Source
var ValidPostgresVersions = map[string]bool{
	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

ValidWebserverTypes should be updated whenever supported webserver types are added or removed, and should be used to ensure user-supplied values are valid.

View Source
var WebserverDefault = WebserverNginxFPM

WebserverDefault is the default webserver type, overridden by $DDEV_WEBSERVER_TYPE

Functions

func ArrayContainsString

func ArrayContainsString(slice []string, element string) bool

ArrayContainsString returns true if slice contains element

func GetTerminalWidthHeight

func GetTerminalWidthHeight() (int, int)

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 GetWSLDistro

func GetWSLDistro() string

GetWSLDistro returns the WSL2 distro name if on Linux

func GrepStringInBuffer

func GrepStringInBuffer(buffer string, needle string) []string

GrepStringInBuffer finds strings that match needle

func IsAppleSilicon added in v1.22.0

func IsAppleSilicon() bool

IsAppleSilicon returns true if running on mac M1

func IsCodespaces

func IsCodespaces() bool

IsCodespaces returns true if running on GitHub Codespaces

func IsGitpod

func IsGitpod() bool

IsGitpod returns true if running on gitpod.io

func IsIPAddress

func IsIPAddress(ip string) bool

IsIPAddress returns true if ip is ipv4 or ipv6 address

func IsInteger

func IsInteger(s string) bool

IsInteger returns true if the string is integer

func IsLetter

func IsLetter(s string) bool

IsLetter returns true if all chars in string are alpha

func IsValidDatabaseVersion

func IsValidDatabaseVersion(dbType string, dbVersion string) bool

IsValidDatabaseVersion checks if the version is valid for the provided database type

func IsValidMariaDBVersion

func IsValidMariaDBVersion(MariaDBVersion string) bool

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

func IsValidMySQLVersion(v string) bool

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

func IsValidOmitContainers(containerList []string) bool

IsValidOmitContainers is a helper function to determine if a the OmitContainers array is valid

func IsValidPHPVersion

func IsValidPHPVersion(phpVersion string) bool

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

func IsValidPostgresVersion(v string) bool

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

func IsValidWebserverType(webserverType string) bool

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 IsWSL2 added in v1.22.0

func IsWSL2() bool

IsWSL2 returns true if running WSL2

func PathWithSlashesToArray added in v1.22.5

func PathWithSlashesToArray(path string) []string

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

func PosString(slice []string, element string) int

PosString returns the first index of element in slice. If slice does not contain element, returns -1.

func RandomString

func RandomString(length int) string

RandomString creates a random string with a set length

func RemoveItemFromSlice

func RemoveItemFromSlice(slice []string, item string) []string

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.

Jump to

Keyboard shortcuts

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