Documentation
¶
Index ¶
- type ClusterSpec
- type ClusterSpecPostgres
- type ClusterSpecPostgresDefaults
- type ClusterSpecPostgresDefaultsSize
- type ClusterSpecPostgresLocations
- type ClusterSpecPostgresLocationsList
- type ClusterSpecPostgresLocationsSize
- type ClusterSpecPostgresVersion
- type ClusterStatus
- type DbCluster
- type DbClusterStatus
- type DbClusterTags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterSpec ¶
type ClusterSpec struct {
ExternalAccessEnabled *bool `json:"externalAccessEnabled,omitzero" validate:"default=false"`
Postgres ClusterSpecPostgres `json:"postgres" validate:"required"`
}
type ClusterSpecPostgres ¶
type ClusterSpecPostgres struct {
Version ClusterSpecPostgresVersion `json:"version,omitzero"`
StorageGB float64 `json:"storageGB" validate:"integer,required,min=1,max=10000"`
Defaults *ClusterSpecPostgresDefaults `json:"defaults,omitzero"`
Locations ClusterSpecPostgresLocationsList `json:"locations,omitzero" validate:"min=1,dedupeBy=name"`
}
type ClusterSpecPostgresDefaults ¶
type ClusterSpecPostgresDefaults struct {
Size ClusterSpecPostgresDefaultsSize `json:"size,omitzero" validate:"required"`
Instances float64 `json:"instances" validate:"integer,required,min=1,max=3"`
}
type ClusterSpecPostgresDefaultsSize ¶
type ClusterSpecPostgresDefaultsSize string
const ( ClusterSpecPostgresDefaultsSizeDeveloper2C4G ClusterSpecPostgresDefaultsSize = "developer-2c-4g" ClusterSpecPostgresDefaultsSizeSmall2C8G ClusterSpecPostgresDefaultsSize = "small-2c-8g" ClusterSpecPostgresDefaultsSizeStandard4C16G ClusterSpecPostgresDefaultsSize = "standard-4c-16g" ClusterSpecPostgresDefaultsSizeLarge8C32G ClusterSpecPostgresDefaultsSize = "large-8c-32g" ClusterSpecPostgresDefaultsSizeXlarge16C64G ClusterSpecPostgresDefaultsSize = "xlarge-16c-64g" )
func (ClusterSpecPostgresDefaultsSize) EnumValues ¶
func (ClusterSpecPostgresDefaultsSize) EnumValues() []string
type ClusterSpecPostgresLocations ¶
type ClusterSpecPostgresLocations struct {
Name string `json:"name,omitzero"`
Writable *bool `json:"writable,omitzero"`
Size ClusterSpecPostgresLocationsSize `json:"size,omitzero"`
Instances *float64 `json:"instances,omitzero" validate:"integer,min=1,max=3"`
}
type ClusterSpecPostgresLocationsList ¶
type ClusterSpecPostgresLocationsList []ClusterSpecPostgresLocations
ClusterSpecPostgresLocationsList is the strongly-typed replacement for the dbWritable array custom tag on ClusterSpecPostgres.Locations. The declarative `min=1,uniqueBy=name` modifiers stay on the field tag; this type contributes the irreducible single-writable custom over the collection.
func (ClusterSpecPostgresLocationsList) ValidationRule ¶
func (ClusterSpecPostgresLocationsList) ValidationRule() *validate.Rule
ValidationRule builds Array(<location>) and attaches the single-writable custom.
type ClusterSpecPostgresLocationsSize ¶
type ClusterSpecPostgresLocationsSize string
const ( ClusterSpecPostgresLocationsSizeDeveloper2C4G ClusterSpecPostgresLocationsSize = "developer-2c-4g" ClusterSpecPostgresLocationsSizeSmall2C8G ClusterSpecPostgresLocationsSize = "small-2c-8g" ClusterSpecPostgresLocationsSizeStandard4C16G ClusterSpecPostgresLocationsSize = "standard-4c-16g" ClusterSpecPostgresLocationsSizeLarge8C32G ClusterSpecPostgresLocationsSize = "large-8c-32g" ClusterSpecPostgresLocationsSizeXlarge16C64G ClusterSpecPostgresLocationsSize = "xlarge-16c-64g" )
func (ClusterSpecPostgresLocationsSize) EnumValues ¶
func (ClusterSpecPostgresLocationsSize) EnumValues() []string
type ClusterSpecPostgresVersion ¶
type ClusterSpecPostgresVersion string
const ( ClusterSpecPostgresVersion128 ClusterSpecPostgresVersion = "12.8" ClusterSpecPostgresVersion134 ClusterSpecPostgresVersion = "13.4" )
func (ClusterSpecPostgresVersion) EnumValues ¶
func (ClusterSpecPostgresVersion) EnumValues() []string
EnumValues resolves version → String().Valid('12.8','13.4') (string identity, avoiding the float coercion a `valid=12.8|13.4` tag would suffer).
type ClusterStatus ¶
type ClusterStatus struct {
ParentId string `json:"parentId,omitzero" validate:"uuid"`
ExternalEndpoint string `json:"externalEndpoint,omitzero"`
}
ClusterStatus ports `Joi.object({parentId, externalEndpoint}).unknown(true)`. unknown(true) is a RegisterObjectRules (schema_reflect_datanet.go).
func (ClusterStatus) ValidationRule ¶
func (ClusterStatus) ValidationRule() *validate.Rule
ValidationRule reflects ClusterStatus and layers .unknown(true) — the `Joi.object({parentId, externalEndpoint}).unknown(true)` of dbcluster.ts (formerly RegisterObjectRules(ClusterStatus{}, {Unknown: true})).
type DbCluster ¶
type DbCluster struct {
Id string `json:"id,omitzero" validate:"uuid,readOnly"`
Name base.Name `json:"name,omitzero"`
Kind base.Kind `json:"kind,omitzero"`
Version *float64 `json:"version,omitzero" validate:"positive,integer,readOnly"`
Description string `json:"description,omitzero" validate:"trim,max=250,allow="`
Tags DbClusterTags `json:"tags,omitzero" validate:"default={}"`
Created string `json:"created,omitzero" validate:"date,readOnly"`
LastModified string `json:"lastModified,omitzero" validate:"date,readOnly"`
Links base.Links `json:"links,omitzero" validate:"readOnly"`
Spec *ClusterSpec `json:"spec,omitzero"`
Status *ClusterStatus `json:"status,omitzero"`
Alias string `json:"alias,omitzero"`
}
func (DbCluster) ValidationRule ¶
ValidationRule reflects DbCluster. This is the schema the "dbcluster" kind validates against (Base.keys({spec, status, alias})).
type DbClusterStatus ¶
type DbClusterStatus struct {
Data *ClusterStatus `json:"data,omitzero"`
LastModified string `json:"lastModified,omitzero" validate:"date"`
Version *float64 `json:"version,omitzero" validate:"positive,integer"`
}
DbClusterStatus ports dbcluster.ts:86-92 — lastModified is a Joi.date() and version is number().positive().integer(); both rules were dropped in the port.
type DbClusterTags ¶
DbClusterTags aliases base.Tags for the reflection base-type registry.