providers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []string

All returns all registered provider slugs.

func Register

func Register(p HostingProvider)

Register adds a hosting provider to the global registry. Providers call this in init().

Types

type EnrichedSite

type EnrichedSite struct {
	RemoteSite
	SSHUsername   string `json:"ssh_username"`
	SSHPassword   string `json:"ssh_password"`
	SSHAddress    string `json:"ssh_address"`
	SSHPort       string `json:"ssh_port"`
	HomeDirectory string `json:"home_directory"`
	HomeURL       string `json:"home_url"`
	WPVersion     string `json:"wp_version"`
	MonthlyVisits string `json:"monthly_visits"`
}

EnrichedSite extends RemoteSite with SSH/SFTP credentials and additional metadata.

type HostingProvider

type HostingProvider interface {
	Slug() string
	RequiredCredentials() []string
	FetchRemoteSites(credentials map[string]string) ([]RemoteSite, error)
	EnrichSite(credentials map[string]string, site RemoteSite) (*EnrichedSite, error)
}

HostingProvider is the interface that hosting provider integrations must implement.

func Get

func Get(slug string) (HostingProvider, error)

Get returns a registered hosting provider by slug, or an error if not found.

type RemoteSite

type RemoteSite struct {
	RemoteID    string `json:"remote_id"`
	Name        string `json:"name"`
	Domain      string `json:"domain"`
	Status      string `json:"status"`
	RawData     string `json:"raw_data"`
	Environment string `json:"environment,omitempty"` // "production" or "staging" — used by EnrichSite to pick the right environment
}

RemoteSite represents a site fetched from a hosting provider API.

Jump to

Keyboard shortcuts

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