https://github.com/deis/controller-sdk-go
The Go SDK for the Deis Controller API
https://github.com/deis/controller-sdk-go
client-sdk deis-workflow rest-api unsupported
Last synced: 10 months ago
JSON representation
The Go SDK for the Deis Controller API
- Host: GitHub
- URL: https://github.com/deis/controller-sdk-go
- Owner: deis
- License: mit
- Created: 2016-06-14T18:46:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-28T21:44:48.000Z (over 8 years ago)
- Last Synced: 2025-04-30T15:13:50.066Z (about 1 year ago)
- Topics: client-sdk, deis-workflow, rest-api, unsupported
- Language: Go
- Size: 1.4 MB
- Stars: 2
- Watchers: 8
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
| | Deis Workflow is no longer maintained.
Please [read the announcement](https://deis.com/blog/2017/deis-workflow-final-release/) for more detail. |
|---:|---|
| 09/07/2017 | Deis Workflow [v2.18][] final release before entering maintenance mode |
| 03/01/2018 | End of Workflow maintenance: critical patches no longer merged |
| | [Hephy](https://github.com/teamhephy/workflow) is a fork of Workflow that is actively developed and accepts code contributions. |
# Controller Go SDK
[](https://ci.deis.io/job/Deis/job/controller-sdk-go/job/master/)
[](https://codecov.io/gh/deis/controller-sdk-go)
[](https://goreportcard.com/report/github.com/deis/controller-sdk-go)
[](https://codebeat.co/projects/github-com-deis-controller-sdk-go)
[](https://godoc.org/github.com/deis/controller-sdk-go)
This is the Go SDK for interacting with the [Deis Controller](https://github.com/deis/controller).
### Usage
```go
import deis "github.com/deis/controller-sdk-go"
import "github.com/deis/controller-sdk-go/apps"
```
Construct a deis client to interact with the controller API. Then, get the first 100 apps the user has access to.
```go
// Verify SSL, Controller URL, API Token
client, err := deis.New(true, "deis.test.io", "abc123")
if err != nil {
log.Fatal(err)
}
apps, _, err := apps.List(client, 100)
if err != nil {
log.Fatal(err)
}
```
### Authentication
```go
import deis "github.com/deis/controller-sdk-go"
import "github.com/deis/controller-sdk-go/auth"
```
If you don't already have a token for a user, you can retrieve one with a username and password.
```go
// Create a client with a blank token to pass to login.
client, err := deis.New(true, "deis.test.io", "")
if err != nil {
log.Fatal(err)
}
token, err := auth.Login(client, "user", "password")
if err != nil {
log.Fatal(err)
}
// Set the client to use the retrieved token
client.Token = token
```
For a complete usage guide to the SDK, see [full package documentation](https://godoc.org/github.com/deis/controller-sdk-go).
[v2.18]: https://github.com/deis/workflow/releases/tag/v2.18.0