Documentation ¶
Index ¶
- Variables
- func Decode(r *http.Request, v interface{}) error
- func Encode(w http.ResponseWriter, v interface{}) error
- func Error(w http.ResponseWriter, err error, status int) error
- func NewDockerManager(socket, certPath string, auth *docker.AuthConfigurations) (*dockerManager, error)
- func NewHTTPHandler(r *Relay) http.Handler
- func NewTCPHandler(r *Relay) tcp.Handler
- type Container
- type ContainerManager
- type DockerOptions
- type ErrorResource
- type Options
- type PostContainers
- type PostContainersForm
- type Relay
- func (r *Relay) AttachToContainer(ctx context.Context, name string, in io.Reader, out io.Writer) error
- func (r *Relay) CreateContainer(ctx context.Context, c *Container) error
- func (r *Relay) GenContainerName(s string) string
- func (r *Relay) PurgeContainer(ctx context.Context, name string) (err error)
- func (r *Relay) RegisterContainer(name string, c *Container)
- func (r *Relay) StartContainer(ctx context.Context, name string) error
- func (r *Relay) UnregisterContainer(name string)
- func (r *Relay) WaitContainer(ctx context.Context, name string) (int, error)
- type TcpOptions
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultContainerNameFunc is the default implementation for generating container names. DefaultContainerNameFunc = func(s string) string { return fmt.Sprintf("%s.%s", s, uuid.New()) } )
var ErrInvalidRepo = errors.New("registry: not a valid docker repo")
ErrInvalidRepo is returned by parseRepo when the repo is not a valid repo.
var RepoPattern = regexp.MustCompile(`(\S+\/)?(\S+\/\S+):(\S+)`)
RepoPattern matches strings like `quay.io/remind101/acme-inc:latest` or `remind101/acme-inc:latest`
Functions ¶
func Encode ¶
func Encode(w http.ResponseWriter, v interface{}) error
func Error ¶
func Error(w http.ResponseWriter, err error, status int) error
Error is used to respond with errors in the heroku error format, which is specified at https://devcenter.heroku.com/articles/platform-api-reference#errors
If an ErrorResource is provided as the error, and it provides a non-zero status, that will be used as the response status code.
func NewDockerManager ¶
func NewHTTPHandler ¶
func NewTCPHandler ¶
Types ¶
type Container ¶
type Container struct { Image string `json:"image"` Name string `json:"name"` Command string `json:"command"` State string `json:"state"` Env map[string]string `json:"env"` Attach bool `json:"attach"` AttachURL string `json:"attach_url"` }
Container represents a docker container to run.
type ContainerManager ¶
type ContainerManager interface { Pull(*Container) error Create(*Container) error Attach(string, io.Reader, io.Writer) error Start(string) error Wait(string) (int, error) Stop(string) error Remove(string) error }
ContainerManager defines an interface for managing containers.
type DockerOptions ¶
type DockerOptions struct { // The default docker organization to use. Organization string // The unix socket to connect to the docker api. Socket string // Path to a certificate to use for TLS connections. CertPath string // A set of docker registry credentials. Auth *docker.AuthConfigurations }
DockerOptions is a set of options to configure a docker api client.
type ErrorResource ¶
type ErrorResource struct { Status int `json:"-"` ID string `json:"id"` Message string `json:"message"` URL string `json:"url"` }
ErrorResource represents the error response format that we return.
func (*ErrorResource) Error ¶
func (e *ErrorResource) Error() string
Error implements error interface.
type Options ¶
type Options struct { ContainerNameFunc func(string) string Tcp TcpOptions Docker DockerOptions }
Options is the main set of options to configure relay.
type PostContainers ¶
type PostContainers struct {
*Relay
}
func (*PostContainers) ServeHTTPContext ¶
func (h *PostContainers) ServeHTTPContext(ctx context.Context, w http.ResponseWriter, r *http.Request) error
type PostContainersForm ¶
type Relay ¶
type Relay struct { sync.Mutex // The rendezvous host. Host string // contains filtered or unexported fields }
func (*Relay) AttachToContainer ¶
func (r *Relay) AttachToContainer(ctx context.Context, name string, in io.Reader, out io.Writer) error
AttachToContainer attaches IO to an existing container.
func (*Relay) CreateContainer ¶
CreateContainer creates a new container instance, but doesn't start it.
func (*Relay) GenContainerName ¶
GenContainerName generates a new container name.
func (*Relay) PurgeContainer ¶
PurgeContainer stops, deletes and unregisters a container.
func (*Relay) RegisterContainer ¶
RegisterContainer registers a new container, ready to be started over a TCP session.
func (*Relay) StartContainer ¶
StartContainer starts a container. This should be called after creating and attaching to a container.
func (*Relay) UnregisterContainer ¶
UnregisterContainer unregisters a container.
type TcpOptions ¶
type TcpOptions struct { // Host that the tcp server is running on. Host string // Port that the tcp server is running on. Port string }
TcpOptions is a set of options to configure the tcp server.
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/code.google.com/p/go-uuid/uuid
The uuid package generates and inspects UUIDs.
|
The uuid package generates and inspects UUIDs. |
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
|
Package cli provides a minimal framework for creating and organizing command line Go applications. |
_workspace/src/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
|
Package pools provides a collection of pools which provide various data types with buffers. |
_workspace/src/github.com/fsouza/go-dockerclient
Package docker provides a client for the Docker remote API.
|
Package docker provides a client for the Docker remote API. |
_workspace/src/github.com/fsouza/go-dockerclient/testing
Package testing provides a fake implementation of the Docker API, useful for testing purpose.
|
Package testing provides a fake implementation of the Docker API, useful for testing purpose. |
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
|
Package context stores values shared during a request lifetime. |
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
|
Package gorilla/mux implements a request router and dispatcher. |
_workspace/src/github.com/remind101/pkg/httpx
package httpx provides an extra layer of convenience over package http.
|
package httpx provides an extra layer of convenience over package http. |
_workspace/src/github.com/remind101/pkg/logger
package logger is a package that provides a structured logger that's context.Context aware.
|
package logger is a package that provides a structured logger that's context.Context aware. |
_workspace/src/github.com/remind101/pkg/reporter
package reporter provides a context.Context aware abstraction for shuttling errors and panics to third partys.
|
package reporter provides a context.Context aware abstraction for shuttling errors and panics to third partys. |
_workspace/src/github.com/remind101/pkg/reporter/hb
package hb is a Go package from sending errors to Honeybadger.
|
package hb is a Go package from sending errors to Honeybadger. |
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
|
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes. |
cmd
|
|