Documentation ¶
Index ¶
- func CoreDrupal8Path() string
- func CoreDrupalFile() string
- func CreateOrReplaceDrupalConfig(path, version string)
- func DatabaseEngineMenu()
- func DatabaseMariadbconfigMenu()
- func DatabaseMenu()
- func DatabaseMysqlconfigMenu()
- func DeregisterProject(name string)
- func DrupalMenu()
- func FpmMenu()
- func GetConfigValueByArgs(args []string) (reflect.Value, error)
- func GetProjectPath() (path string)
- func GetRootDir() string
- func GetRootPath() string
- func MainMenu()
- func NginxMenu()
- func RegisterProject(name, path string)
- func ServicesMenu()
- func SetConfigValueByArgs(args []string, configType string)
- func SetDrupalConfig(drupalType string)
- func SetGlobalConfigValueByArgs(args []string) (err error)
- func TokaidoMenu()
- func TokaidoPhpversionMenu()
- func TokaidoStabilityMenu()
- func ValidProjectRoot()
- func WriteGlobalConfig(ng Global)
- func WriteGlobalProjectSettings(p *Project)
- type ComposeDotTok
- type Config
- type ConfigGenericString
- type ConfigRoot
- type Global
- type Project
- type Services
- type Telemetry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoreDrupal8Path ¶
func CoreDrupal8Path() string
CoreDrupal8Path - Return the core Drupal 8 path
func CoreDrupalFile ¶
func CoreDrupalFile() string
CoreDrupalFile - Return the core drupal file for the users' installation
func CreateOrReplaceDrupalConfig ¶
func CreateOrReplaceDrupalConfig(path, version string)
CreateOrReplaceDrupalConfig ...
func DatabaseEngineMenu ¶
func DatabaseEngineMenu()
DatabaseEngineMenu is exposes Tokaido-level config settings
func DatabaseMariadbconfigMenu ¶
func DatabaseMariadbconfigMenu()
DatabaseMariadbconfigMenu enables the user to change the Mariadb version
func DatabaseMysqlconfigMenu ¶
func DatabaseMysqlconfigMenu()
DatabaseMysqlconfigMenu enables the user to change the MySQL version
func DeregisterProject ¶
func DeregisterProject(name string)
DeregisterProject removes a project from the global config file
func FpmMenu ¶
func FpmMenu()
FpmMenu is exposes Nginx config settings that can be controlled from the codebase, rather than via the container env vars
func GetConfigValueByArgs ¶
GetConfigValueByArgs - Get a config value based on the arguments sent from the command line
func GetProjectPath ¶
func GetProjectPath() (path string)
GetProjectPath returns the full system path to this project as it exists in the global.yml file
func GetRootDir ¶
func GetRootDir() string
GetRootDir - Return the drupal root folder name without workdir
func MainMenu ¶
func MainMenu()
MainMenu is the root menu object for the `tok config` command. It is used to view and edit the Tokaido config
func NginxMenu ¶
func NginxMenu()
NginxMenu is exposes Nginx config settings that can be controlled from the codebase, rather than via the container env vars
func RegisterProject ¶
func RegisterProject(name, path string)
RegisterProject adds a project to the global config file
func SetConfigValueByArgs ¶
SetConfigValueByArgs updates the config file by merging a **single** new value with the current in memory configuration. Once merged, it writes the updated config to disk - args are a slice of new values such as `[]string{"nginx", "workerconnections", "30"}` - configType is either 'project' or 'global' and will determine which file is updated
func SetDrupalConfig ¶
func SetDrupalConfig(drupalType string)
SetDrupalConfig if there is no config already applied
func SetGlobalConfigValueByArgs ¶
SetGlobalConfigValueByArgs enables the update of global config values by a string slice When working project-level global config, it defaults to updating the active project
func TokaidoPhpversionMenu ¶
func TokaidoPhpversionMenu()
TokaidoPhpversionMenu is exposes Tokaido-level config settings
func TokaidoStabilityMenu ¶
func TokaidoStabilityMenu()
TokaidoStabilityMenu is exposes Tokaido-level config settings
func ValidProjectRoot ¶
func ValidProjectRoot()
ValidProjectRoot - Check if the project root was found, if not log and exit
func WriteGlobalConfig ¶
func WriteGlobalConfig(ng Global)
WriteGlobalConfig overwrites the existing global.yml with the supplied config
func WriteGlobalProjectSettings ¶
func WriteGlobalProjectSettings(p *Project)
WriteGlobalProjectSettings takes an updated Project object and merges it with all of the Projects defined in the global config, finally saving the whole global config back to disk
Types ¶
type ComposeDotTok ¶
type ComposeDotTok struct { Version string `yaml:"version,omitempty"` Services Services `yaml:"services,omitempty"` }
ComposeDotTok ...
type Config ¶
type Config struct { Global Global `yaml:"global,omitempty"` Tokaido struct { Config string `yaml:"config,omitempty"` Customcompose bool `yaml:"customcompose"` Debug bool `yaml:"debug,omitempty"` Dependencychecks bool `yaml:"dependencychecks"` Enableemoji bool `yaml:"enableemoji"` Force bool `yaml:"force,omitempty"` Yes bool `yaml:"yes,omitempty"` Phpversion string `yaml:"phpversion"` Stability string `yaml:"stability"` Project struct { Identifier string `yaml:"identifier"` Name string `yaml:"name"` } `yaml:"project"` } `yaml:"tokaido"` Drupal struct { Path string `yaml:"path,omitempty"` Majorversion string `yaml:"majorversion,omitempty"` FilePublicPath string `yaml:"filepublicpath,omitempty"` FilePrivatePath string `yaml:"fileprivatepath,omitempty"` FileTemporaryPath string `yaml:"filetemporarypath,omitempty"` } `yaml:"drupal,omitempty"` Database struct { Engine string `yaml:"engine,omitempty"` Mysqlconfig struct { Version string `yaml:"version,omitempty"` } `yaml:"mysqlconfig,omitempty"` Mariadbconfig struct { Version string `yaml:"version,omitempty"` } `yaml:"mariadbconfig,omitempty"` } `yaml:"database,omitempty"` Nginx struct { Workerconnections string `yaml:"workerconnections,omitempty"` Clientmaxbodysize string `yaml:"clientmaxbodysize,omitempty"` Keepalivetimeout string `yaml:"keepalivetimeout,omitempty"` Fastcgireadtimeout string `yaml:"fastcgireadtimeout,omitempty"` Fastcgibuffers string `yaml:"fastcgibuffers,omitempty"` Fastcgibuffersize string `yaml:"fastcgibuffersize,omitempty"` } `yaml:"nginx,omitempty"` Fpm struct { Maxexecutiontime string `yaml:"maxexecutiontime,omitempty"` Phpmemorylimit string `yaml:"phpmemorylimit,omitempty"` Phpdisplayerrors string `yaml:"phpdisplayerrors,omitempty"` Phplogerrors string `yaml:"phplogerrors,omitempty"` Phpreportmemleaks string `yaml:"phpreportmemleaks,omitempty"` Phppostmaxsize string `yaml:"phppostmaxsize,omitempty"` Phpdefaultcharset string `yaml:"phpdefaultcharset,omitempty"` Phpfileuploads string `yaml:"phpfileuploads,omitempty"` Phpuploadmaxfilesize string `yaml:"phpuploadmaxfilesize,omitempty"` Phpmaxfileuploads string `yaml:"phpmaxfileuploads,omitempty"` Phpallowurlfopen string `yaml:"phpallowurlfopen,omitempty"` } Services Services `yaml:"services,omitempty"` }
Config the application's configuration IMPORTANT! Casing of the `Config` struct properties is important to note All properties must be cased as capital letter first, followed by all lowercase eg. `Customcompose` (correct), `CustomCompose` (incorrect) This is to ensure they both conform to the golang convention and that they are able to be properly parsed by the `tok config-x` commands
type ConfigGenericString ¶
type ConfigGenericString struct { Name string Default string Current string Type string Detail string }
ConfigGenericString ...
type ConfigRoot ¶
ConfigRoot ...
type Global ¶
type Global struct { Syncservice string `yaml:"syncservice,omitempty"` Projects []Project `yaml:"projects,omitempty"` Telemetry Telemetry `yaml:"telemetry,omitempty"` CustomTemplates string `yaml:"customTemplates,omitempty"` }
Global contains all our global config settings that are saved in ~/.tok/global.yml
type Project ¶
type Project struct { Name string `yaml:"name,omitempty"` Path string `yaml:"path,omitempty"` Database struct { Port int `yaml:"port,omitempty"` } `yaml:"database,omitempty"` Xdebug struct { Enabled bool `yaml:"enabled"` FpmPort int `yaml:"fpmport"` } `yaml:"xdebug,omitempty"` }
Project is a singular entry of a project name and path used in global config
func GetGlobalProjectSettings ¶
GetGlobalProjectSettings returns the current global conf object for the current project
type Services ¶
type Services struct { Unison struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment []string `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"unison,omitempty"` Chromedriver struct { Enabled bool `yaml:"enabled,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Image string `yaml:"image,omitempty"` Ports []string `yaml:"ports,omitempty"` } `yaml:"chromedriver,omitempty"` Sync struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Restart string `yaml:"restart,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"sync,omitempty"` Syslog struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"syslog,omitempty"` Nginx struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` Networks struct { Default struct { Aliases []string `yaml:"aliases,omitempty"` } `yaml:"default,omitempty"` } `yaml:"networks,omitempty"` } `yaml:"nginx,omitempty"` Testcafe struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Workingdir string `yaml:"working_dir,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"testcafe,omitempty"` Fpm struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Workingdir string `yaml:"working_dir,omitempty"` Dependson []string `yaml:"depends_on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"fpm,omitempty"` Memcache struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"memcache,omitempty"` Mysql struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"mysql,omitempty"` Drush struct { Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Workingdir string `yaml:"working_dir,omitempty"` Volumesfrom []string `yaml:"volumes_from,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"drush,omitempty"` Solr struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"solr,omitempty"` Redis struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"redis,omitempty"` Mailhog struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"mailhog,omitempty"` Adminer struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Hostname string `yaml:"hostname,omitempty"` Ports []string `yaml:"ports,omitempty"` Entrypoint []string `yaml:"entrypoint,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"adminer,omitempty"` Kishu struct { Enabled bool `yaml:"enabled,omitempty"` Image string `yaml:"image,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` } `yaml:"kishu,omitempty"` }
Services ...