plugins

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIEndpoint

type APIEndpoint struct {
	Path    string `json:"path" yaml:"path"`
	Method  string `json:"method" yaml:"method"`
	Handler string `json:"handler" yaml:"handler"`
}

type Capability

type Capability string
const (
	CapAutoSSL    Capability = "auto_ssl"
	CapAutoBackup Capability = "auto_backup"
	CapAutoUpdate Capability = "auto_update"
	CapMonitoring Capability = "monitoring"
	CapScaling    Capability = "scaling"
)

type DashboardExtension

type DashboardExtension struct {
	Location  string `json:"location" yaml:"location"`
	Component string `json:"component" yaml:"component"`
}

type DeploymentPlugin

type DeploymentPlugin interface {
	Plugin
	CreateDeployment(name string, config map[string]interface{}) (*DeploymentResult, error)
	ConfigureDeployment(name string, config map[string]interface{}) error
	GetDeploymentStatus(name string) (*DeploymentStatus, error)
	GetDockerCompose(config map[string]interface{}) (string, error)
	GetNginxConfig(config map[string]interface{}) (string, error)
}

type DeploymentResult

type DeploymentResult struct {
	Name        string            `json:"name"`
	Path        string            `json:"path"`
	Containers  []string          `json:"containers"`
	URLs        []string          `json:"urls"`
	Credentials map[string]string `json:"credentials,omitempty"`
}

type DeploymentStatus

type DeploymentStatus struct {
	Name    string                 `json:"name"`
	Status  string                 `json:"status"`
	Health  string                 `json:"health"`
	Metrics map[string]interface{} `json:"metrics"`
}

type ExternalPlugin

type ExternalPlugin struct {
	// contains filtered or unexported fields
}

func (*ExternalPlugin) ConfigureDeployment

func (p *ExternalPlugin) ConfigureDeployment(name string, config map[string]interface{}) error

func (*ExternalPlugin) CreateDeployment

func (p *ExternalPlugin) CreateDeployment(name string, config map[string]interface{}) (*DeploymentResult, error)

func (*ExternalPlugin) GetCapabilities

func (p *ExternalPlugin) GetCapabilities() []Capability

func (*ExternalPlugin) GetDeploymentStatus

func (p *ExternalPlugin) GetDeploymentStatus(name string) (*DeploymentStatus, error)

func (*ExternalPlugin) GetDockerCompose

func (p *ExternalPlugin) GetDockerCompose(config map[string]interface{}) (string, error)

func (*ExternalPlugin) GetNginxConfig

func (p *ExternalPlugin) GetNginxConfig(config map[string]interface{}) (string, error)

func (*ExternalPlugin) GetWidgetData

func (p *ExternalPlugin) GetWidgetData(deploymentName string) (interface{}, error)

func (*ExternalPlugin) Info

func (p *ExternalPlugin) Info() PluginInfo

func (*ExternalPlugin) Initialize

func (p *ExternalPlugin) Initialize(config map[string]interface{}) error

func (*ExternalPlugin) RegisterRoutes

func (p *ExternalPlugin) RegisterRoutes(router *gin.RouterGroup) error

func (*ExternalPlugin) RunHook

func (p *ExternalPlugin) RunHook(hookName string, env map[string]string) error

func (*ExternalPlugin) Start

func (p *ExternalPlugin) Start() error

func (*ExternalPlugin) Stop

func (p *ExternalPlugin) Stop() error

type Plugin

type Plugin interface {
	Info() PluginInfo
	Initialize(config map[string]interface{}) error
	Start() error
	Stop() error
	GetCapabilities() []Capability
	RegisterRoutes(router *gin.RouterGroup) error
	GetWidgetData(deploymentName string) (interface{}, error)
}

type PluginInfo

type PluginInfo struct {
	Name                string                 `json:"name" yaml:"name"`
	Version             string                 `json:"version" yaml:"version"`
	DisplayName         string                 `json:"display_name" yaml:"display_name"`
	Description         string                 `json:"description" yaml:"description"`
	Author              string                 `json:"author" yaml:"author"`
	Type                PluginType             `json:"type" yaml:"type"`
	Category            string                 `json:"category" yaml:"category"`
	Enabled             bool                   `json:"enabled" yaml:"enabled"`
	Capabilities        []string               `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
	Widget              *WidgetConfig          `json:"widget,omitempty" yaml:"widget,omitempty"`
	ConfigSchema        map[string]interface{} `json:"config_schema,omitempty" yaml:"config_schema,omitempty"`
	Requires            []string               `json:"requires,omitempty" yaml:"requires,omitempty"`
	Resources           *ResourceRequirements  `json:"resources,omitempty" yaml:"resources,omitempty"`
	DashboardExtensions []DashboardExtension   `json:"dashboard_extensions,omitempty" yaml:"dashboard_extensions,omitempty"`
	APIEndpoints        []APIEndpoint          `json:"api,omitempty" yaml:"api,omitempty"`
	Hooks               map[string]string      `json:"hooks,omitempty" yaml:"hooks,omitempty"`
}

type PluginType

type PluginType string
const (
	TypeDeployment  PluginType = "deployment"
	TypeWidget      PluginType = "widget"
	TypeService     PluginType = "service"
	TypeIntegration PluginType = "integration"
)

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(pluginsDir string) *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Plugin, bool)

func (*Registry) List

func (r *Registry) List() []PluginInfo

func (*Registry) LoadFromDisk

func (r *Registry) LoadFromDisk() error

func (*Registry) Register

func (r *Registry) Register(plugin Plugin) error

func (*Registry) StartAll

func (r *Registry) StartAll() error

func (*Registry) StopAll

func (r *Registry) StopAll() error

func (*Registry) Unregister

func (r *Registry) Unregister(name string) error

type ResourceRequirements

type ResourceRequirements struct {
	MinMemory         string `json:"min_memory" yaml:"min_memory"`
	MinCPU            string `json:"min_cpu" yaml:"min_cpu"`
	RecommendedMemory string `json:"recommended_memory" yaml:"recommended_memory"`
	RecommendedCPU    string `json:"recommended_cpu" yaml:"recommended_cpu"`
}

type WidgetAction

type WidgetAction struct {
	Name  string `json:"name" yaml:"name"`
	Label string `json:"label" yaml:"label"`
	Icon  string `json:"icon" yaml:"icon"`
}

type WidgetConfig

type WidgetConfig struct {
	Enabled         bool           `json:"enabled" yaml:"enabled"`
	Position        string         `json:"position" yaml:"position"`
	Size            string         `json:"size" yaml:"size"`
	RefreshInterval int            `json:"refresh_interval" yaml:"refresh_interval"`
	Actions         []WidgetAction `json:"actions,omitempty" yaml:"actions,omitempty"`
}

Jump to

Keyboard shortcuts

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