Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCEDiscoverer ¶
type GCEDiscoverer struct {
ProjectID string // GCP project ID
Zone string // GCE zone (e.g., "us-central1-a")
SelfName string // this instance's name (excluded from results)
Tag string // instance tag to filter by (e.g., "gluon-ion")
// HTTPClient is an optional HTTP client for making API calls.
// If nil, a default client is used. Useful for testing.
HTTPClient *http.Client
// TokenURL overrides the metadata server URL for fetching access tokens.
// Defaults to the GCE metadata server. Useful for testing.
TokenURL string
// BaseURL overrides the Compute API base URL.
// Defaults to https://compute.googleapis.com. Useful for testing.
BaseURL string
}
GCEDiscoverer discovers peers by listing GCE instances with a specific tag. Uses workload identity for authentication (no explicit credentials).
It calls the GCE compute REST API directly using the metadata server for authentication, avoiding the heavy google.golang.org/api dependency.
type PeerDiscoverer ¶
type PeerDiscoverer interface {
// Discover returns peer addresses (host:port or just host).
Discover(ctx context.Context) ([]string, error)
// Name returns a human-readable discoverer name for logging.
Name() string
}
PeerDiscoverer discovers memberlist peer addresses for Gravity cluster formation.
type StaticDiscoverer ¶
type StaticDiscoverer struct {
Peers []string
}
StaticDiscoverer returns a fixed set of peer addresses. Useful for development, testing, and environments with known IPs.
Click to show internal directories.
Click to hide internal directories.