Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.