plugin

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

Types

type Config

type Config struct {
	LogLevel string
	Context  string
	APIUrl   string
	Format   string
}

Config holds common plugin configuration

type GitTemplateOptions added in v0.5.0

type GitTemplateOptions struct {
	TemplateRepo       string
	TemplateBranch     string
	ProjectDir         string
	GitRemoteURL       string
	GitRemoteName      string
	TemplateRemoteName string
	Quiet              bool
}

type Metadata

type Metadata struct {
	Name        string
	Version     string
	Description string
	Author      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 NewSDK

func NewSDK(metadata Metadata) *SDK

NewSDK creates a new plugin SDK instance

func (*SDK) AddCommand

func (s *SDK) AddCommand(cmd *cobra.Command)

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 (s *SDK) ContextValidators() []validate.Validator

func (*SDK) ExecInContainer

func (s *SDK) ExecInContainer(ctx context.Context, containerID string, cmd []string) (int, error)

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) Execute

func (s *SDK) Execute()

Execute runs the plugin

func (*SDK) GetComponentManager added in v0.5.0

func (s *SDK) GetComponentManager() (*component.Manager, error)

GetComponentManager creates a component manager bound to the active sitectl context.

func (*SDK) GetContext

func (s *SDK) GetContext() (*config.Context, error)

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) GetMetadataCommand

func (s *SDK) GetMetadataCommand() *cobra.Command

GetMetadataCommand returns a command that displays plugin metadata

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 (s *SDK) RegisterContextValidator(validator validate.Validator)

func (*SDK) SetVersionInfo added in v0.6.1

func (s *SDK) SetVersionInfo(version, commit, date string)

SetVersionInfo formats plugin version metadata like the main sitectl binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL