Documentation
¶
Index ¶
- func CloneTemplateRepo(opts GitTemplateOptions) error
- func ConfigureTemplateRemotes(opts GitTemplateOptions) error
- func ContextPluginSupports(contextPlugin, requestedPlugin string) bool
- type CommandExecOptions
- type Config
- 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 SDK
- func (s *SDK) AddCommand(cmd *cobra.Command)
- 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) 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) GetDockerClient() (*docker.DockerClient, error)
- func (s *SDK) GetFileAccessor() (*FileAccessor, error)
- func (s *SDK) GetMetadataCommand() *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) PromptAndSaveLocalContext(opts config.LocalContextCreateOptions) (*config.Context, error)
- func (s *SDK) RegisterContextValidator(validator validate.Validator)
- 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 CommandExecOptions ¶ added in v0.11.0
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
}
func DiscoverInstalled ¶ added in v0.10.0
func DiscoverInstalled() []InstalledPlugin
func DiscoverInstalledFromPath ¶ added in v0.10.0
func DiscoverInstalledFromPath(pathEnv string) []InstalledPlugin
func FindInstalled ¶ added in v0.11.0
func FindInstalled(name string) (InstalledPlugin, bool)
func ParsePluginInfoOutput ¶ added in v0.10.0
func ParsePluginInfoOutput(output string) InstalledPlugin
type Metadata ¶
type Metadata struct {
Name string
Version string
Description string
Author string
TemplateRepo string
Includes []string
}
Metadata contains information about a plugin
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) 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) 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) 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) GetMetadataCommand ¶
GetMetadataCommand returns a command that displays plugin metadata
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) 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) RegisterContextValidator ¶ added in v0.9.0
func (*SDK) SetVersionInfo ¶ added in v0.6.1
SetVersionInfo formats plugin version metadata like the main sitectl binary.