Documentation
¶
Index ¶
- func CloneTemplateRepo(opts GitTemplateOptions) error
- func ConfigureTemplateRemotes(opts GitTemplateOptions) error
- func ContextPluginSupports(contextPlugin, requestedPlugin string) bool
- type CheckoutSource
- type CommandExecOptions
- type ComposeCreateContextOptions
- type ComposeCreateRequest
- type ComposeRemoteContextOptions
- type Config
- type ContextJob
- type CreateRunner
- type CreateSpec
- type FileAccessor
- func (a *FileAccessor) Close() error
- func (a *FileAccessor) ListFiles(root string) ([]string, error)
- func (a *FileAccessor) MatchFiles(root, pattern string) ([]string, error)
- func (a *FileAccessor) MatchFilesInDir(root, pattern string) ([]string, error)
- func (a *FileAccessor) ReadFile(path string) ([]byte, error)
- func (a *FileAccessor) ReadFileContext(ctx context.Context, path string) ([]byte, error)
- func (a *FileAccessor) ReadFiles(paths []string) (map[string][]byte, error)
- func (a *FileAccessor) ReadFilesContext(ctx context.Context, paths []string) (map[string][]byte, error)
- type GitTemplateOptions
- type InstalledPlugin
- type Metadata
- type ProgressLine
- type RegisteredCreate
- type RegisteredJob
- type SDK
- func (s *SDK) AddCommand(cmd *cobra.Command)
- func (s *SDK) BindComposeCreateFlags(cmd *cobra.Command, spec CreateSpec, drupalRootfs *string, ...) error
- func (s *SDK) CloneTemplateRepo(opts GitTemplateOptions) error
- func (s *SDK) Close() error
- func (s *SDK) ConfigureTemplateRemotes(opts GitTemplateOptions) error
- func (s *SDK) ContextValidators() []validate.Validator
- func (s *SDK) CreateComponentDefinitions() ([]corecomponent.Definition, error)
- func (s *SDK) CreateDefinitions() []CreateSpec
- func (s *SDK) EnsureComposeCreateContext(req ComposeCreateRequest, opts ComposeCreateContextOptions) (*config.Context, error)
- func (s *SDK) ExecContainer(ctx context.Context, opts docker.ExecOptions) (int, error)
- func (s *SDK) ExecInContainer(ctx context.Context, containerID string, cmd []string) (int, error)
- func (s *SDK) ExecInContainerInteractive(ctx context.Context, containerID string, cmd []string) (int, error)
- func (s *SDK) Execute()
- func (s *SDK) GetComponentManager() (*component.Manager, error)
- func (s *SDK) GetContext() (*config.Context, error)
- func (s *SDK) GetDiscoveryMetadataCommand() *cobra.Command
- func (s *SDK) GetDockerClient() (*docker.DockerClient, error)
- func (s *SDK) GetFileAccessor() (*FileAccessor, error)
- func (s *SDK) GetSSHClient() (*ssh.Client, error)
- func (s *SDK) InvokeIncludedPluginCommand(pluginName string, args []string, opts CommandExecOptions) (string, error)
- func (s *SDK) InvokeIncludedPlugins(args []string) ([]string, error)
- func (s *SDK) InvokePluginCommand(pluginName string, args []string, opts CommandExecOptions) (string, error)
- func (s *SDK) LocalComponentDefinitions() []corecomponent.Definition
- func (s *SDK) PromptAndSaveLocalContext(opts config.LocalContextCreateOptions) (*config.Context, error)
- func (s *SDK) RegisterComponentDefinition(def corecomponent.Definition)
- func (s *SDK) RegisterComponentDefinitions(defs ...corecomponent.Definition)
- func (s *SDK) RegisterContextJob(spec job.Spec, runner ContextJob)
- func (s *SDK) RegisterContextValidator(validator validate.Validator)
- func (s *SDK) RegisterCreate(spec CreateSpec, cmd *cobra.Command)
- func (s *SDK) RegisterCreateRunner(spec CreateSpec, runner CreateRunner)
- func (s *SDK) RegisterJob(spec job.Spec, cmd *cobra.Command)
- func (s *SDK) ResolveComposeCreateRequest(cmd *cobra.Command, input config.InputFunc, ...) (ComposeCreateRequest, error)
- func (s *SDK) SetVersionInfo(version, commit, date string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneTemplateRepo ¶ added in v0.5.0
func CloneTemplateRepo(opts GitTemplateOptions) error
func ConfigureTemplateRemotes ¶ added in v0.5.0
func ConfigureTemplateRemotes(opts GitTemplateOptions) error
func ContextPluginSupports ¶ added in v0.11.0
Types ¶
type CheckoutSource ¶ added in v0.15.0
type CheckoutSource string
const ( CheckoutSourceTemplate CheckoutSource = "template" CheckoutSourceExisting CheckoutSource = "existing" )
type CommandExecOptions ¶ added in v0.11.0
type ComposeCreateContextOptions ¶ added in v0.15.0
type ComposeCreateContextOptions struct {
DefaultName string
DefaultSite string
DefaultPlugin string
DefaultProjectDir string
DefaultProjectName string
DefaultEnvironment string
DefaultDockerSocket string
DefaultDrupalRootfs string
DrupalContainerRoot string
ConfirmOverwrite bool
Input config.InputFunc
}
type ComposeCreateRequest ¶ added in v0.15.0
type ComposeCreateRequest struct {
ContextName string
TargetType config.ContextType
CheckoutSource CheckoutSource
Path string
TemplateRepo string
TemplateBranch string
Site string
Environment string
ProjectName string
ComposeProjectName string
ComposeNetwork string
DockerSocket string
SSHHostname string
SSHUser string
SSHPort uint
SSHKeyPath string
DrupalRootfs string
SetDefaultContext bool
SetupOnly bool
Decisions map[string]corecomponent.ReviewDecision
}
type ComposeRemoteContextOptions ¶ added in v0.15.0
type ComposeRemoteContextOptions struct {
ContextName string
DefaultName string
Site string
DefaultSite string
Plugin string
ProjectDir string
DefaultProjectDir string
ProjectName string
DefaultProjectName string
Environment string
DefaultEnvironment string
ComposeProjectName string
ComposeNetwork string
DockerSocket string
SSHHostname string
SSHUser string
SSHPort uint
SSHKeyPath string
SetDefault bool
ConfirmOverwrite bool
Input config.InputFunc
DrupalRootfs string
DrupalContainerRoot string
}
type ContextJob ¶ added in v0.13.0
type CreateRunner ¶ added in v0.14.0
type CreateSpec ¶ added in v0.14.0
type CreateSpec struct {
Name string `yaml:"name"`
Plugin string `yaml:"plugin,omitempty"`
Description string `yaml:"description,omitempty"`
Default bool `yaml:"default,omitempty"`
MinCPUCores float64 `yaml:"min_cpu_cores,omitempty"`
MinMemory string `yaml:"min_memory,omitempty"`
MinDiskSpace string `yaml:"min_disk_space,omitempty"`
DockerComposeRepo string `yaml:"docker_compose_repo,omitempty"`
DockerComposeBranch string `yaml:"docker_compose_branch,omitempty"`
DockerComposeInit []string `yaml:"docker_compose_init,omitempty"`
DockerComposeUp []string `yaml:"docker_compose_up,omitempty"`
DockerComposeDown []string `yaml:"docker_compose_down,omitempty"`
}
type FileAccessor ¶ added in v0.12.0
type FileAccessor struct {
// contains filtered or unexported fields
}
func NewFileAccessor ¶ added in v0.12.0
func NewFileAccessor(ctx *config.Context) (*FileAccessor, error)
func NewFileAccessorWithSSH ¶ added in v0.12.0
func (*FileAccessor) Close ¶ added in v0.12.0
func (a *FileAccessor) Close() error
func (*FileAccessor) ListFiles ¶ added in v0.12.0
func (a *FileAccessor) ListFiles(root string) ([]string, error)
func (*FileAccessor) MatchFiles ¶ added in v0.12.0
func (a *FileAccessor) MatchFiles(root, pattern string) ([]string, error)
func (*FileAccessor) MatchFilesInDir ¶ added in v0.12.0
func (a *FileAccessor) MatchFilesInDir(root, pattern string) ([]string, error)
func (*FileAccessor) ReadFile ¶ added in v0.12.0
func (a *FileAccessor) ReadFile(path string) ([]byte, error)
func (*FileAccessor) ReadFileContext ¶ added in v0.12.0
func (*FileAccessor) ReadFiles ¶ added in v0.12.0
func (a *FileAccessor) ReadFiles(paths []string) (map[string][]byte, error)
func (*FileAccessor) ReadFilesContext ¶ added in v0.12.0
type GitTemplateOptions ¶ added in v0.5.0
type InstalledPlugin ¶ added in v0.10.0
type InstalledPlugin struct {
Name string
BinaryName string
Path string
Version string
Description string
Author string
TemplateRepo string
CanCreate bool
Includes []string
CreateDefinitions []CreateSpec
}
func DiscoverInstalled ¶ added in v0.10.0
func DiscoverInstalled() []InstalledPlugin
func DiscoverInstalledFromPath ¶ added in v0.10.0
func DiscoverInstalledFromPath(pathEnv string) []InstalledPlugin
func DiscoverInstalledLightweight ¶ added in v0.15.0
func DiscoverInstalledLightweight() []InstalledPlugin
func DiscoverInstalledLightweightFromPath ¶ added in v0.15.0
func DiscoverInstalledLightweightFromPath(pathEnv string) []InstalledPlugin
func FindInstalled ¶ added in v0.11.0
func FindInstalled(name string) (InstalledPlugin, bool)
type Metadata ¶
type Metadata struct {
Name string
Version string
Description string
Author string
TemplateRepo string
Includes []string
}
Metadata contains information about a plugin
type ProgressLine ¶ added in v0.13.0
type ProgressLine struct {
// contains filtered or unexported fields
}
func NewProgressLine ¶ added in v0.13.0
func NewProgressLine(w io.Writer, title, detail string) *ProgressLine
func (*ProgressLine) Close ¶ added in v0.13.0
func (p *ProgressLine) Close()
func (*ProgressLine) Report ¶ added in v0.13.0
func (p *ProgressLine) Report(title, detail string)
type RegisteredCreate ¶ added in v0.14.0
type RegisteredCreate struct {
Spec CreateSpec
Command *cobra.Command
}
type RegisteredJob ¶ added in v0.13.0
type SDK ¶
type SDK struct {
Metadata Metadata
Config Config
RootCmd *cobra.Command
// contains filtered or unexported fields
}
SDK provides common functionality for plugins
func (*SDK) AddCommand ¶
AddCommand adds a subcommand to the plugin
func (*SDK) BindComposeCreateFlags ¶ added in v0.15.0
func (*SDK) CloneTemplateRepo ¶ added in v0.5.0
func (s *SDK) CloneTemplateRepo(opts GitTemplateOptions) error
func (*SDK) ConfigureTemplateRemotes ¶ added in v0.5.0
func (s *SDK) ConfigureTemplateRemotes(opts GitTemplateOptions) error
func (*SDK) ContextValidators ¶ added in v0.9.0
func (*SDK) CreateComponentDefinitions ¶ added in v0.15.0
func (s *SDK) CreateComponentDefinitions() ([]corecomponent.Definition, error)
func (*SDK) CreateDefinitions ¶ added in v0.14.0
func (s *SDK) CreateDefinitions() []CreateSpec
func (*SDK) EnsureComposeCreateContext ¶ added in v0.15.0
func (s *SDK) EnsureComposeCreateContext(req ComposeCreateRequest, opts ComposeCreateContextOptions) (*config.Context, error)
func (*SDK) ExecContainer ¶ added in v0.12.0
ExecContainer executes a command in a Docker container using the shared SDK Docker path.
func (*SDK) ExecInContainer ¶
ExecInContainer executes a command in a Docker container. This is a convenience wrapper for plugins.
func (*SDK) ExecInContainerInteractive ¶
func (s *SDK) ExecInContainerInteractive(ctx context.Context, containerID string, cmd []string) (int, error)
ExecInContainerInteractive executes an interactive command in a Docker container with TTY. This is a convenience wrapper for plugins.
func (*SDK) GetComponentManager ¶ added in v0.5.0
GetComponentManager creates a component manager bound to the active sitectl context.
func (*SDK) GetContext ¶
GetContext loads the sitectl context configuration This is useful for plugins that need to access context-specific settings If no context is specified, returns the current context from config
func (*SDK) GetDiscoveryMetadataCommand ¶ added in v0.15.0
GetDiscoveryMetadataCommand returns a single cheap metadata payload for plugin discovery.
func (*SDK) GetDockerClient ¶
func (s *SDK) GetDockerClient() (*docker.DockerClient, error)
GetDockerClient creates a Docker client respecting the sitectl context This is a helper for plugins that need to interact with Docker Returns the existing DockerClient which handles both local and remote contexts
func (*SDK) GetFileAccessor ¶ added in v0.12.0
func (s *SDK) GetFileAccessor() (*FileAccessor, error)
func (*SDK) InvokeIncludedPluginCommand ¶ added in v0.11.0
func (*SDK) InvokeIncludedPlugins ¶ added in v0.11.0
func (*SDK) InvokePluginCommand ¶ added in v0.11.0
func (*SDK) LocalComponentDefinitions ¶ added in v0.15.0
func (s *SDK) LocalComponentDefinitions() []corecomponent.Definition
func (*SDK) PromptAndSaveLocalContext ¶ added in v0.5.0
func (s *SDK) PromptAndSaveLocalContext(opts config.LocalContextCreateOptions) (*config.Context, error)
PromptAndSaveLocalContext creates or updates a local sitectl context using the shared config prompts and save behavior.
func (*SDK) RegisterComponentDefinition ¶ added in v0.15.0
func (s *SDK) RegisterComponentDefinition(def corecomponent.Definition)
func (*SDK) RegisterComponentDefinitions ¶ added in v0.15.0
func (s *SDK) RegisterComponentDefinitions(defs ...corecomponent.Definition)
func (*SDK) RegisterContextJob ¶ added in v0.13.0
func (s *SDK) RegisterContextJob(spec job.Spec, runner ContextJob)
func (*SDK) RegisterContextValidator ¶ added in v0.9.0
func (*SDK) RegisterCreate ¶ added in v0.14.0
func (s *SDK) RegisterCreate(spec CreateSpec, cmd *cobra.Command)
func (*SDK) RegisterCreateRunner ¶ added in v0.14.0
func (s *SDK) RegisterCreateRunner(spec CreateSpec, runner CreateRunner)
func (*SDK) RegisterJob ¶ added in v0.13.0
func (*SDK) ResolveComposeCreateRequest ¶ added in v0.15.0
func (*SDK) SetVersionInfo ¶ added in v0.6.1
SetVersionInfo formats plugin version metadata like the main sitectl binary.