Categorygithub.com/drycc/controller-sdk-go
modulepackage
0.0.0-20250324060500-ab2b34a2bc07
Repository: https://github.com/drycc/controller-sdk-go.git
Documentation: pkg.go.dev

# README

Controller Go SDK

Build Status codecov Go Report Card codebeat badge GoDoc

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

Usage

import drycc "github.com/drycc/controller-sdk-go"
import "github.com/drycc/controller-sdk-go/apps"

Construct a drycc 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 := drycc.New(true, "drycc.test.io", "abc123")
if err != nil {
    log.Fatal(err)
}
apps, _, err := apps.List(client, 100)
if err != nil {
    log.Fatal(err)
}

Authentication

import drycc "github.com/drycc/controller-sdk-go"
import "github.com/drycc/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 := drycc.New(true, "drycc.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

Package allowlist provides methods for managing an app's allowlisted IP's.
No description provided by the author
Package apps provides methods for managing drycc 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 drycc platform.
Package config provides methods for managing configuration of apps.
Package domains provides methods for managing an app's domains.
Package ps provides methods for managing app processes.
Package gateways provides methods for managing an app's gateways.
Package hooks implements the controller's builder hooks api.
Package keys provides methods for managing a user's ssh keys.
No description provided by the author
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 ps provides methods for managing app processes.
Package releases provides methods for managing app releases.
Package config provides methods for managing configuration of apps.
Package routes provides methods for managing an app's routes.
Package services provides methods for managing an app's services.
Package tls provides methods for managing tls configuration for apps.
No description provided by the author
Package users provides methods for viewing users.
Package config provides methods for managing configuration of apps.

# Functions

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

# 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 drycc.
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 drycc and controller.
ErrNotFound is returned when the controller throws a 404.
ErrUnprocessable is returned when the controller throws a 422.