Help us shape the future of Go! Take the 2026 Go Developer Survey

plugins

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 10 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"
	CapDNSZoneManagement   Capability = "dns_zone_management"
	CapDNSRecordManagement Capability = "dns_record_management"
	CapDNSAutoConfig       Capability = "dns_auto_config"
)

type CredentialField added in v0.1.5

type CredentialField struct {
	Name        string `json:"name" yaml:"name"`
	Label       string `json:"label" yaml:"label"`
	Type        string `json:"type" yaml:"type"`
	Required    bool   `json:"required" yaml:"required"`
	Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty"`
	HelpText    string `json:"help_text,omitempty" yaml:"help_text,omitempty"`
}

type DNSPlugin added in v0.1.5

type DNSPlugin interface {
	Plugin
	ProviderName() string
	RequiredCredentials() []CredentialField
	SetCredentials(credentials map[string]string) error
	ValidateCredentials() error
	ListZones(ctx context.Context) ([]DNSZone, error)
	GetZone(ctx context.Context, zoneID string) (*DNSZone, error)
	ListRecords(ctx context.Context, zoneID string) ([]DNSRecord, error)
	CreateRecord(ctx context.Context, zoneID string, record DNSRecordCreate) (*DNSRecord, error)
	UpdateRecord(ctx context.Context, zoneID, recordID string, record DNSRecordUpdate) (*DNSRecord, error)
	DeleteRecord(ctx context.Context, zoneID, recordID string) error
}

type DNSRecord added in v0.1.5

type DNSRecord struct {
	ID       string `json:"id"`
	ZoneID   string `json:"zone_id"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"`
	Priority *int   `json:"priority,omitempty"`
	Proxied  *bool  `json:"proxied,omitempty"`
}

type DNSRecordCreate added in v0.1.5

type DNSRecordCreate struct {
	Type     string `json:"type" binding:"required"`
	Name     string `json:"name" binding:"required"`
	Content  string `json:"content" binding:"required"`
	TTL      int    `json:"ttl"`
	Priority *int   `json:"priority,omitempty"`
	Proxied  *bool  `json:"proxied,omitempty"`
}

type DNSRecordUpdate added in v0.1.5

type DNSRecordUpdate struct {
	Content  *string `json:"content,omitempty"`
	TTL      *int    `json:"ttl,omitempty"`
	Priority *int    `json:"priority,omitempty"`
	Proxied  *bool   `json:"proxied,omitempty"`
}

type DNSZone added in v0.1.5

type DNSZone struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Status      string   `json:"status"`
	NameServers []string `json:"name_servers,omitempty"`
	RecordCount int      `json:"record_count"`
}

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"
	TypeDNS         PluginType = "dns"
)

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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