conf

package
v0.0.0-...-4c37742 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

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 DatabaseMenu

func DatabaseMenu()

DatabaseMenu ...

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 DrupalMenu

func DrupalMenu()

DrupalMenu is exposes Tokaido-level config settings

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

func GetConfigValueByArgs(args []string) (reflect.Value, error)

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 GetRootPath

func GetRootPath() string

GetRootPath ...

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 ServicesMenu

func ServicesMenu()

ServicesMenu ...

func SetConfigValueByArgs

func SetConfigValueByArgs(args []string, configType string)

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

func SetGlobalConfigValueByArgs(args []string) (err error)

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 TokaidoMenu

func TokaidoMenu()

TokaidoMenu is exposes Tokaido-level config settings

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

func GetConfig

func GetConfig() *Config

GetConfig ...

func PopulateConfig

func PopulateConfig(config *Config) (*Config, error)

PopulateConfig ...

type ConfigGenericString

type ConfigGenericString struct {
	Name    string
	Default string
	Current string
	Type    string
	Detail  string
}

ConfigGenericString ...

type ConfigRoot

type ConfigRoot struct {
	Name        string
	Description string
	Detail      string
}

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

func GetGlobalConfig

func GetGlobalConfig() *Global

GetGlobalConfig ...

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

func GetGlobalProjectSettings() (*Project, error)

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

type Telemetry

type Telemetry struct {
	Identifier string `yaml:"identifier"`
	OptOut     bool   `yaml:"optout"`
}

Telemetry carries telemetry configuration settings

Jump to

Keyboard shortcuts

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