-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract psapi into github.com/planetscale/planetscale-go
This PR extracts the PlanetScale Go API client from this repo into github.com/planetscale/planetscale-go. The repo is already ready for use, so we also migrate with this PR by removing `psapi` and using this new package. This is needed for several reasons: * Other Go services at PlanetScale also need to interact with the public API, hence these services should be able to use the Go API client without having to rely on the CLI. The first service to use this new API will be https://github.com/planetscale/sql-proxy, which is required to fetch databases and * We eventually want to release an Open-Source Go library for the developer community. People will not only use our CLI; they will also create various kinds of services, and having an official Go client will make it simpler for them to create new tools. Almost all "cloud" specific tools are written in Go. In addition to this, automation tools like `Terraform` will also need a Go client in the future if we want to add Terraform support for PlanetScale DB. A couple of notes that will change our workflow: * Because the Go package (planetscale-go) is still private, locally you'll have to configure Go. By default, Go will try to access the default Go module proxy (https:/proxy.golang.org). Because the package is private, it'll throw an error (this will only happen if you re-download the package). To fix the error, you need to configure Go, so it doesn't contact the proxy for our private package. Luckily executing a single command can do it: ``` go env -w GOPRIVATE="github.com/planetscale/*" ``` * There is no versioning yet for the `planetscale-go` package. Because we're going to change/break things until everything is fleshed out, you'll see that the version in `go.mod` is something like: `v0.0.0-20210109112707-8edffde9c156`. * If you want to add a new endpoint or new functionality, you'll have to add it to `planetscale-go`. To use them in the CLI, you can download and vendor the latest release with: ``` go get github.com/planetscale/planetscale-go go mod vendor ```
- Loading branch information
Showing
14 changed files
with
438 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
psapi/databases.go → ...m/planetscale/planetscale-go/databases.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.