Versions in this module Expand all Collapse all v1 v1.3.1 Mar 14, 2026 v1.3.0 Mar 12, 2026 Changes in this version + func ValidateTransition(from, to Status) error + type Capacity struct + MaxCPUMillis int + MaxInstances int + MaxMemoryMB int + type CreateRequest struct + Capacity *Capacity + Labels map[string]string + Location *Location + Metadata map[string]string + Name string + ProviderName string + Region string + Zone string + type Datacenter struct + Capacity Capacity + Labels map[string]string + LastCheckedAt *time.Time + Location Location + Metadata map[string]string + Name string + ProviderName string + Region string + Slug string + Status Status + TenantID string + Zone string + func NewDatacenter() *Datacenter + type ListOptions struct + Cursor string + Label string + Limit int + Provider string + Region string + Status string + type ListResult struct + Items []*Datacenter + NextCursor string + Total int + type Location struct + City string + Country string + Latitude float64 + Longitude float64 + type Service interface + Create func(ctx context.Context, req CreateRequest) (*Datacenter, error) + Delete func(ctx context.Context, datacenterID id.ID) error + Get func(ctx context.Context, datacenterID id.ID) (*Datacenter, error) + GetBySlug func(ctx context.Context, slug string) (*Datacenter, error) + List func(ctx context.Context, opts ListOptions) (*ListResult, error) + ResolveProvider func(ctx context.Context, datacenterID id.ID) (string, error) + SetStatus func(ctx context.Context, datacenterID id.ID, status Status) error + Update func(ctx context.Context, datacenterID id.ID, req UpdateRequest) (*Datacenter, error) + func NewService(store Store, providers *provider.Registry, events event.Bus, ...) Service + type Status string + const StatusActive + const StatusDraining + const StatusMaintenance + const StatusOffline + type Store interface + CountDatacentersByTenant func(ctx context.Context, tenantID string) (int, error) + CountInstancesByDatacenter func(ctx context.Context, tenantID string, datacenterID id.ID) (int, error) + DeleteDatacenter func(ctx context.Context, tenantID string, datacenterID id.ID) error + GetDatacenterByID func(ctx context.Context, tenantID string, datacenterID id.ID) (*Datacenter, error) + GetDatacenterBySlug func(ctx context.Context, tenantID string, slug string) (*Datacenter, error) + InsertDatacenter func(ctx context.Context, dc *Datacenter) error + ListDatacenters func(ctx context.Context, tenantID string, opts ListOptions) (*ListResult, error) + UpdateDatacenter func(ctx context.Context, dc *Datacenter) error + type UpdateRequest struct + Capacity *Capacity + Labels map[string]string + Location *Location + Metadata map[string]string + Name *string + Zone *string