mapper

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasSameBackupSchedule

func HasSameBackupSchedule(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSameBackupSchedule returns true if both types describe the same backup schedule.

func HasSameMaintenanceSchedule

func HasSameMaintenanceSchedule(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSameMaintenanceSchedule returns true if both types describe the same maintenance schedule.

func HasSameMajorVersion

func HasSameMajorVersion(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSameMajorVersion returns true if the observed version has the desired major version.

func HasSamePGSettings

func HasSamePGSettings(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSamePGSettings returns true if the pg settings spec are the same as defined in the exoscale payload.

func HasSameSizing

func HasSameSizing(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSameSizing returns true if the observed sizing parameters match the desired spec.

func HasSameTerminationProtection

func HasSameTerminationProtection(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

HasSameTerminationProtection returns true if the termination protection flags are the same.

func IsSameIPFilter

func IsSameIPFilter(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

IsSameIPFilter returns true if both slices have the same unique elements in any order. Returns true if both slices are empty or in case duplicates are found.

func ToMap

func ToMap(raw runtime.RawExtension) (map[string]interface{}, error)

func ToRawExtension

func ToRawExtension(m *map[string]interface{}) (runtime.RawExtension, error)

Types

type BackupSchedule

type BackupSchedule = struct {
	BackupHour   *int64 `json:"backup-hour,omitempty"`
	BackupMinute *int64 `json:"backup-minute,omitempty"`
}

BackupSchedule is a type alias for the embedded struct in opai.CreateDbaasServicePgJSONRequestBody.

type MaintenanceSchedule

type MaintenanceSchedule = struct {
	// Day of week for installing updates
	Dow oapi.CreateDbaasServicePgJSONBodyMaintenanceDow `json:"dow"`

	// Time for installing updates, UTC
	Time string `json:"time"`
}

MaintenanceSchedule is a type alias for the embedded struct in opai.CreateDbaasServicePgJSONRequestBody.

type PostgreSQLMapper

type PostgreSQLMapper struct{}

PostgreSQLMapper is a mapper to convert exoscale's SDK resources to Kubernetes API specs.

func (PostgreSQLMapper) FromSpec

FromSpec places the given spec into the request body.

func (PostgreSQLMapper) IsResourceUpToDate

func (PostgreSQLMapper) IsResourceUpToDate(pgInstance *exoscalev1.PostgreSQL, pgExo *oapi.DbaasServicePg) bool

IsResourceUpToDate returns true if the observed response body matches the desired spec.

func (PostgreSQLMapper) ToConnectionDetails

func (PostgreSQLMapper) ToConnectionDetails(pgExo oapi.DbaasServicePg, ca string) (managed.ConnectionDetails, error)

ToConnectionDetails parses the connection details from the given observation.

func (PostgreSQLMapper) ToStatus

ToStatus fills the status fields from the given response body.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL