client

package
v0.0.0-...-4caa87e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2016 License: Apache-2.0 Imports: 18 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"`

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

type Builds

type Builds []Build

type Client

type Client struct {
	Host     string
	Password string
	Version  string
	// contains filtered or unexported fields
}

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) CreateApp

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

func (*Client) CreateBuildSource

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

func (*Client) CreateBuildUrl

func (c *Client) CreateBuildUrl(app string, url string, cache bool, config string) (*Build, error)
func (c *Client) CreateLink(app, name string) (*Service, error)

func (*Client) CreateSSL

func (c *Client) CreateSSL(app, process, port, body, key string, chain string, secure bool) (*SSL, 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) 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) DeleteSSL

func (c *Client) DeleteSSL(app, process, port string) (*SSL, 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) (int, 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) 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) InstanceKeyroll

func (c *Client) InstanceKeyroll() error

func (*Client) ListFormation

func (c *Client) ListFormation(app string) (Formation, 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) 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) RemoveRegistry

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

func (*Client) RunProcessAttached

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

func (*Client) RunProcessDetached

func (c *Client) RunProcessDetached(app, process, command 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, count, memory 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 string, 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) UpdateSSL

func (c *Client) UpdateSSL(app, process, port, body, key string, chain string) (*SSL, error)

func (*Client) UpdateSystem

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

func (*Client) UpdateSystemOriginal

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

func (*Client) WithoutVersionCheck

func (c *Client) WithoutVersionCheck(fn func(c *Client))

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 Instance

type Instance struct {
	Agent     bool      `json:"agent"`
	Cpu       float64   `json:"cpu"`
	Id        string    `json:"id"`
	Ip        string    `json:"ip"`
	Memory    float64   `json:"memory"`
	Processes int       `json:"processes"`
	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 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 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 {
	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"`
	Status  string `json:"status"`
	Type    string `json:"type"`
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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