Commit Graph

82 Commits

Author SHA1 Message Date
Ben Tranter e1575cffe0
Expand documentation for NewClient
Also adds a reference to the godoc for the (now old) NewClient method.
2020-03-16 11:30:42 -04:00
Verónica López e1c78bb450
Merge branch 'master' into rbutler/billing-history 2020-03-04 21:19:51 -05:00
Zach Barahal 77c9b5a7d9 Create a release candidate for mysql auth 2020-03-04 11:56:45 -08:00
Ryan Butler 33604ba0d1
Merge branch 'master' into rbutler/billing-history 2020-02-28 13:22:14 -06:00
Ryan Butler b1cd87eaa4 Add BillingHistory service and List endpoint 2020-02-28 13:09:24 -06:00
Zach Gershman b4f4e5db08 release for v1.31.0 2020-02-28 09:44:27 -08:00
Ben Tranter 40dd0cc93a
Add NewFromToken convenience method to init client (#304)
* Add NewFromToken convenience method to init client

Fixes #296

Adds a new convenience method for creating a new instance of `godo` from
just an API token.

Usage

Right now, it takes quite a few steps to create a `godo` instance:

```go
type TokenSource struct {
	AccessToken string
}

func (t *TokenSource) Token() (*oauth2.Token, error) {
	token := &oauth2.Token{
		AccessToken: t.AccessToken,
	}
	return token, nil
}

func main() {
	tokenSource := &TokenSource{
		AccessToken: pat,
	}

	oauthClient := oauth2.NewClient(context.Background(), tokenSource)
	client := godo.NewClient(oauthClient)
}
```

Now, it takes just a single line:

```go
func main() {
	client := godo.NewFromToken("my-token")
}
```

The intention of this is to make initializing new clients easier. It
also has an additional benefit of not forcing users to have to import
the `golang.org/x/oauth2` dependency just to initialize new `godo`
instances.

* Add NewFromToken convenience method to init client

Fixes #296

Adds a new convenience method for creating a new instance of `godo` from
just an API token.

Usage

Right now, it takes quite a few steps to create a `godo` instance:

```go
type TokenSource struct {
	AccessToken string
}

func (t *TokenSource) Token() (*oauth2.Token, error) {
	token := &oauth2.Token{
		AccessToken: t.AccessToken,
	}
	return token, nil
}

func main() {
	tokenSource := &TokenSource{
		AccessToken: pat,
	}

	oauthClient := oauth2.NewClient(context.Background(), tokenSource)
	client := godo.NewClient(oauthClient)
}
```

Now, it takes just a single line:

```go
func main() {
	client := godo.NewFromToken("my-token")
}
```

The intention of this is to make initializing new clients easier. It
also has an additional benefit of not forcing users to have to import
the `golang.org/x/oauth2` dependency just to initialize new `godo`
instances.

* Remove our own tokenSource type

It turns out you can use an `oauth2.Config` as a token source, so this
removes our own tokenSource type in favour of that one.

Co-authored-by: Zach Gershman <zachgersh@users.noreply.github.com>
2020-02-28 07:58:11 -08:00
Ryan Butler 86ea9fd282 Add invoices - including Get, List, and GetSummary methods 2020-02-11 14:51:29 -06:00
Hilary Holz 723a9729c9 v1.30.0 2020-02-03 18:49:57 -08:00
Zach Gershman bf6f5badf7 prepares release of 1.29.0 2019-12-13 11:37:45 -08:00
Ryan Butler 6c2309df80 Return balance values from Balance.Get 2019-12-11 15:53:37 -06:00
Timo Reimann b64ee9759b Deserialize meta for storage 2019-12-11 00:43:58 +01:00
Andrew Starr-Bochicchio 11b80bfba7 Prepare for release v1.28.0 2019-12-04 14:54:09 -05:00
Ben Tranter 4e8b3d389a
Prepare for release v1.27.0 2019-11-18 14:02:40 -05:00
Mike a6db2440cd Prepare for release v1.26.0 2019-11-13 17:55:49 -08:00
Ben Tranter f416a94349
Prepare for release v1.25.0 2019-11-13 13:07:33 -05:00
Steven Normore 9ccfbd9c44 Add registry resource 2019-11-06 14:25:30 -08:00
Ben Tranter 2b9550b4f5
Prepare for release v1.24.1 2019-11-04 11:34:04 -05:00
Ben Tranter fe034d4f63
Prepare for release v1.24.0 2019-10-30 18:26:10 -04:00
Ben Tranter 7c8203974c
Prepare for release v1.23.1 2019-10-30 11:19:32 -04:00
Mendy Danzinger 09a8846daf remove ResolveReference call 2019-09-30 15:24:05 -04:00
Steven Normore 522b8c2d9c Bump version to v1.22.0 2019-09-24 17:35:43 -04:00
Ben Tranter 9663cced75
Bump godo to 1.21.1 2019-09-19 17:24:50 -04:00
Steven Normore 4a445bbbe0 Update libraryVersion in godo.go for release 1.21.0 2019-09-16 16:04:40 -04:00
Steven Normore 42d1039bff Update libraryVersion to 0.20.0 in godo.go 2019-09-06 13:58:17 -04:00
Sunny Beatteay 898655e38b release 1.19.0 2019-07-19 15:48:23 -04:00
Mike f6d22a78ab Release 1.18.0 2019-07-17 12:12:07 -07:00
Mike 1902d822fd Release 1.17.0 2019-06-21 08:47:28 -07:00
Bouke van der Bijl 3beedeb0ae Prepare v1.16.0 2019-06-04 13:21:13 +02:00
Mike 852f4aa13c Release 1.15.0 (private database connections) 2019-05-20 08:51:56 -07:00
Adam Wolfe Gordon 057f47825f Release version 1.14.0 2019-05-13 15:07:16 -06:00
Cody Baker 780261ee6a godo: new v1.13.0 release 2019-04-19 14:37:48 -04:00
Fatih Arslan e2d66e6688 godo: new v1.12.0 release 2019-04-18 21:33:01 +03:00
Sunny Beatteay 3e8ec3fa38 fix create database pool json fields 2019-04-04 18:02:22 -04:00
Jason Heimann d2698d98f4 Bump version to 1.11.0 + changelog update 2019-04-02 15:26:01 -07:00
Jason Heimann 6760694045 roll out vpc functionality 2019-04-02 15:22:16 -07:00
Sunny Beatteay 4a5db6be78 fix database pool json field and update patch version 2019-03-27 11:19:29 -04:00
Mike 9d8ec7cf1c merged master and fixed conflict 2019-03-20 09:06:59 -07:00
Mike 42f1ae988d update version and changelog for databases 2019-03-20 09:04:31 -07:00
Mike Holly 766d9d3cfb
Merge pull request #215 from mikejholly/dbaas-support
Adds support for Databases
2019-03-19 13:41:42 -07:00
Eddie Zaneski 007e73ff4c Adds support for databases 2019-03-18 15:45:00 -07:00
Manish Regmi d33506f733 bump version to 1.9.0 2019-03-18 13:17:57 -07:00
Cody Baker 19a129a06b
Bump version to 1.8.0 + changelog update (#211)
* bump version to 1.8.0 + update changelog
2019-03-13 15:16:18 -04:00
Ivan Ilichev 236f43e253 Update version to v1.7.5 2019-03-01 16:00:05 -05:00
Mike Chittenden 8337f258c0 allow tagging volumes 2019-02-12 13:55:59 -05:00
Andrew Ayer 0168bd6520 Remove unused non-exported function so we can eliminate a dependency 2019-02-03 12:06:30 -08:00
Antoine Grondin f628842763 k8saas: add support for Kubernetes endpoints 2018-11-12 15:02:26 -08:00
Mike Chittenden 0f1b9ca783 add projects support 2018-10-16 17:29:54 +00:00
Hugo Corbucci b68700bad8 Add support to tagging images 2018-10-01 12:20:47 -04:00
lxfontes 5b02696397 Releasing 1.4.2 2018-08-30 13:37:34 -04:00