Categorygithub.com/deis/controller-sdk-go
modulepackage
0.0.0-20180228214447-c9ffa0511183
Repository: https://github.com/deis/controller-sdk-go.git
Documentation: pkg.go.dev

# README

Deis Workflow is no longer maintained.
Please read the announcement for more detail.
09/07/2017Deis Workflow v2.18 final release before entering maintenance mode
03/01/2018End of Workflow maintenance: critical patches no longer merged
Hephy is a fork of Workflow that is actively developed and accepts code contributions.

Controller Go SDK

Build Status codecov Go Report Card codebeat badge GoDoc

This is the Go SDK for interacting with the Deis Controller.

Usage

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.

//                    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

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.

// 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.

# Packages

No description provided by the author
Package apps provides methods for managing deis apps.
Package appsettings provides methods for managing application settings of apps.
Package auth handles user management: creation, deletion, and authentication.
Package builds provides methods for managing app builds.
Package certs manages SSL keys and certificates on the deis platform.
Package config provides methods for managing configuration of apps.
Package domains provides methods for managing an app's domains.
Package hooks implements the controller's builder hooks api.
Package keys provides methods for managing a user's ssh keys.
Package perms provides methods for managing user app and administrative permissions.
No description provided by the author
Package ps provides methods for managing app processes.
Package releases provides methods for managing app releases.
Package tls provides methods for managing tls configuration for apps.
Package users provides methods for viewing users.
Package whitelist provides methods for managing an app's whitelisted IP's.

# Functions

IsErrAPIMismatch returns true if err is an ErrAPIMismatch, false otherwise.
New creates a new client to communicate with the api.

# Constants

APIVersion is the api version compatible with the SDK.

# Variables

DefaultUserAgent is used as the default user agent when making requests.
ErrAPIMismatch occurs when the sdk is using a different api version than the deis.
ErrCancellationFailed is returned when cancelling a user fails.
ErrConflict is returned when the API returns a 409.
ErrDuplicateApp is returned when create an app with an ID that already exists.
ErrDuplicateDomain is returned adding domain that is already in use.
ErrDuplicateKey is returned when adding a key that already exists.
ErrDuplicateUsername is returned when trying to register a user that already exists.
ErrForbidden is returned when the API returns a 403.
ErrInvalidAppName is returned when the user specifies an invalid app name.
ErrInvalidCertificate is returned when a certififate is missing or invalid.
ErrInvalidDomain is returned when a domain is missing or invalid.
ErrInvalidEmail is returned when a user gives an invalid email.
ErrInvalidImage is returned when a image is missing or invalid.
ErrInvalidName is returned when a name is invalid or missing.
ErrInvalidUsername is returned when the user specifies an invalid or missing username.
ErrInvalidVersion is returned when a version is invalid.
ErrLogin is returned when the api cannot login fails with provided username and password.
ErrMethodNotAllowed is thrown when using a unsupposrted method.
ErrMissingID is returned when a ID is missing.
ErrMissingKey is returned when a key is not sent with the request.
ErrMissingPassword is returned when a password is not sent with the request.
ErrPodNotFound is returned when a pod type is not Found.
ErrServerError is returned when the server returns a 500.
ErrTagNotFound is returned when no node can be found that matches the tag.
ErrUnauthorized is given when the API returns a 401.

# Structs

Client oversees the interaction between the deis and controller.
ErrNotFound is returned when the controller throws a 404.
ErrUnprocessable is returned when the controller throws a 422.