Documentation
¶
Index ¶
- func AddStandardComposeCommands(s *SDK, opts StandardComposeCommandOptions)
- func CloneTemplateRepo(opts GitTemplateOptions) error
- func ConfigureTemplateRemotes(opts GitTemplateOptions) error
- func ContextPluginSupports(contextPlugin, requestedPlugin string) bool
- func DetectProjectOwner(projectDir, requestedPlugin string) (*config.ProjectClaim, error)
- func DockerComposeExecCommand(service string, args ...string) string
- func PrintComposeTemplateCreateSummary(out io.Writer, ctx *config.Context, readyMessage string, setupOnly bool)
- func RegisterComposeTemplateCreateRunner(s *SDK, spec CreateSpec, opts ComposeTemplateCreateOptions)
- func RegisterStandardComposeTemplate(s *SDK, spec CreateSpec, opts StandardComposeTemplateOptions)
- func ShellJoin(args []string) string
- func ShellQuote(value string) string
- type CheckoutSource
- type CommandExecOptions
- type ComposeCreateContextOptions
- type ComposeCreateRequest
- type ComposeProjectDiscovery
- type ComposeRemoteContextOptions
- type ComposeTemplateCreateOptions
- type Config
- type ContextJob
- type ConvergeRunner
- type CreateRunner
- type CreateSpec
- type DebugRunner
- type DeployRunner
- type DeploySpec
- 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 ProjectDiscoveryFunc
- type RegisteredCreate
- type RegisteredDeploy
- type RegisteredJob
- type SDK
- func (s *SDK) AddCommand(cmd *cobra.Command)
- func (s *SDK) AddStandardComposeCommands(opts StandardComposeCommandOptions)
- 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) ContextFromCommand(cmd *cobra.Command) (*config.Context, error)
- func (s *SDK) ContextValidators() []validate.Validator
- func (s *SDK) CreateComponentDefinitions() ([]corecomponent.Definition, error)
- func (s *SDK) CreateDefinitions() []CreateSpec
- func (s *SDK) DeployDefinitions() []DeploySpec
- func (s *SDK) EnsureComposeCreateContext(req ComposeCreateRequest, opts ComposeCreateContextOptions) (*config.Context, error)
- func (s *SDK) EnsureComposeTemplateCheckout(out io.Writer, req ComposeCreateRequest, ctx *config.Context) (bool, error)
- func (s *SDK) EnsureComposeTemplateCheckoutContext(runCtx context.Context, out io.Writer, req ComposeCreateRequest, ...) (bool, 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) GetProjectDetectionCommand() *cobra.Command
- 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) RegisterComposeTemplateCreateRunner(spec CreateSpec, opts ComposeTemplateCreateOptions)
- func (s *SDK) RegisterContextJob(spec job.Spec, runner ContextJob)
- func (s *SDK) RegisterContextValidator(validator validate.Validator)
- func (s *SDK) RegisterConvergeRunner(runner ConvergeRunner)
- func (s *SDK) RegisterCreate(spec CreateSpec, cmd *cobra.Command)
- func (s *SDK) RegisterCreateRunner(spec CreateSpec, runner CreateRunner)
- func (s *SDK) RegisterDebugHandler(runner DebugRunner)
- func (s *SDK) RegisterDeployRunner(spec DeploySpec, runner DeployRunner)
- func (s *SDK) RegisterJob(spec job.Spec, cmd *cobra.Command)
- func (s *SDK) RegisterSetRunner(runner SetRunner)
- func (s *SDK) RegisterStandardComposeTemplate(spec CreateSpec, opts StandardComposeTemplateOptions)
- func (s *SDK) RegisterValidateRunner(runner ValidateRunner)
- func (s *SDK) ResolveComposeCreateRequest(cmd *cobra.Command, input config.InputFunc, ...) (ComposeCreateRequest, error)
- func (s *SDK) RunActiveComposeProjectCommand(cmd *cobra.Command, command string) error
- func (s *SDK) RunActiveComposeProjectCommandList(cmd *cobra.Command, commands []string) error
- func (s *SDK) RunComposeProjectCommand(ctx *config.Context, projectDir string, stdout, stderr io.Writer, ...) error
- func (s *SDK) RunComposeProjectCommandContext(runCtx context.Context, ctx *config.Context, projectDir string, ...) error
- func (s *SDK) RunComposeProjectCommandList(cmd *cobra.Command, ctx *config.Context, commands []string) error
- func (s *SDK) SetComposeProjectDiscovery(spec ComposeProjectDiscovery)
- func (s *SDK) SetProjectDiscovery(discovery ProjectDiscoveryFunc)
- func (s *SDK) SetVersionInfo(version, commit, date string)
- type SetRunner
- type StandardComposeCommandOptions
- type StandardComposeTemplateOptions
- type ValidateRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStandardComposeCommands ¶ added in v0.16.5
func AddStandardComposeCommands(s *SDK, opts StandardComposeCommandOptions)
AddStandardComposeCommands registers standard lifecycle, status, logs, and rollout commands for a Docker Compose-backed plugin.
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
func DetectProjectOwner ¶ added in v0.17.0
func DetectProjectOwner(projectDir, requestedPlugin string) (*config.ProjectClaim, error)
func DockerComposeExecCommand ¶ added in v0.16.5
DockerComposeExecCommand builds a shell-safe "docker compose exec -T" command for a service and argv-style command.
func PrintComposeTemplateCreateSummary ¶ added in v0.16.5
func PrintComposeTemplateCreateSummary(out io.Writer, ctx *config.Context, readyMessage string, setupOnly bool)
PrintComposeTemplateCreateSummary renders the standard create completion summary for compose-template plugins.
func RegisterComposeTemplateCreateRunner ¶ added in v0.16.5
func RegisterComposeTemplateCreateRunner(s *SDK, spec CreateSpec, opts ComposeTemplateCreateOptions)
RegisterComposeTemplateCreateRunner registers the SDK's standard Docker Compose template create runner for a plugin.
func RegisterStandardComposeTemplate ¶ added in v0.16.5
func RegisterStandardComposeTemplate(s *SDK, spec CreateSpec, opts StandardComposeTemplateOptions)
RegisterStandardComposeTemplate registers the standard create flow and lifecycle commands for a Docker Compose template plugin.
func ShellQuote ¶ added in v0.16.5
ShellQuote quotes a value for POSIX shell command construction.
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 ComposeProjectDiscovery ¶ added in v0.17.0
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 ComposeTemplateCreateOptions ¶ added in v0.16.5
type ComposeTemplateCreateOptions struct {
DefaultPath string
DefaultPlugin string
DefaultEnvironment string
DefaultDrupalRootfs string
DrupalContainerRoot string
ConfirmOverwrite bool
ReadyMessage string
Input config.InputFunc
}
ComposeTemplateCreateOptions configures the SDK's standard Docker Compose template create runner.
type ContextJob ¶ added in v0.13.0
type ConvergeRunner ¶ added in v0.16.0
type ConvergeRunner interface {
BindFlags(cmd *cobra.Command)
Run(cmd *cobra.Command, ctx *config.Context) error
}
ConvergeRunner implements plugin-specific component convergence. Run detects and repairs configuration drift for the active context.
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"`
DockerComposeBuild []string `yaml:"docker_compose_build,omitempty"`
DockerComposeInit []string `yaml:"docker_compose_init,omitempty"`
DockerComposeUp []string `yaml:"docker_compose_up,omitempty"`
DockerComposeDown []string `yaml:"docker_compose_down,omitempty"`
DockerComposeRollout []string `yaml:"docker_compose_rollout,omitempty"`
}
type DebugRunner ¶ added in v0.16.0
type DebugRunner interface {
BindFlags(cmd *cobra.Command)
Render(cmd *cobra.Command, ctx *config.Context) (string, error)
}
DebugRunner renders plugin-specific debug diagnostics. Render returns the body content (without panel wrapper) for the plugin's debug section. The SDK wraps the body in a named panel and delegates to included plugins.
type DeployRunner ¶ added in v0.16.0
type DeployRunner interface {
BindFlags(cmd *cobra.Command)
PreDown(cmd *cobra.Command, ctx *config.Context) error
PostUp(cmd *cobra.Command, ctx *config.Context) error
}
DeployRunner implements plugin-specific lifecycle hooks for the deploy flow. PreDown runs before compose down; PostUp runs after compose up.
type DeploySpec ¶ added in v0.16.0
type DeploySpec struct {
Name string `yaml:"name"`
Plugin string `yaml:"plugin,omitempty"`
Description string `yaml:"description,omitempty"`
Default bool `yaml:"default,omitempty"`
}
DeploySpec describes a plugin's deploy capability.
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
CanDeploy bool
CanConverge bool
CanSet bool
CanValidate bool
Includes []string
CreateDefinitions []CreateSpec
DeployDefinitions []DeploySpec
}
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 ProjectDiscoveryFunc ¶ added in v0.17.0
type ProjectDiscoveryFunc func(projectDir string) (*config.ProjectClaim, error)
type RegisteredCreate ¶ added in v0.14.0
type RegisteredCreate struct {
Spec CreateSpec
Command *cobra.Command
}
type RegisteredDeploy ¶ added in v0.16.0
type RegisteredDeploy struct {
Spec DeploySpec
}
RegisteredDeploy holds a registered deploy spec.
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) AddStandardComposeCommands ¶ added in v0.16.5
func (s *SDK) AddStandardComposeCommands(opts StandardComposeCommandOptions)
AddStandardComposeCommands registers standard lifecycle, status, logs, and rollout commands for the receiver 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) ContextFromCommand ¶ added in v0.16.5
ContextFromCommand loads the sitectl context selected by a Cobra command.
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) DeployDefinitions ¶ added in v0.16.0
func (s *SDK) DeployDefinitions() []DeploySpec
DeployDefinitions returns the deploy specs registered with this SDK instance.
func (*SDK) EnsureComposeCreateContext ¶ added in v0.15.0
func (s *SDK) EnsureComposeCreateContext(req ComposeCreateRequest, opts ComposeCreateContextOptions) (*config.Context, error)
func (*SDK) EnsureComposeTemplateCheckout ¶ added in v0.16.5
func (s *SDK) EnsureComposeTemplateCheckout(out io.Writer, req ComposeCreateRequest, ctx *config.Context) (bool, error)
EnsureComposeTemplateCheckout ensures the requested Docker Compose template exists for the target context and returns whether a new checkout was cloned.
func (*SDK) EnsureComposeTemplateCheckoutContext ¶ added in v0.17.4
func (s *SDK) EnsureComposeTemplateCheckoutContext(runCtx context.Context, out io.Writer, req ComposeCreateRequest, ctx *config.Context) (bool, error)
EnsureComposeTemplateCheckoutContext ensures the requested Docker Compose template exists for the target context with cancellation support.
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) GetProjectDetectionCommand ¶ added in v0.17.0
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) RegisterComposeTemplateCreateRunner ¶ added in v0.16.5
func (s *SDK) RegisterComposeTemplateCreateRunner(spec CreateSpec, opts ComposeTemplateCreateOptions)
RegisterComposeTemplateCreateRunner registers the SDK's standard Docker Compose template create runner for the receiver plugin.
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) RegisterConvergeRunner ¶ added in v0.16.0
func (s *SDK) RegisterConvergeRunner(runner ConvergeRunner)
RegisterConvergeRunner registers a converge runner for the plugin. The SDK creates the __converge hidden command that is invoked by sitectl converge.
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) RegisterDebugHandler ¶ added in v0.16.0
func (s *SDK) RegisterDebugHandler(runner DebugRunner)
RegisterDebugHandler registers a debug runner for the plugin. The SDK creates the __debug hidden command, wraps the runner's output in a named panel, and delegates to any included plugins.
func (*SDK) RegisterDeployRunner ¶ added in v0.16.0
func (s *SDK) RegisterDeployRunner(spec DeploySpec, runner DeployRunner)
RegisterDeployRunner registers a deploy runner for the plugin. The SDK creates the __deploy hidden command with pre-down and post-up subcommands that are invoked by sitectl deploy around the compose down/up cycle.
func (*SDK) RegisterJob ¶ added in v0.13.0
func (*SDK) RegisterSetRunner ¶ added in v0.16.0
RegisterSetRunner registers a set runner for the plugin. The SDK creates the __set hidden command that is invoked by sitectl set.
func (*SDK) RegisterStandardComposeTemplate ¶ added in v0.16.5
func (s *SDK) RegisterStandardComposeTemplate(spec CreateSpec, opts StandardComposeTemplateOptions)
RegisterStandardComposeTemplate registers the standard create flow and lifecycle commands for the receiver plugin.
func (*SDK) RegisterValidateRunner ¶ added in v0.16.0
func (s *SDK) RegisterValidateRunner(runner ValidateRunner)
RegisterValidateRunner registers a validate runner for the plugin. The SDK creates the __validate hidden command that is invoked by sitectl validate. The command outputs YAML-encoded []validate.Result that sitectl merges with core validation results before writing the final report.
func (*SDK) ResolveComposeCreateRequest ¶ added in v0.15.0
func (*SDK) RunActiveComposeProjectCommand ¶ added in v0.16.5
RunActiveComposeProjectCommand runs a shell command in the active context's compose project directory.
func (*SDK) RunActiveComposeProjectCommandList ¶ added in v0.16.5
RunActiveComposeProjectCommandList runs shell commands in the active context's compose project directory.
func (*SDK) RunComposeProjectCommand ¶ added in v0.16.5
func (s *SDK) RunComposeProjectCommand(ctx *config.Context, projectDir string, stdout, stderr io.Writer, command string) error
RunComposeProjectCommand runs a shell command in a compose project directory, honoring local and remote sitectl contexts.
func (*SDK) RunComposeProjectCommandContext ¶ added in v0.17.4
func (s *SDK) RunComposeProjectCommandContext(runCtx context.Context, ctx *config.Context, projectDir string, stdout, stderr io.Writer, command string) error
RunComposeProjectCommandContext runs a shell command in a compose project directory with cancellation support.
func (*SDK) RunComposeProjectCommandList ¶ added in v0.16.5
func (s *SDK) RunComposeProjectCommandList(cmd *cobra.Command, ctx *config.Context, commands []string) error
RunComposeProjectCommandList runs a list of shell commands in a compose project's directory, skipping empty command strings.
func (*SDK) SetComposeProjectDiscovery ¶ added in v0.17.0
func (s *SDK) SetComposeProjectDiscovery(spec ComposeProjectDiscovery)
func (*SDK) SetProjectDiscovery ¶ added in v0.17.0
func (s *SDK) SetProjectDiscovery(discovery ProjectDiscoveryFunc)
func (*SDK) SetVersionInfo ¶ added in v0.6.1
SetVersionInfo formats plugin version metadata like the main sitectl binary.
type SetRunner ¶ added in v0.16.0
type SetRunner interface {
BindFlags(cmd *cobra.Command)
Run(cmd *cobra.Command, args []string, ctx *config.Context) error
}
SetRunner implements plugin-specific component state management. Run applies the requested state or disposition to the named component.
type StandardComposeCommandOptions ¶ added in v0.16.5
type StandardComposeCommandOptions struct {
DisplayName string
LogsTail int
BuildCommands []string
InitCommands []string
UpCommands []string
DownCommands []string
RolloutCommands []string
RolloutCommand string
}
StandardComposeCommandOptions configures standard Docker Compose helper commands registered by the SDK.
type StandardComposeTemplateOptions ¶ added in v0.16.5
type StandardComposeTemplateOptions struct {
DefaultPath string
DefaultPlugin string
DefaultEnvironment string
DefaultDrupalRootfs string
DrupalContainerRoot string
ConfirmOverwrite bool
ReadyMessage string
DisplayName string
LogsTail int
Input config.InputFunc
}
StandardComposeTemplateOptions configures the SDK's standard Compose template create runner and lifecycle commands from one application spec.
type ValidateRunner ¶ added in v0.16.0
type ValidateRunner interface {
BindFlags(cmd *cobra.Command)
Run(cmd *cobra.Command, ctx *config.Context) ([]sitevalidate.Result, error)
}
ValidateRunner implements plugin-specific context validation. Run returns a list of validation results for the active context.