Skip to content

Commit

Permalink
Merge pull request #13 from birdiecare/add-types
Browse files Browse the repository at this point in the history
feat: Add types
  • Loading branch information
harrywm authored Mar 23, 2023
2 parents 547dae9 + cc488f7 commit 7266e60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion handler/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type db struct {
DBId string
Type string
Endpoints []string
IAM bool
}
Expand Down Expand Up @@ -47,6 +48,7 @@ func getEndpoints() {
for _, i := range cluster_list.DBClusters {
endpoints = append(endpoints, db{
DBId: *i.DBClusterIdentifier,
Type: "Cluster",
Endpoints: []string{*i.ReaderEndpoint, *i.Endpoint},
IAM: *i.IAMDatabaseAuthenticationEnabled,
})
Expand All @@ -57,6 +59,7 @@ func getEndpoints() {
if i.DBClusterIdentifier == nil {
endpoints = append(endpoints, db{
DBId: *i.DBInstanceIdentifier,
Type: "Instance",
Endpoints: []string{*i.Endpoint.Address},
IAM: *&i.IAMDatabaseAuthenticationEnabled,
})
Expand Down Expand Up @@ -102,8 +105,9 @@ func FuzzEndpoints(iam bool) string {
if i == -1 {
return ""
}
return fmt.Sprintf("Cluster: %s\nEndpoints: %+q\nIAM Auth: %t",
return fmt.Sprintf("DB: %s\nType: %s\nEndpoints: %+q\nIAM Auth: %t",
endpoints[i].DBId,
endpoints[i].Type,
endpoints[i].Endpoints,
endpoints[i].IAM)
}))
Expand Down

0 comments on commit 7266e60

Please sign in to comment.