Documentation
¶
Index ¶
- func ConfigFilePath() string
- func ContextExists(name string) (bool, error)
- func Current() (string, error)
- func GetDefaultLocalDockerSocket(dockerSocket string) string
- func GetInput(question ...string) (string, error)
- func Save(cfg *Config) error
- func SaveContext(ctx *Context, setDefault bool) error
- func SetCommandFlags(flags *pflag.FlagSet)
- type Config
- type Context
- func (c *Context) DialSSH() (*ssh.Client, error)
- func (c *Context) GetSshUri() string
- func (c *Context) ListFiles(root string) ([]string, error)
- func (c *Context) ProjectDirExists() (bool, error)
- func (c *Context) ReadFile(filename string) ([]byte, error)
- func (c *Context) ReadSmallFile(filename string) string
- func (c *Context) RemoveFile(filename string) error
- func (c *Context) RunCommand(cmd *exec.Cmd) (string, error)
- func (context Context) String() (string, error)
- func (c *Context) UploadFile(source, destination string) error
- func (cc *Context) VerifyRemoteInput(existingSite bool) error
- func (c *Context) WriteFile(filename string, data []byte) error
- type ContextType
- type FileReader
- type InputFunc
- type LocalContextCreateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
func ConfigFilePath() string
func ContextExists ¶
func GetDefaultLocalDockerSocket ¶
for local contexts, try a bunch of common paths grab the docker socket this is mostly needed for Mac OS
func SaveContext ¶
func SetCommandFlags ¶
Types ¶
type Config ¶
type Context ¶
type Context struct {
Name string `yaml:"name"`
DockerHostType ContextType `mapstructure:"type" yaml:"type"`
DockerSocket string `yaml:"docker-socket"`
ProjectName string `yaml:"project-name"`
ProjectDir string `yaml:"project-dir"`
SSHUser string `yaml:"ssh-user"`
SSHHostname string `yaml:"ssh-hostname,omitempty"`
SSHPort uint `yaml:"ssh-port,omitempty"`
SSHKeyPath string `yaml:"ssh-key,omitempty"`
EnvFile []string `yaml:"env-file"`
ComposeFile []string `yaml:"compose-file,omitempty"`
RunSudo bool `yaml:"sudo"`
// Database connection configuration
DatabaseService string `yaml:"database-service,omitempty"`
DatabaseUser string `yaml:"database-user,omitempty"`
DatabasePasswordSecret string `yaml:"database-password-secret,omitempty"`
DatabaseName string `yaml:"database-name,omitempty"`
ReadSmallFileFunc func(filename string) string `yaml:"-"`
// Extra holds plugin-specific configuration.
// Each plugin uses its own key (e.g., "drupal", "isle", "wordpress").
Extra map[string]yaml.Node `yaml:"extra,omitempty"`
}
func GetContext ¶
func PromptAndSaveLocalContext ¶ added in v0.5.0
func PromptAndSaveLocalContext(opts LocalContextCreateOptions) (*Context, error)
func (*Context) ListFiles ¶ added in v0.5.0
ListFiles lists files under a directory relative to the directory root.
func (*Context) ProjectDirExists ¶
func (*Context) ReadFile ¶ added in v0.5.0
ReadFile reads a file from the context, supporting local and remote paths.
func (*Context) ReadSmallFile ¶
func (*Context) RemoveFile ¶ added in v0.5.0
RemoveFile removes a file from the context.
func (*Context) UploadFile ¶
func (*Context) VerifyRemoteInput ¶
type ContextType ¶
type ContextType string
const ( ContextLocal ContextType = "local" ContextRemote ContextType = "remote" )
type FileReader ¶
FileReader defines the behavior needed to read small files.
type LocalContextCreateOptions ¶ added in v0.5.0
type LocalContextCreateOptions struct {
Name string
DefaultName string
ProjectDir string
DefaultProjectDir string
ProjectName string
DefaultProjectName string
DockerSocket string
SetDefault bool
ConfirmOverwrite bool
Input InputFunc
ContextNamePrompt []string
ProjectDirPrompt []string
OverwritePrompt []string
}
Click to show internal directories.
Click to hide internal directories.