client

package
v0.0.0-...-b659250 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinimumServerVersion = "20151023042141"
View Source
var StatusCodePrefix = "F1E49A85-0AD7-4AEF-A618-C249C6E6568D:"

this just needs to be random enough to never show up again in a byte stream

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `json:"name"`
	Release string `json:"release"`
	Status  string `json:"status"`
}

type Apps

type Apps []App

type Build

type Build struct {
	Id       string `json:"id"`
	App      string `json:"app"`
	Logs     string `json:"logs"`
	Manifest string `json:"manifest"`
	Release  string `json:"release"`
	Status   string `json:"status"`

	Description string `json:"description"`

	Started time.Time `json:"started"`
	Ended   time.Time `json:"ended"`
}

type Builds

type Builds []Build

type Certificate

type Certificate struct {
	Id         string    `json:"id"`
	Domain     string    `json:"domain"`
	Expiration time.Time `json:"expiration"`
}

type Certificates

type Certificates []Certificate

type Client

type Client struct {
	Host     string
	Password string
	Version  string
}

func New

func New(host, password, version string) *Client

func (*Client) AddRegistry

func (c *Client) AddRegistry(server, username, password, email string) (*Registry, error)

func (*Client) Auth

func (c *Client) Auth() error

func (*Client) CopyBuild

func (c *Client) CopyBuild(app, id, destApp string) (*Build, error)

func (*Client) CreateApp

func (c *Client) CreateApp(name string) (*App, error)

func (*Client) CreateBuildIndex

func (c *Client) CreateBuildIndex(app string, index Index, cache bool, manifest string, description string) (*Build, error)

func (*Client) CreateBuildSource

func (c *Client) CreateBuildSource(app string, source []byte, cache bool, manifest string, description string) (*Build, error)

func (*Client) CreateBuildUrl

func (c *Client) CreateBuildUrl(app string, url string, cache bool, manifest string, description string) (*Build, error)

func (*Client) CreateCertificate

func (c *Client) CreateCertificate(pub, key, chain string) (*Certificate, error)
func (c *Client) CreateLink(app, name string) (*Service, error)

func (*Client) CreateService

func (c *Client) CreateService(kind string, options map[string]string) (*Service, error)

func (*Client) Delete

func (c *Client) Delete(path string, out interface{}) error

func (*Client) DeleteApp

func (c *Client) DeleteApp(name string) (*App, error)

func (*Client) DeleteBuild

func (c *Client) DeleteBuild(app, id string) (*Build, error)

func (*Client) DeleteCertificate

func (c *Client) DeleteCertificate(id string) error

func (*Client) DeleteEnvironment

func (c *Client) DeleteEnvironment(app, key string) (Environment, string, error)
func (c *Client) DeleteLink(app, name string) (*Service, error)

func (*Client) DeleteResponse

func (c *Client) DeleteResponse(path string, out interface{}) (*http.Response, error)

func (*Client) DeleteService

func (c *Client) DeleteService(name string) (*Service, error)

func (*Client) ExecProcessAttached

func (c *Client) ExecProcessAttached(app, pid, command string, in io.Reader, out io.WriteCloser, height, width int) (int, error)

func (*Client) GenerateCertificate

func (c *Client) GenerateCertificate(domains []string) (*Certificate, error)

func (*Client) Get

func (c *Client) Get(path string, out interface{}) error

func (*Client) GetApp

func (c *Client) GetApp(name string) (*App, error)

func (*Client) GetApps

func (c *Client) GetApps() (Apps, error)

func (*Client) GetBuild

func (c *Client) GetBuild(app, id string) (*Build, error)

func (*Client) GetBuilds

func (c *Client) GetBuilds(app string) (Builds, error)

func (*Client) GetEnvironment

func (c *Client) GetEnvironment(app string) (Environment, error)

func (*Client) GetInstances

func (c *Client) GetInstances() ([]*Instance, error)

func (*Client) GetProcess

func (c *Client) GetProcess(app, id string) (*Process, error)

func (*Client) GetProcesses

func (c *Client) GetProcesses(app string, stats bool) (Processes, error)

func (*Client) GetRelease

func (c *Client) GetRelease(app, id string) (*Release, error)

func (*Client) GetReleases

func (c *Client) GetReleases(app string) (Releases, error)

func (*Client) GetService

func (c *Client) GetService(name string) (*Service, error)

func (*Client) GetServices

func (c *Client) GetServices() (Services, error)

func (*Client) GetSystem

func (c *Client) GetSystem() (*System, error)

func (*Client) GetSystemCapacity

func (c *Client) GetSystemCapacity() (*SystemCapacity, error)

func (*Client) GetSystemReleases

func (c *Client) GetSystemReleases() (Releases, error)

func (*Client) IndexMissing

func (c *Client) IndexMissing(index Index) ([]string, error)

func (*Client) IndexUpload

func (c *Client) IndexUpload(hash string, data []byte) error

func (*Client) InstanceKeyroll

func (c *Client) InstanceKeyroll() error

func (*Client) ListCertificates

func (c *Client) ListCertificates() (Certificates, error)

func (*Client) ListFormation

func (c *Client) ListFormation(app string) (Formation, error)

func (*Client) ListParameters

func (c *Client) ListParameters(app string) (Parameters, error)

func (*Client) ListRegistries

func (c *Client) ListRegistries() (*Registries, error)

func (*Client) ListSSL

func (c *Client) ListSSL(app string) (*SSLs, error)

func (*Client) Post

func (c *Client) Post(path string, params Params, out interface{}) error

func (*Client) PostBody

func (c *Client) PostBody(path string, body io.Reader, out interface{}) error

func (*Client) PostBodyResponse

func (c *Client) PostBodyResponse(path string, body io.Reader, out interface{}) (*http.Response, error)

func (*Client) PostMultipart

func (c *Client) PostMultipart(path string, files map[string][]byte, params Params, out interface{}) error

func (*Client) PromoteRelease

func (c *Client) PromoteRelease(app, id string) (*Release, error)

func (*Client) Proxy

func (c *Client) Proxy(host string, port int, rw io.ReadWriteCloser) error

func (*Client) Put

func (c *Client) Put(path string, params Params, out interface{}) error

func (*Client) PutBody

func (c *Client) PutBody(path string, body io.Reader, out interface{}) error

func (*Client) Racks

func (c *Client) Racks() (racks []Rack, err error)

func (*Client) RemoveRegistry

func (c *Client) RemoveRegistry(server string) (*Registry, error)

func (*Client) RunProcessAttached

func (c *Client) RunProcessAttached(app, process, command, release string, height, width int, in io.Reader, out io.WriteCloser) (int, error)

func (*Client) RunProcessDetached

func (c *Client) RunProcessDetached(app, process, command, release string) error

func (*Client) SSHInstance

func (c *Client) SSHInstance(id, cmd string, height, width int, isTerm bool, in io.Reader, out io.WriteCloser) (int, error)

func (*Client) ScaleSystem

func (c *Client) ScaleSystem(count int, typ string) (*System, error)

func (*Client) SetEnvironment

func (c *Client) SetEnvironment(app string, body io.Reader) (Environment, string, error)

func (*Client) SetFormation

func (c *Client) SetFormation(app, process string, count, memory int) error

func (*Client) SetParameters

func (c *Client) SetParameters(app string, params map[string]string) error

func (*Client) StopProcess

func (c *Client) StopProcess(app, id string) (*Process, error)

func (*Client) Stream

func (c *Client) Stream(path string, headers map[string]string, in io.Reader, out io.WriteCloser) error

func (*Client) StreamAppLogs

func (c *Client) StreamAppLogs(app, filter string, follow bool, since time.Duration, output io.WriteCloser) error

func (*Client) StreamBuildLogs

func (c *Client) StreamBuildLogs(app, id string, output io.WriteCloser) error

func (*Client) StreamReleaseLogs

func (c *Client) StreamReleaseLogs(app, id string, output io.WriteCloser) error

func (*Client) Switch

func (c *Client) Switch(rackName string) (success map[string]string, err error)

func (*Client) TerminateInstance

func (c *Client) TerminateInstance(id string) error

func (*Client) UpdateBuild

func (c *Client) UpdateBuild(app, id, manifest, status, reason string) (*Build, error)

func (*Client) UpdateSSL

func (c *Client) UpdateSSL(app, process, port, id string) (*SSL, error)

func (*Client) UpdateService

func (c *Client) UpdateService(name string, options map[string]string) (*Service, error)

func (*Client) UpdateSystem

func (c *Client) UpdateSystem(version string) (*System, error)

func (*Client) UpdateSystemOriginal

func (c *Client) UpdateSystemOriginal(version string) (*System, error)

type Environment

type Environment map[string]string

type Error

type Error struct {
	Error string `json:"error"`
}

type Formation

type Formation []FormationEntry

type FormationEntry

type FormationEntry struct {
	Balancer string `json:"balancer"`
	Name     string `json:"name"`
	Count    int    `json:"count"`
	Memory   int    `json:"memory"`
	Ports    []int  `json:"ports"`
}

type Index

type Index map[string]IndexItem

type IndexItem

type IndexItem struct {
	Name    string      `json:"name"`
	Mode    os.FileMode `json:"mode"`
	ModTime time.Time   `json:"mtime"`
	Size    int         `json:"-"`
}

type Instance

type Instance struct {
	Agent     bool      `json:"agent"`
	Cpu       float64   `json:"cpu"`
	Id        string    `json:"id"`
	Memory    float64   `json:"memory"`
	PrivateIp string    `json:"private-ip"`
	Processes int       `json:"processes"`
	PublicIp  string    `json:"public-ip"`
	Status    string    `json:"status"`
	Started   time.Time `json:"started"`
}

type NotifyEvent

type NotifyEvent struct {
	Action    string            `json:"action"`
	Status    string            `json:"status"`
	Data      map[string]string `json:"data"`
	Timestamp time.Time         `json:"timestamp"`
}

a NotifyEvent is the payload of any webhook services it is serialized to json

type Organization

type Organization struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Parameters

type Parameters map[string]string

type Params

type Params map[string]string

type Process

type Process struct {
	Id      string    `json:"id"`
	App     string    `json:"app"`
	Command string    `json:"command"`
	Host    string    `json:"host"`
	Image   string    `json:"image"`
	Name    string    `json:"name"`
	Ports   []string  `json:"ports"`
	Release string    `json:"release"`
	Size    int64     `json:"size"`
	Cpu     float64   `json:"cpu"`
	Memory  float64   `json:"memory"`
	Started time.Time `json:"started"`
}

type Processes

type Processes []Process

type Rack

type Rack struct {
	Name         string        `json:"name"`
	Status       string        `json:"status"`
	Organization *Organization `json:"organization"`
}

type Registries

type Registries map[string]Registry

Mirrors Docker AuthConfiguration119 https://godoc.org/github.com/fsouza/go-dockerclient#AuthConfigurations119

type Registry

type Registry struct {
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	Email         string `json:"email,omitempty"`
	ServerAddress string `json:"serveraddress,omitempty"`
}

Mirrors Docker AuthConfiguration https://godoc.org/github.com/fsouza/go-dockerclient#AuthConfiguration

type Release

type Release struct {
	Id       string    `json:"id"`
	App      string    `json:"app"`
	Build    string    `json:"build"`
	Env      string    `json:"env"`
	Manifest string    `json:"manifest"`
	Created  time.Time `json:"created"`
}

type Releases

type Releases []Release

type SSL

type SSL struct {
	Certificate string    `json:"certificate"`
	Domain      string    `json:"domain"`
	Expiration  time.Time `json:"expiration"`
	Port        int       `json:"port"`
	Process     string    `json:"process"`
	Secure      bool      `json:"secure"`
}

type SSLs

type SSLs []SSL

type Service

type Service struct {
	Name         string            `json:"name"`
	Status       string            `json:"status"`
	StatusReason string            `json:"status-reason"`
	Type         string            `json:"type"`
	Exports      map[string]string `json:"exports"`
	// DEPRECATED: should inject any data in Exports
	// we only set this on the outgoing response for old clients
	URL string `json:"url"`

	Outputs    map[string]string `json:"-"`
	Parameters map[string]string `json:"-"`
	Tags       map[string]string `json:"-"`
}

type Services

type Services []Service

type System

type System struct {
	Count   int    `json:"count"`
	Name    string `json:"name"`
	Region  string `json:"region"`
	Status  string `json:"status"`
	Type    string `json:"type"`
	Version string `json:"version"`
}

type SystemCapacity

type SystemCapacity struct {
	ClusterMemory  int64 `json:"cluster-memory"`
	InstanceMemory int64 `json:"instance-memory"`
	ProcessCount   int64 `json:"process-count"`
	ProcessMemory  int64 `json:"process-memory"`
	ProcessWidth   int64 `json:"process-width"`
}

Jump to

Keyboard shortcuts

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