Private
Public Access
CI / rust (push) Successful in 3m6s
CI / go (push) Successful in 33s
CI / js (push) Successful in 34s
Standalone clients that resolve a machine unique ID (OS machine ID first, falling back to a generated UUID persisted to disk), detect hostname/IP/ container/orchestrator, and register+re-ping origin.warky.dev's public service-checkin endpoint on a daily interval. Ported from icy2's internal origincheckin package but extended to the full check-in contract and made dependency-light for external reuse. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.5 KiB
Go
36 lines
1.5 KiB
Go
package originclient
|
|
|
|
// Payload is the JSON body posted to Origin's public service-checkin
|
|
// endpoint. Field names and requiredness mirror
|
|
// POST /api/public/service-checkin as documented in
|
|
// origin/doc/service-checkin.md: Type, Version, Name, and UniqueInstallID
|
|
// are required; everything else is optional and, when omitted, does not
|
|
// overwrite existing instance data on Origin's side.
|
|
type Payload struct {
|
|
Type string `json:"type"`
|
|
Version string `json:"version"`
|
|
Name string `json:"name"`
|
|
UniqueInstallID string `json:"unique_install_id"`
|
|
Site string `json:"site,omitempty"`
|
|
Environment string `json:"environment,omitempty"`
|
|
DatabaseType string `json:"database_type,omitempty"`
|
|
DatabaseName string `json:"database_name,omitempty"`
|
|
AppType string `json:"app_type,omitempty"`
|
|
Hostname string `json:"hostname,omitempty"`
|
|
Port int `json:"port,omitempty"`
|
|
BaseURL string `json:"base_url,omitempty"`
|
|
InternalURL string `json:"internal_url,omitempty"`
|
|
ContainerID string `json:"container_id,omitempty"`
|
|
Orchestrator string `json:"orchestrator,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
}
|
|
|
|
// Response is returned by Origin after a successful check-in.
|
|
type Response struct {
|
|
Success bool `json:"success"`
|
|
ServiceInstanceID int64 `json:"service_instance_id"`
|
|
UniqueInstallID string `json:"unique_install_id"`
|
|
Status string `json:"status"`
|
|
PingedAt string `json:"pinged_at"`
|
|
}
|