Documentation
¶
Index ¶
- Constants
- Variables
- func CheckForConf(confPath string) (string, error)
- func Cleanup(app App) error
- func CreateAppTable() *uitable.Table
- func GetActiveAppRoot(siteName string) (string, error)
- func GetApps() map[string][]App
- func PrintRouterStatus() string
- func RenderAppRow(table *uitable.Table, site App)
- func RenderAppTable(platform string, apps []App)
- func RenderHomeRootedDir(path string) string
- func RouterComposeYAMLPath() string
- func StartDdevRouter() error
- func StopRouter() error
- type App
- type LocalApp
- func (l *LocalApp) AddHostsEntry() error
- func (l *LocalApp) AppConfDir() string
- func (l *LocalApp) AppRoot() string
- func (l *LocalApp) ComposeFiles() []string
- func (l *LocalApp) Config() error
- func (l *LocalApp) Describe() (string, error)
- func (l *LocalApp) DockerComposeYAMLPath() string
- func (l *LocalApp) DockerEnv()
- func (l LocalApp) Docroot() string
- func (l *LocalApp) Down(removeData bool) error
- func (l *LocalApp) Exec(service string, tty bool, cmd ...string) error
- func (l *LocalApp) FindContainerByType(containerType string) (docker.APIContainers, error)
- func (l *LocalApp) GetName() string
- func (l *LocalApp) GetType() string
- func (l *LocalApp) HostName() string
- func (l *LocalApp) Import() error
- func (l *LocalApp) ImportDB(imPath string, extPath string) error
- func (l *LocalApp) ImportFiles(imPath string, extPath string) error
- func (l *LocalApp) Init(basePath string) error
- func (l *LocalApp) Logs(service string, follow bool, timestamps bool, tail string) error
- func (l *LocalApp) ProcessHooks(hookName string) error
- func (l *LocalApp) SiteStatus() string
- func (l *LocalApp) Start() error
- func (l *LocalApp) Stop() error
- func (l *LocalApp) URL() string
- func (l *LocalApp) Wait(containerTypes ...string) error
Constants ¶
const DdevRouterTemplate = `` /* 352-byte string literal not displayed */
DdevRouterTemplate is the template for the generic router container.
const SiteNotFound = "not found"
SiteNotFound defines the string used to denote a site where the containers were not found/do not exist.
const SiteRunning = "running"
SiteRunning defines the string used to denote running sites.
const SiteStopped = "stopped"
SiteStopped defines the string used to denote when a site is in the stopped state.
Variables ¶
var PluginMap = map[string]App{ "local": &LocalApp{}, }
PluginMap maps the name of the plugins to their implementation.
var SequelproTemplate = `` /* 1773-byte string literal not displayed */
SequelproTemplate is the template for Sequelpro config.
Functions ¶
func CheckForConf ¶
CheckForConf checks for a config.yaml at the cwd or parent dirs.
func CreateAppTable ¶
CreateAppTable will create a new app table for describe and list output
func GetActiveAppRoot ¶
GetActiveAppRoot returns the fully rooted directory of the active app, or an error
func PrintRouterStatus ¶
func PrintRouterStatus() string
PrintRouterStatus outputs router status and warning if not running or healthy, as applicable.
func RenderAppRow ¶
RenderAppRow will add an application row to an existing table for describe and list output.
func RenderAppTable ¶
RenderAppTable will format a table for user display based on a list of apps.
func RenderHomeRootedDir ¶
RenderHomeRootedDir shortens a directory name to replace homedir with ~
func RouterComposeYAMLPath ¶
func RouterComposeYAMLPath() string
RouterComposeYAMLPath returns the full filepath to the routers docker-compose yaml file.
func StopRouter ¶
func StopRouter() error
StopRouter stops the local router if there are no ddev containers running.
Types ¶
type App ¶
type App interface {
Init(string) error
Describe() (string, error)
GetType() string
AppRoot() string
GetName() string
Start() error
Stop() error
DockerEnv()
DockerComposeYAMLPath() string
Down(removeData bool) error
Config() error
HostName() string
URL() string
Import() error
ImportDB(imPath string, extPath string) error
ImportFiles(imPath string, extPath string) error
SiteStatus() string
FindContainerByType(containerType string) (docker.APIContainers, error)
Exec(service string, tty bool, cmd ...string) error
Logs(service string, follow bool, timestamps bool, tail string) error
}
App is an interface apps for Drud Local must implement to use shared functionality
func GetActiveApp ¶
GetActiveApp returns the active App based on the current working directory or running siteName provided.
func GetPluginApp ¶
GetPluginApp will return an application of the type specified by pluginType
type LocalApp ¶
LocalApp implements the AppBase interface local development apps
func (*LocalApp) AddHostsEntry ¶
AddHostsEntry will add the local site URL to the local hostfile.
func (*LocalApp) AppConfDir ¶
AppConfDir returns the full path to the app's .ddev configuration directory
func (*LocalApp) ComposeFiles ¶
ComposeFiles returns a list of compose files for a project.
func (*LocalApp) Config ¶
Config creates the apps config file adding things like database host, name, and password as well as other sensitive data like salts.
func (*LocalApp) Describe ¶
Describe returns a string which provides detailed information on services associated with the running site.
func (*LocalApp) DockerComposeYAMLPath ¶
DockerComposeYAMLPath returns the absolute path to where the docker-compose.yaml should exist for this app configuration. This is a bit redundant, but is here to avoid having to expose too many details of AppConfig.
func (*LocalApp) DockerEnv ¶
func (l *LocalApp) DockerEnv()
DockerEnv sets environment variables for a docker-compose run.
func (*LocalApp) FindContainerByType ¶
FindContainerByType will find a container for this site denoted by the containerType if it is available.
func (*LocalApp) Import ¶
Import performs an import from the a configured provider plugin, if one exists.
func (*LocalApp) ImportDB ¶
ImportDB takes a source sql dump and imports it to an active site's database container.
func (*LocalApp) ImportFiles ¶
ImportFiles takes a source directory or archive and copies to the uploaded files directory of a given app.
func (*LocalApp) ProcessHooks ¶
ProcessHooks executes commands defined in a ddevapp.Command
func (*LocalApp) SiteStatus ¶
SiteStatus returns the current status of an application determined from web and db service health.