Documentation
¶
Overview ¶
Package internal — Hover typed IaC gRPC server.
hoverIaCServer wraps *HoverProvider and satisfies the pb.IaCProvider*Server interface set required by sdk.ServeIaCPlugin. The shape mirrors workflow-plugin-digitalocean/internal/iacserver.go; only the provider- specific dial surface differs.
Hard invariants:
- NO structpb.Struct on the wire; config / outputs cross as JSON bytes.
- ComputePlanVersion "v2" (Apply is removed; FinalizeApply returns empty since Hover has no deferred operations).
- sdk.ServeIaCPlugin auto-registers every typed pb.IaCProvider*Server interface this struct satisfies (see internal/serve.go). hoverIaCServer embeds pb.Unimplemented*Server for the full surface (Required + Finalizer + DriftDetector + Enumerator + Validator + DriftConfigDetector + CredentialRevoker + MigrationRepairer + ResourceDriver + PluginService), so every service registers — but Hover only implements method bodies for Required + Finalizer + DriftDetector. The unimplemented services respond with a typed "Unimplemented" gRPC status rather than "service not registered", which is the right shape for cross-plugin uniformity but means clients must check capabilities before invoking optional methods.
Package internal implements the Hover IaC provider. Hover has no official API; this plugin uses the browser-side session flow (see internal/hover/client.go).
Package internal — Hover plugin entry point.
Index ¶
- Variables
- func NewIaCServer() *hoverIaCServer
- func Serve()
- type HoverProvider
- func (p *HoverProvider) BootstrapStateBackend(_ context.Context, _ map[string]any) (*interfaces.BootstrapResult, error)
- func (p *HoverProvider) Capabilities() []interfaces.IaCCapabilityDeclaration
- func (p *HoverProvider) Close() error
- func (p *HoverProvider) Destroy(ctx context.Context, resources []interfaces.ResourceRef) (*interfaces.DestroyResult, error)
- func (p *HoverProvider) DetectDrift(ctx context.Context, resources []interfaces.ResourceRef) ([]interfaces.DriftResult, error)
- func (p *HoverProvider) Import(ctx context.Context, cloudID string, resourceType string) (*interfaces.ResourceState, error)
- func (p *HoverProvider) Initialize(ctx context.Context, config map[string]any) error
- func (p *HoverProvider) Name() string
- func (p *HoverProvider) Plan(ctx context.Context, desired []interfaces.ResourceSpec, ...) (*interfaces.IaCPlan, error)
- func (p *HoverProvider) ResolveSizing(_ string, _ interfaces.Size, _ *interfaces.ResourceHints) (*interfaces.ProviderSizing, error)
- func (p *HoverProvider) ResourceDriver(resourceType string) (interfaces.ResourceDriver, error)
- func (p *HoverProvider) Status(ctx context.Context, resources []interfaces.ResourceRef) ([]interfaces.ResourceStatus, error)
- func (p *HoverProvider) SupportedCanonicalKeys() []string
- func (p *HoverProvider) Version() string
Constants ¶
This section is empty.
Variables ¶
var Version = "0.0.0"
Version is set at build time via -ldflags.
Functions ¶
func NewIaCServer ¶
func NewIaCServer() *hoverIaCServer
NewIaCServer is the package entrypoint for cmd/main.go.
Types ¶
type HoverProvider ¶
type HoverProvider struct {
// contains filtered or unexported fields
}
HoverProvider implements interfaces.IaCProvider for Hover. Supports two resource types:
- infra.dns — DNS records within Hover's nameservers.
- infra.dns_delegation — registrar-level nameserver delegation.
func NewHoverProvider ¶
func NewHoverProvider() *HoverProvider
NewHoverProvider creates an uninitialised HoverProvider.
func (*HoverProvider) BootstrapStateBackend ¶
func (p *HoverProvider) BootstrapStateBackend(_ context.Context, _ map[string]any) (*interfaces.BootstrapResult, error)
BootstrapStateBackend is a stub: Hover does not manage state backends.
func (*HoverProvider) Capabilities ¶
func (p *HoverProvider) Capabilities() []interfaces.IaCCapabilityDeclaration
Capabilities returns the resource types Hover supports.
func (*HoverProvider) Close ¶
func (p *HoverProvider) Close() error
Close is a no-op; the HTTP client has no persistent connections to tear down.
func (*HoverProvider) Destroy ¶
func (p *HoverProvider) Destroy(ctx context.Context, resources []interfaces.ResourceRef) (*interfaces.DestroyResult, error)
Destroy invokes the per-resource driver Delete for each ref. For infra.dns this is a no-op: Hover exposes no API to delete a DNS zone (only individual records). The resource is marked "destroyed" in IaC state because workflow has nothing further to reconcile, but the upstream records remain in Hover. Operators who want to drop all records must do so manually via the Hover control panel.
func (*HoverProvider) DetectDrift ¶
func (p *HoverProvider) DetectDrift(ctx context.Context, resources []interfaces.ResourceRef) ([]interfaces.DriftResult, error)
DetectDrift checks for ghost resources (state has entry, cloud says 404).
func (*HoverProvider) Import ¶
func (p *HoverProvider) Import(ctx context.Context, cloudID string, resourceType string) (*interfaces.ResourceState, error)
Import reads an existing Hover-managed resource and returns IaC adoption state. cloudID is the domain name for both infra.dns and infra.dns_delegation.
func (*HoverProvider) Initialize ¶
Initialize parses provider config and constructs a lazy Hover client. Required keys:
username — Hover account username / email password — Hover account password
Optional keys:
totp_secret — Base32-encoded TOTP seed (required if the account has MFA
enabled; safe to omit when MFA is off)
func (*HoverProvider) Name ¶
func (p *HoverProvider) Name() string
func (*HoverProvider) Plan ¶
func (p *HoverProvider) Plan(ctx context.Context, desired []interfaces.ResourceSpec, current []interfaces.ResourceState) (*interfaces.IaCPlan, error)
Plan delegates to platform.ComputePlan which dispatches driver.Diff per-resource.
func (*HoverProvider) ResolveSizing ¶
func (p *HoverProvider) ResolveSizing(_ string, _ interfaces.Size, _ *interfaces.ResourceHints) (*interfaces.ProviderSizing, error)
ResolveSizing is a stub: Hover has no compute sizing.
func (*HoverProvider) ResourceDriver ¶
func (p *HoverProvider) ResourceDriver(resourceType string) (interfaces.ResourceDriver, error)
ResourceDriver returns the driver for the given resource type.
func (*HoverProvider) Status ¶
func (p *HoverProvider) Status(ctx context.Context, resources []interfaces.ResourceRef) ([]interfaces.ResourceStatus, error)
Status returns the live status of the given refs.
func (*HoverProvider) SupportedCanonicalKeys ¶
func (p *HoverProvider) SupportedCanonicalKeys() []string
SupportedCanonicalKeys returns the full canonical key set; Hover maps only the dns-relevant subset but there's no harm reporting all to the validator.
func (*HoverProvider) Version ¶
func (p *HoverProvider) Version() string