Documentation
¶
Index ¶
- Constants
- func Provide(i *do.Injector)
- type Cohort
- type CohortType
- type Host
- type HostState
- type HostStatus
- type HostStatusStore
- func (s *HostStatusStore) Create(item *StoredHostStatus) storage.PutOp[*StoredHostStatus]
- func (s *HostStatusStore) DeleteByKey(hostID string) storage.DeleteOp
- func (s *HostStatusStore) GetAll() storage.GetMultipleOp[*StoredHostStatus]
- func (s *HostStatusStore) GetByKey(hostID string) storage.GetOp[*StoredHostStatus]
- func (s *HostStatusStore) GetByKeys(hostIDs ...string) storage.GetMultipleOp[*StoredHostStatus]
- func (s *HostStatusStore) Key(hostID string) string
- func (s *HostStatusStore) Prefix() string
- func (s *HostStatusStore) Put(item *StoredHostStatus) storage.PutOp[*StoredHostStatus]
- type HostStore
- func (s *HostStore) Create(item *StoredHost) storage.PutOp[*StoredHost]
- func (s *HostStore) DeleteByKey(hostID string) storage.DeleteOp
- func (s *HostStore) GetAll() storage.GetMultipleOp[*StoredHost]
- func (s *HostStore) GetByKey(hostID string) storage.GetOp[*StoredHost]
- func (s *HostStore) GetByKeys(hostIDs ...string) storage.GetMultipleOp[*StoredHost]
- func (s *HostStore) Key(hostID string) string
- func (s *HostStore) Prefix() string
- func (s *HostStore) Put(item *StoredHost) storage.PutOp[*StoredHost]
- type Orchestrator
- type PgEdgeVersion
- func (v *PgEdgeVersion) Clone() *PgEdgeVersion
- func (v *PgEdgeVersion) Compare(other *PgEdgeVersion) int
- func (v *PgEdgeVersion) Equals(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) GreaterThan(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) LessThan(other *PgEdgeVersion) bool
- func (v *PgEdgeVersion) String() string
- type Resources
- type Service
- func (s *Service) GetAllHosts(ctx context.Context) ([]*Host, error)
- func (s *Service) GetHost(ctx context.Context, hostID string) (*Host, error)
- func (s *Service) GetHosts(ctx context.Context, hostIDs []string) ([]*Host, error)
- func (s *Service) RemoveHost(ctx context.Context, hostID string) error
- func (s *Service) UpdateHost(ctx context.Context) error
- func (s *Service) UpdateHostStatus(ctx context.Context) error
- type Store
- type StoredCohort
- type StoredHost
- type StoredHostStatus
- type UpdateTicker
- type Version
- func (v *Version) Clone() *Version
- func (v *Version) Compare(other *Version) int
- func (v *Version) Major() (uint64, bool)
- func (v *Version) MarshalText() (data []byte, err error)
- func (v *Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) error
- func (v *Version) UnmarshalText(data []byte) error
Constants ¶
View Source
const UpdateStatusInterval = 15 * time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cohort ¶
type Cohort struct {
Type CohortType
MemberID string
ControlAvailable bool
}
type Host ¶
type Host struct {
ID string
Orchestrator config.Orchestrator
Cohort *Cohort
DataDir string
Hostname string
IPv4Address string
CPUs int
MemBytes uint64
Status *HostStatus
DefaultPgEdgeVersion *PgEdgeVersion
SupportedPgEdgeVersions []*PgEdgeVersion
}
func (*Host) Supports ¶
func (h *Host) Supports(pgEdgeVersion *PgEdgeVersion) bool
type HostStatus ¶
type HostStatusStore ¶
type HostStatusStore struct {
// contains filtered or unexported fields
}
func NewHostStatusStore ¶
func NewHostStatusStore(client *clientv3.Client, root string) *HostStatusStore
func (*HostStatusStore) Create ¶
func (s *HostStatusStore) Create(item *StoredHostStatus) storage.PutOp[*StoredHostStatus]
func (*HostStatusStore) DeleteByKey ¶
func (s *HostStatusStore) DeleteByKey(hostID string) storage.DeleteOp
func (*HostStatusStore) GetAll ¶
func (s *HostStatusStore) GetAll() storage.GetMultipleOp[*StoredHostStatus]
func (*HostStatusStore) GetByKey ¶
func (s *HostStatusStore) GetByKey(hostID string) storage.GetOp[*StoredHostStatus]
func (*HostStatusStore) GetByKeys ¶
func (s *HostStatusStore) GetByKeys(hostIDs ...string) storage.GetMultipleOp[*StoredHostStatus]
func (*HostStatusStore) Key ¶
func (s *HostStatusStore) Key(hostID string) string
func (*HostStatusStore) Prefix ¶
func (s *HostStatusStore) Prefix() string
func (*HostStatusStore) Put ¶
func (s *HostStatusStore) Put(item *StoredHostStatus) storage.PutOp[*StoredHostStatus]
type HostStore ¶
type HostStore struct {
// contains filtered or unexported fields
}
func (*HostStore) Create ¶
func (s *HostStore) Create(item *StoredHost) storage.PutOp[*StoredHost]
func (*HostStore) GetAll ¶
func (s *HostStore) GetAll() storage.GetMultipleOp[*StoredHost]
func (*HostStore) GetByKeys ¶
func (s *HostStore) GetByKeys(hostIDs ...string) storage.GetMultipleOp[*StoredHost]
func (*HostStore) Put ¶
func (s *HostStore) Put(item *StoredHost) storage.PutOp[*StoredHost]
type Orchestrator ¶
type PgEdgeVersion ¶
type PgEdgeVersion struct {
PostgresVersion *Version `json:"postgres_version"`
SpockVersion *Version `json:"spock_version"`
}
func GreatestCommonDefaultVersion ¶
func GreatestCommonDefaultVersion(hosts ...*Host) (*PgEdgeVersion, error)
func MustPgEdgeVersion ¶
func MustPgEdgeVersion(postgresVersion, spockVersion string) *PgEdgeVersion
func NewPgEdgeVersion ¶
func NewPgEdgeVersion(postgresVersion, spockVersion string) (*PgEdgeVersion, error)
func (*PgEdgeVersion) Clone ¶
func (v *PgEdgeVersion) Clone() *PgEdgeVersion
func (*PgEdgeVersion) Compare ¶
func (v *PgEdgeVersion) Compare(other *PgEdgeVersion) int
func (*PgEdgeVersion) Equals ¶
func (v *PgEdgeVersion) Equals(other *PgEdgeVersion) bool
func (*PgEdgeVersion) GreaterThan ¶
func (v *PgEdgeVersion) GreaterThan(other *PgEdgeVersion) bool
func (*PgEdgeVersion) LessThan ¶
func (v *PgEdgeVersion) LessThan(other *PgEdgeVersion) bool
func (*PgEdgeVersion) String ¶
func (v *PgEdgeVersion) String() string
type Resources ¶
func DetectResources ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
type Store ¶
type Store struct {
Host *HostStore
HostStatus *HostStatusStore
// contains filtered or unexported fields
}
type StoredCohort ¶
type StoredCohort struct {
Type CohortType `json:"type"`
MemberID string `json:"member_id"`
ControlAvailable bool `json:"control_available"`
}
type StoredHost ¶
type StoredHost struct {
storage.StoredValue
ID string `json:"id"`
Orchestrator config.Orchestrator `json:"type"`
Cohort *StoredCohort `json:"stored_cohort,omitempty"`
DataDir string `json:"data_dir"`
Hostname string `json:"hostname"`
IPv4Address string `json:"ipv4_address"`
CPUs int `json:"cpus"`
MemBytes uint64 `json:"mem_bytes"`
DefaultPgEdgeVersion *PgEdgeVersion `json:"default_version"`
SupportedPgEdgeVersions []*PgEdgeVersion `json:"supported_versions"`
}
type StoredHostStatus ¶
type StoredHostStatus struct {
storage.StoredValue
HostID string `json:"host_id"`
UpdatedAt time.Time `json:"updated_at"`
State HostState `json:"state"`
Components map[string]common.ComponentStatus `json:"components"`
}
type UpdateTicker ¶
type UpdateTicker struct {
// contains filtered or unexported fields
}
func NewUpdateTicker ¶
func NewUpdateTicker(logger zerolog.Logger, svc *Service) *UpdateTicker
func (*UpdateTicker) Shutdown ¶
func (u *UpdateTicker) Shutdown() error
func (*UpdateTicker) Start ¶
func (u *UpdateTicker) Start(ctx context.Context)
type Version ¶
type Version struct {
Components []uint64 `json:"components"`
}
func ParseVersion ¶
func (*Version) MarshalText ¶
func (*Version) UnmarshalJSON ¶
func (*Version) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.