Documentation
¶
Index ¶
- type APIEndpoint
- type Capability
- type CapablePlugin
- type ConfigurablePlugin
- type CredentialField
- type DNSPlugin
- type DNSRecord
- type DNSRecordCreate
- type DNSRecordUpdate
- type DNSZone
- type DashboardExtension
- type DeploymentPlugin
- type DeploymentResult
- type DeploymentStatus
- type ExternalPlugin
- func (p *ExternalPlugin) ConfigureDeployment(name string, config map[string]interface{}) error
- func (p *ExternalPlugin) CreateDeployment(name string, config map[string]interface{}) (*DeploymentResult, error)
- func (p *ExternalPlugin) GetCapabilities() []Capability
- func (p *ExternalPlugin) GetDeploymentStatus(name string) (*DeploymentStatus, error)
- func (p *ExternalPlugin) GetDockerCompose(config map[string]interface{}) (string, error)
- func (p *ExternalPlugin) GetNginxConfig(config map[string]interface{}) (string, error)
- func (p *ExternalPlugin) GetWidgetData(deploymentName string) (interface{}, error)
- func (p *ExternalPlugin) Info() PluginInfo
- func (p *ExternalPlugin) Initialize(config map[string]interface{}) error
- func (p *ExternalPlugin) RegisterRoutes(router *gin.RouterGroup) error
- func (p *ExternalPlugin) RunHook(hookName string, env map[string]string) error
- func (p *ExternalPlugin) Start() error
- func (p *ExternalPlugin) Stop() error
- type LifecyclePlugin
- type Plugin
- type PluginInfo
- type PluginType
- type Registry
- func (r *Registry) Get(name string) (Plugin, bool)
- func (r *Registry) List() []PluginInfo
- func (r *Registry) LoadFromDisk() error
- func (r *Registry) Plugins() []Plugin
- func (r *Registry) Register(plugin Plugin) error
- func (r *Registry) StartAll() error
- func (r *Registry) StopAll() error
- func (r *Registry) Unregister(name string) error
- type ResourceRequirements
- type RoutablePlugin
- type UIExtension
- type WidgetAction
- type WidgetConfig
- type WidgetPlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIEndpoint ¶
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 CapablePlugin ¶
type CapablePlugin interface {
GetCapabilities() []Capability
}
CapablePlugin declares the capabilities it provides.
type ConfigurablePlugin ¶
ConfigurablePlugin accepts runtime configuration at startup.
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 DNSRecordCreate ¶ added in v0.1.5
type DNSRecordUpdate ¶ added in v0.1.5
type DashboardExtension ¶
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)
}
DeploymentPlugin creates and manages deployments from the plugin.
type DeploymentResult ¶
type DeploymentStatus ¶
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 LifecyclePlugin ¶
LifecyclePlugin manages long-running state and is started and stopped with the agent.
type Plugin ¶
type Plugin interface {
Info() PluginInfo
}
Plugin is the core interface every plugin implements: its identity and metadata. Everything beyond identity is opt-in through the capability interfaces below, so a plugin implements only what it needs. A firewall, for example, has no services to start or stop, so it does not implement LifecyclePlugin.
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"`
UIExtensions []UIExtension `json:"ui_extensions,omitempty" yaml:"ui_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 (*Registry) List ¶
func (r *Registry) List() []PluginInfo
func (*Registry) LoadFromDisk ¶
func (*Registry) Plugins ¶
Plugins returns every registered plugin so the host can wire routes or inspect capabilities through the optional interfaces.
func (*Registry) Unregister ¶
type ResourceRequirements ¶
type RoutablePlugin ¶
type RoutablePlugin interface {
RegisterRoutes(router *gin.RouterGroup) error
}
RoutablePlugin serves its own HTTP endpoints; the host gives it the route group to mount on.
type UIExtension ¶
type UIExtension struct {
Slot string `json:"slot" yaml:"slot"`
Kind string `json:"kind" yaml:"kind"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
}
UIExtension declares a plugin's contribution to a named UI slot, rendered by a native component of the given Kind and fed from the plugin's own API Endpoint.
type WidgetAction ¶
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"`
}
type WidgetPlugin ¶
WidgetPlugin contributes dashboard widget data for a deployment.