planetscale 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af931a16331396c2f638e5967a582c429ad9661430b9c995496d93bd076f263c
4
- data.tar.gz: 073b18c4e4c5d98572ca8336e3a09ce4811004d4e1fd7452ebb632b91611a277
3
+ metadata.gz: ef9b82cff71169af3bf857f8fc3e664f2339817f8f553e5f18fb6e5a2881d062
4
+ data.tar.gz: b1fb4a43eacd5ee272ef3db6a72ddd6d75eebc093af3249598e4f389c61030ad
5
5
  SHA512:
6
- metadata.gz: c31fb0e49ac933aed05a567fa6cfa6c4ee562e23a8c1e633684d6ffa53afb78dcd18387ffe0c1bc1c4207f0a5ad563edc1702e4170802415853e4336f8676a94
7
- data.tar.gz: fea4d6879726689d062e0511edcf5faf2baed2e3a0a9ee0e44893ed451c2f69271e42b851f0f26bcdc3e448e90f8f0040bf4f24de89d61a274692b1d24b2c44d
6
+ metadata.gz: 26af151df726b4df8d427b7f0631676c1600ada416f7bbace0b7db5ce3bf6d12477744274f0811b65f006f86185d9cde808f3f8c675ecbdc4af4bdd6c5b1fb49
7
+ data.tar.gz: 8fb1b2bd0f74f6b4a812d78e135c48f234350f1ba602cd21c9d40f46dac6a4d7ba072aeca4fd69f326652a478cf42a948869f7e2b041f01bf73e311818978e6a
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: github.com/planetscale/planetscale-go/planetscale
3
- version: v0.36.0
3
+ version: v0.38.0
4
4
  type: go
5
5
  summary:
6
6
  homepage: https://godoc.org/github.com/planetscale/planetscale-go/planetscale
data/README.md CHANGED
@@ -82,8 +82,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
82
82
 
83
83
  ## Contributing
84
84
 
85
- Bug reports and pull requests are welcome. This Gem is internal to PlanetScale currently.
85
+ Bug reports and pull requests are welcome.
86
86
 
87
87
  ## License
88
88
 
89
- Currently this Gem is specified under the MIT license, however it has not been made public. Care will be taken before this is done to choose an appropriate license.
89
+ This gem is licensed under the [Apache License Version 2.0](LICENSE).
data/go.mod CHANGED
@@ -7,7 +7,7 @@ require (
7
7
  github.com/golang/protobuf v1.5.2 // indirect
8
8
  github.com/gorilla/mux v1.8.0
9
9
  github.com/mitchellh/go-homedir v1.1.0
10
- github.com/planetscale/planetscale-go v0.36.0
10
+ github.com/planetscale/planetscale-go v0.38.0
11
11
  github.com/planetscale/sql-proxy v0.8.0
12
12
  go.uber.org/zap v1.18.1
13
13
  golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 // indirect
data/go.sum CHANGED
@@ -132,6 +132,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
132
132
  github.com/planetscale/planetscale-go v0.33.0/go.mod h1:99n+tnrvJaaUako3UZNCiC1dTtSPKr81GqAUNibw5pc=
133
133
  github.com/planetscale/planetscale-go v0.36.0 h1:voNRDQ7FgbpuVJKlLZm6QgIByp0UnvyRtGmVZWQlSZY=
134
134
  github.com/planetscale/planetscale-go v0.36.0/go.mod h1:99n+tnrvJaaUako3UZNCiC1dTtSPKr81GqAUNibw5pc=
135
+ github.com/planetscale/planetscale-go v0.38.0 h1:Sn6Xx1/u3xpU3v/mt1CdR38JXcTjej56rUpwuA3A5EY=
136
+ github.com/planetscale/planetscale-go v0.38.0/go.mod h1:99n+tnrvJaaUako3UZNCiC1dTtSPKr81GqAUNibw5pc=
135
137
  github.com/planetscale/sql-proxy v0.8.0 h1:EeWQhocldn0ldrTxPIIIrbHWWqNqHrNFYiSdp4tUY0E=
136
138
  github.com/planetscale/sql-proxy v0.8.0/go.mod h1:vOcL5jRMzaza+8q79hRRhMj3ABpYHy3cgenr2FOhDWU=
137
139
  github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlanetScale
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
Binary file
Binary file
@@ -103,17 +103,9 @@ type databaseBranchesService struct {
103
103
  client *Client
104
104
  }
105
105
 
106
- type DatabaseBranchCredentials struct {
107
- GatewayHost string `json:"mysql_gateway_host"`
108
- GatewayPort int `json:"mysql_gateway_port"`
109
- User string `json:"mysql_gateway_user"`
110
- Password string `json:"mysql_gateway_pass"`
111
- }
112
-
113
106
  // DatabaseBranchStatus represents the status of a PlanetScale database branch.
114
107
  type DatabaseBranchStatus struct {
115
- Ready bool `json:"ready"`
116
- Credentials DatabaseBranchCredentials `json:"credentials"`
108
+ Ready bool `json:"ready"`
117
109
  }
118
110
 
119
111
  var _ DatabaseBranchesService = &databaseBranchesService{}
@@ -22,6 +22,13 @@ type GetOrganizationRequest struct {
22
22
  type OrganizationsService interface {
23
23
  Get(context.Context, *GetOrganizationRequest) (*Organization, error)
24
24
  List(context.Context) ([]*Organization, error)
25
+ ListRegions(context.Context, *ListOrganizationRegionsRequest) ([]*Region, error)
26
+ }
27
+
28
+ // ListRegionsRequest encapsulates the request for getting a list of regions for
29
+ // an organization.
30
+ type ListOrganizationRegionsRequest struct {
31
+ Organization string
25
32
  }
26
33
 
27
34
  // Organization represents a PlanetScale organization.
@@ -76,3 +83,21 @@ func (o *organizationsService) List(ctx context.Context) ([]*Organization, error
76
83
 
77
84
  return orgResponse.Organizations, nil
78
85
  }
86
+
87
+ type listRegionsResponse struct {
88
+ Regions []*Region `json:"data"`
89
+ }
90
+
91
+ func (o *organizationsService) ListRegions(ctx context.Context, listReq *ListOrganizationRegionsRequest) ([]*Region, error) {
92
+ req, err := o.client.newRequest(http.MethodGet, fmt.Sprintf("%s/%s/regions", organizationsAPIPath, listReq.Organization), nil)
93
+ if err != nil {
94
+ return nil, err
95
+ }
96
+
97
+ listResponse := &listRegionsResponse{}
98
+ if err := o.client.do(ctx, req, &listResponse); err != nil {
99
+ return nil, err
100
+ }
101
+
102
+ return listResponse.Regions, nil
103
+ }
data/vendor/modules.txt CHANGED
@@ -14,7 +14,7 @@ github.com/hashicorp/go-cleanhttp
14
14
  github.com/mitchellh/go-homedir
15
15
  # github.com/pkg/errors v0.9.1
16
16
  github.com/pkg/errors
17
- # github.com/planetscale/planetscale-go v0.36.0
17
+ # github.com/planetscale/planetscale-go v0.38.0
18
18
  ## explicit
19
19
  github.com/planetscale/planetscale-go/planetscale
20
20
  # github.com/planetscale/sql-proxy v0.8.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planetscale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Van Wiggeren
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-07-26 00:00:00.000000000 Z
13
+ date: 2021-08-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler