Skip to content

Commit

Permalink
Addressed more PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ezilber-akamai committed Nov 26, 2024
1 parent 41d189a commit 80c5e94
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 30 deletions.
34 changes: 25 additions & 9 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type (
DatabaseDayOfWeek int
DatabaseMaintenanceFrequency string
DatabaseStatus string
DatabasePlatform string
DatabaseMemberType string
)

const (
Expand Down Expand Up @@ -50,17 +52,31 @@ const (
DatabaseStatusBackingUp DatabaseStatus = "backing_up"
)

const (
DatabasePlatformRDBMSLegacy DatabasePlatform = "rdbms-legacy"
DatabasePlatformRDBMSDefault DatabasePlatform = "rdbms-default"
)

const (
DatabaseMemberTypePrimary DatabaseMemberType = "primary"
DatabaseMemberTypeFailover DatabaseMemberType = "failover"
)

// A Database is a instance of Linode Managed Databases
type Database struct {
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Hosts DatabaseHost `json:"hosts"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
ClusterSize int `json:"cluster_size"`
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Hosts DatabaseHost `json:"hosts"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
ClusterSize int `json:"cluster_size"`
Platform DatabasePlatform `json:"platform"`

// Members has dynamic keys so it is a map
Members map[string]DatabaseMemberType `json:"members"`

ReplicationType string `json:"replication_type,omitempty"` // This field doesn't exist in DBaaS v2
SSLConnection bool `json:"ssl_connection"` // This field doesn't exist in DBaaS v2
Expand Down
22 changes: 13 additions & 9 deletions mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ const (

// A MySQLDatabase is an instance of Linode MySQL Managed Databases
type MySQLDatabase struct {
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Hosts DatabaseHost `json:"hosts"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
ClusterSize int `json:"cluster_size"`
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Hosts DatabaseHost `json:"hosts"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
ClusterSize int `json:"cluster_size"`
Platform DatabasePlatform `json:"platform"`

// Members has dynamic keys so it is a map
Members map[string]DatabaseMemberType `json:"members"`

ReplicationType string `json:"replication_type,omitempty"` // This field doesn't exist in DBaaS v2

Expand Down
28 changes: 16 additions & 12 deletions postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ const (

// A PostgresDatabase is an instance of Linode Postgres Managed Databases
type PostgresDatabase struct {
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
Encrypted bool `json:"encrypted"`
AllowList []string `json:"allow_list"`
Port int `json:"port"`
SSLConnection bool `json:"ssl_connection"`
ClusterSize int `json:"cluster_size"`
ID int `json:"id"`
Status DatabaseStatus `json:"status"`
Label string `json:"label"`
Region string `json:"region"`
Type string `json:"type"`
Engine string `json:"engine"`
Version string `json:"version"`
Encrypted bool `json:"encrypted"`
AllowList []string `json:"allow_list"`
Port int `json:"port"`
SSLConnection bool `json:"ssl_connection"`
ClusterSize int `json:"cluster_size"`
Platform DatabasePlatform `json:"platform"`

// Members has dynamic keys so it is a map
Members map[string]DatabaseMemberType `json:"members"`

ReplicationCommitType PostgresCommitType `json:"replication_commit_type,omitempty"` // This field doesn't exist in DBaaS v2
ReplicationType PostgresReplicationType `json:"replication_type,omitempty"` // This field doesn't exist in DBaaS v2
Expand Down

0 comments on commit 80c5e94

Please sign in to comment.