api

package
v0.0.0-...-c9ffa05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2018 License: MIT Imports: 4 Imported by: 64

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoutable

func NewRoutable() *bool

NewRoutable returns a default value for the AppSettings.Routable field.

Types

type App

type App struct {
	Created string `json:"created"`
	ID      string `json:"id"`
	Owner   string `json:"owner"`
	Updated string `json:"updated"`
	UUID    string `json:"uuid"`
}

App is the definition of the app object.

type AppCreateRequest

type AppCreateRequest struct {
	ID string `json:"id,omitempty"`
}

AppCreateRequest is the definition of POST /v2/apps/.

type AppRunRequest

type AppRunRequest struct {
	Command string `json:"command"`
}

AppRunRequest is the definition of POST /v2/apps/<app id>/run.

type AppRunResponse

type AppRunResponse struct {
	Output     string `json:"output"`
	ReturnCode int    `json:"exit_code"`
}

AppRunResponse is the definition of /v2/apps/<app id>/run.

type AppSettings

type AppSettings struct {
	// Owner is the app owner. It cannot be updated with AppSettings.Set(). See app.Transfer().
	Owner string `json:"owner,omitempty"`
	// App is the app name. It cannot be updated at all right now.
	App string `json:"app,omitempty"`
	// Created is the time that the application settings was created and cannot be updated.
	Created string `json:"created,omitempty"`
	// Updated is the last time the application settings was changed and cannot be updated.
	Updated string `json:"updated,omitempty"`
	// UUID is a unique string reflecting the application settings in its current state.
	// It changes every time the application settings is changed and cannot be updated.
	UUID string `json:"uuid,omitempty"`
	// Maintenance determines if the application is taken down for maintenance or not.
	Maintenance *bool `json:"maintenance,omitempty"`
	// Routable determines if the application should be exposed by the router.
	Routable  *bool                 `json:"routable,omitempty"`
	Whitelist []string              `json:"whitelist,omitempty"`
	Autoscale map[string]*Autoscale `json:"autoscale,omitempty"`
	Label     Labels                `json:"label,omitempty"`
}

AppSettings is the structure of an app's settings.

type AppUpdateRequest

type AppUpdateRequest struct {
	Owner string `json:"owner,omitempty"`
}

AppUpdateRequest is the definition of POST /v2/apps/<app id>/.

type Apps

type Apps []App

Apps defines a collection of app objects.

func (Apps) Len

func (a Apps) Len() int

func (Apps) Less

func (a Apps) Less(i, j int) bool

func (Apps) Swap

func (a Apps) Swap(i, j int)

type AuthCancelRequest

type AuthCancelRequest struct {
	Username string `json:"username"`
}

AuthCancelRequest is the definition of POST /v2/auth/cancel/.

type AuthLoginRequest

type AuthLoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthLoginRequest is the definition of POST /v2/auth/login/.

type AuthLoginResponse

type AuthLoginResponse tokenResponse

AuthLoginResponse is the definition of /v2/auth/login/.

type AuthPasswdRequest

type AuthPasswdRequest struct {
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	NewPassword string `json:"new_password"`
}

AuthPasswdRequest is the definition of POST /v2/auth/passwd/.

type AuthRegenerateRequest

type AuthRegenerateRequest struct {
	Name string `json:"username,omitempty"`
	All  bool   `json:"all,omitempty"`
}

AuthRegenerateRequest is the definition of POST /v2/auth/tokens/.

type AuthRegenerateResponse

type AuthRegenerateResponse tokenResponse

AuthRegenerateResponse is the definition of /v2/auth/tokens/.

type AuthRegisterRequest

type AuthRegisterRequest struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	Email     string `json:"email"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
}

AuthRegisterRequest is the definition of POST /v2/auth/register/.

type Autoscale

type Autoscale struct {
	Min        int `json:"min"`
	Max        int `json:"max"`
	CPUPercent int `json:"cpu_percent"`
}

Autoscale is a per proc type scaling information

func (Autoscale) String

func (a Autoscale) String() string

String displays the Autoscale rule in a readable format.

type Autoscales

type Autoscales map[string]*Autoscale

Autoscales contains a hash of process types and the autoscale rules

type Build

type Build struct {
	App        string            `json:"app"`
	Created    string            `json:"created"`
	Dockerfile string            `json:"dockerfile,omitempty"`
	Image      string            `json:"image,omitempty"`
	Owner      string            `json:"owner"`
	Procfile   map[string]string `json:"procfile"`
	Sha        string            `json:"sha,omitempty"`
	Updated    string            `json:"updated"`
	UUID       string            `json:"uuid"`
}

Build is the structure of the build object.

type BuildHookRequest

type BuildHookRequest struct {
	Sha        string      `json:"sha"`
	User       string      `json:"receive_user"`
	App        string      `json:"receive_repo"`
	Image      string      `json:"image"`
	Procfile   ProcessType `json:"procfile"`
	Dockerfile string      `json:"dockerfile"`
}

BuildHookRequest is a hook request to create a new build.

type Cert

type Cert struct {
	Updated        time.Time `json:"updated,omitempty"`
	Created        time.Time `json:"created,omitempty"`
	Name           string    `json:"name"`
	CommonName     string    `json:"common_name"`
	Expires        time.Time `json:"expires"`
	Starts         time.Time `json:"starts"`
	Fingerprint    string    `json:"fingerprint"`
	Issuer         string    `json:"issuer"`
	Subject        string    `json:"subject"`
	SubjectAltName []string  `json:"san,omitempty"`
	Domains        []string  `json:"domains,omitempty"`
	Owner          string    `json:"owner,omitempty"`
	ID             int       `json:"id,omitempty"`
}

Cert is the definition of the cert object. Some fields are omtempty because they are only returned when creating or getting a cert.

type CertAttachRequest

type CertAttachRequest struct {
	Domain string `json:"domain"`
}

CertAttachRequest is the definition of POST to /v2/certs/<cert>/domain

type CertCreateRequest

type CertCreateRequest struct {
	Certificate string `json:"certificate"`
	Key         string `json:"key"`
	Name        string `json:"name"`
}

CertCreateRequest is the definition of POST and PUT to /v2/certs/

type Config

type Config struct {
	// Owner is the app owner. It cannot be updated with config.Set(). See app.Transfer().
	Owner string `json:"owner,omitempty"`
	// App is the app name. It cannot be updated at all right now.
	App string `json:"app,omitempty"`
	// Values are exposed as environment variables to the app.
	Values map[string]interface{} `json:"values,omitempty"`
	// Memory is used to set process memory limits. The key is the process name
	// and the value is a number followed by a memory unit (G, M, K, or B). Ex: 200G
	Memory map[string]interface{} `json:"memory,omitempty"`
	// CPU is used to set process CPU limits. It can be set in terms of whole CPUs
	// (ex 1) or in milli units to reflect the number of CPU shares (ex 500m).
	CPU map[string]interface{} `json:"cpu,omitempty"`
	// Healthcheck is map of healthchecks for each process that the application uses.
	Healthcheck map[string]*Healthchecks `json:"healthcheck,omitempty"`
	// Tags restrict applications to run on k8s nodes with that label.
	Tags map[string]interface{} `json:"tags,omitempty"`
	// Registry is a key-value pair to provide authentication for docker registries.
	// The key is the username and the value is the password.
	Registry map[string]interface{} `json:"registry,omitempty"`
	// Created is the time that the application was created and cannot be updated.
	Created string `json:"created,omitempty"`
	// Updated is the last time the configuration was changed and cannot be updated.
	Updated string `json:"updated,omitempty"`
	// UUID is a unique string reflecting the configuration in its current state.
	// It changes every time the configuration is changed and cannot be updated.
	UUID string `json:"uuid,omitempty"`
}

Config is the structure of an app's config.

type ConfigHookRequest

type ConfigHookRequest struct {
	User string `json:"receive_user"`
	App  string `json:"receive_repo"`
}

ConfigHookRequest defines the request for configuration from the config hook.

type ConfigSet

type ConfigSet struct {
	Values map[string]string `json:"values"`
}

ConfigSet is the definition of POST /v2/apps/<app id>/config/.

type ConfigUnset

type ConfigUnset struct {
	Values map[string]interface{} `json:"values"`
}

ConfigUnset is the definition of POST /v2/apps/<app id>/config/.

type CreateBuildRequest

type CreateBuildRequest struct {
	Image    string            `json:"image"`
	Procfile map[string]string `json:"procfile,omitempty"`
}

CreateBuildRequest is the structure of POST /v2/apps/<app id>/builds/.

type Domain

type Domain struct {
	App     string `json:"app"`
	Created string `json:"created"`
	Domain  string `json:"domain"`
	Owner   string `json:"owner"`
	Updated string `json:"updated"`
}

Domain is the structure of the domain object.

type DomainCreateRequest

type DomainCreateRequest struct {
	Domain string `json:"domain"`
}

DomainCreateRequest is the structure of POST /v2/app/<app id>/domains/.

type Domains

type Domains []Domain

Domains defines a collection of domain objects.

func (Domains) Len

func (d Domains) Len() int

func (Domains) Less

func (d Domains) Less(i, j int) bool

func (Domains) Swap

func (d Domains) Swap(i, j int)

type ExecProbe

type ExecProbe struct {
	Command []string `json:"command"`
}

ExecProbe executes a command within a Pod.

func (ExecProbe) String

func (e ExecProbe) String() string

String displays the ExecProbe in a readable format.

type HTTPGetProbe

type HTTPGetProbe struct {
	Path        string    `json:"path,omitempty"`
	Port        int       `json:"port"`
	HTTPHeaders []*KVPair `json:"httpHeaders,omitempty"`
}

HTTPGetProbe performs an HTTP GET request to the Pod with the given path, port and headers.

func (HTTPGetProbe) String

func (h HTTPGetProbe) String() string

String displays the HTTPGetProbe in a readable format.

type Healthcheck

type Healthcheck struct {
	InitialDelaySeconds int             `json:"initialDelaySeconds"`
	TimeoutSeconds      int             `json:"timeoutSeconds"`
	PeriodSeconds       int             `json:"periodSeconds"`
	SuccessThreshold    int             `json:"successThreshold"`
	FailureThreshold    int             `json:"failureThreshold"`
	Exec                *ExecProbe      `json:"exec,omitempty"`
	HTTPGet             *HTTPGetProbe   `json:"httpGet,omitempty"`
	TCPSocket           *TCPSocketProbe `json:"tcpSocket,omitempty"`
}

Healthcheck is the structure for an application healthcheck. Healthchecks only need to provide information about themselves. All the information is pushed to the server and handled by kubernetes.

func (Healthcheck) String

func (h Healthcheck) String() string

String displays the HealthcheckHTTPGetProbe in a readable format.

type Healthchecks

type Healthchecks map[string]*Healthcheck

Healthchecks is a map of healthcheck probes. The valid values are "livenessProbe" and "readinessProbe".

type KVPair

type KVPair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

KVPair is a key/value pair used to parse values from strings into a formal structure.

func (KVPair) String

func (k KVPair) String() string

type Key

type Key struct {
	Created string `json:"created"`
	ID      string `json:"id"`
	Owner   string `json:"owner"`
	Public  string `json:"public"`
	Updated string `json:"updated"`
	UUID    string `json:"uuid"`
}

Key is the definition of the key object.

type KeyCreateRequest

type KeyCreateRequest struct {
	ID     string `json:"id"`
	Public string `json:"public"`
	Name   string `json:"name,omitempty"`
}

KeyCreateRequest is the definition of POST /v2/keys/.

type Keys

type Keys []Key

Keys defines a collection of key objects.

func (Keys) Len

func (k Keys) Len() int

func (Keys) Less

func (k Keys) Less(i, j int) bool

func (Keys) Swap

func (k Keys) Swap(i, j int)

type Labels

type Labels map[string]interface{}

Labels can contain any user-defined key value

type PermsAppResponse

type PermsAppResponse struct {
	Users []string `json:"users"`
}

PermsAppResponse is the definition of GET /v2/apps/<app id>/perms/.

type PermsRequest

type PermsRequest struct {
	Username string `json:"username"`
}

PermsRequest is the definition of a requst on /perms/.

type PodType

type PodType struct {
	Type     string
	PodsList PodsList
}

PodType holds pods of the same type.

type PodTypes

type PodTypes []PodType

PodTypes holds groups of pods organized by type.

func (PodTypes) Len

func (p PodTypes) Len() int

func (PodTypes) Less

func (p PodTypes) Less(i, j int) bool

func (PodTypes) Swap

func (p PodTypes) Swap(i, j int)

type Pods

type Pods struct {
	Release string    `json:"release"`
	Type    string    `json:"type"`
	Name    string    `json:"name"`
	State   string    `json:"state"`
	Started time.Time `json:"started"`
}

Pods defines the structure of a process.

type PodsList

type PodsList []Pods

PodsList defines a collection of app pods.

func (PodsList) Len

func (p PodsList) Len() int

func (PodsList) Less

func (p PodsList) Less(i, j int) bool

func (PodsList) Swap

func (p PodsList) Swap(i, j int)

type ProcessType

type ProcessType map[string]string

ProcessType represents the key/value mappings of a process type to a process inside a Heroku Procfile.

See https://devcenter.heroku.com/articles/procfile

type Release

type Release struct {
	App     string `json:"app"`
	Build   string `json:"build,omitempty"`
	Config  string `json:"config"`
	Created string `json:"created"`
	Owner   string `json:"owner"`
	Summary string `json:"summary"`
	Updated string `json:"updated"`
	UUID    string `json:"uuid"`
	Version int    `json:"version"`
}

Release is the definition of the release object.

type ReleaseRollback

type ReleaseRollback struct {
	Version int `json:"version"`
}

ReleaseRollback is the defenition of POST /v2/apps/<app id>/releases/.

type TCPSocketProbe

type TCPSocketProbe struct {
	Port int `json:"port"`
}

TCPSocketProbe attempts to open a socket connection to the Pod on the given port.

func (TCPSocketProbe) String

func (t TCPSocketProbe) String() string

String displays the TCPSocketProbe in a readable format.

type TLS

type TLS struct {
	// Owner is the app owner. It cannot be updated with TLS.Set(). See app.Transfer().
	Owner string `json:"owner,omitempty"`
	// App is the app the tls settings apply to and cannot be updated.
	App string `json:"app,omitempty"`
	// Created is the time that the TLS settings was created and cannot be updated.
	Created string `json:"created,omitempty"`
	// Updated is the last time the TLS settings was changed and cannot be updated.
	Updated string `json:"updated,omitempty"`
	// UUID is a unique string reflecting the TLS settings in its current state.
	// It changes every time the TLS settings is changed and cannot be updated.
	UUID string `json:"uuid,omitempty"`
	//HTTPSEnforced determines if the router should enable or disable https-only requests.
	HTTPSEnforced *bool `json:"https_enforced,omitempty"`
}

TLS is the structure of an app's TLS settings.

func NewTLS

func NewTLS() *TLS

NewTLS creates a new TLS object with fields properly zeroed

func (TLS) String

func (t TLS) String() string

type User

type User struct {
	ID          int    `json:"id"`
	LastLogin   string `json:"last_login"`
	IsSuperuser bool   `json:"is_superuser"`
	Username    string `json:"username"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	IsStaff     bool   `json:"is_staff"`
	IsActive    bool   `json:"is_active"`
	DateJoined  string `json:"date_joined"`
}

User is the definition of the user object.

func (User) String

func (u User) String() string

type UserApps

type UserApps struct {
	Username string   `json:"username"`
	Apps     []string `json:"apps"`
}

UserApps is a definition of the UserFromKey Hook response.

type Users

type Users []User

Users holds a collection of user objects.

func (Users) Len

func (u Users) Len() int

func (Users) Less

func (u Users) Less(i, j int) bool

func (Users) Swap

func (u Users) Swap(i, j int)

type Whitelist

type Whitelist struct {
	Addresses []string `json:"addresses"`
}

Whitelist is the structure of POST /v2/app/<app id>/whitelist/.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL