common

package
v0.0.0-...-dfd6f3a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2013 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomListenAndServeTLS

func CustomListenAndServeTLS(d *http.ServeMux) error

func GenerateCertificate

func GenerateCertificate(host string) (key, certificate []byte)

func JsonReader

func JsonReader(r io.Reader) error

func LogReader

func LogReader(r io.Reader)

func MakeHttpClient

func MakeHttpClient() *http.Client

func TarDir

func TarDir(path string) io.Reader

tarDir takes a directory path and produces a reader which is all of its contents tarred up and compressed with gzip

Types

type Container

type Container struct {
	Id              string
	Image           string
	D               *Docker
	NetworkSettings struct {
		Ports map[string][]map[string]string
	}
	Volumes      map[string]string
	Binds        []string
	PortBindings map[string][]PortBinding
}

func (*Container) AddBind

func (C *Container) AddBind(host string, container string)

func (*Container) AddExposedPort

func (C *Container) AddExposedPort(port string)

func (*Container) Delete

func (C *Container) Delete() (err error)

func (*Container) Inspect

func (C *Container) Inspect() (err error)

InspectContainer takes a container, and returns its port and its info

func (*Container) Start

func (C *Container) Start() (err error)

func (*Container) Stop

func (C *Container) Stop() (err error)

StopContainer stops a container

type Docker

type Docker struct {
	Containers []*Container
	Images     []*Image
	Updated    time.Time
	// contains filtered or unexported fields
}

func NewDocker

func NewDocker(ip string) (D *Docker)

function to initialize new Docker struct

func (*Docker) Build

func (D *Docker) Build(fd io.Reader, name string) (i *Image, err error)

buildImage takes a tarfile, and builds it

func (*Docker) GetIP

func (D *Docker) GetIP() string

func (*Docker) ListContainers

func (D *Docker) ListContainers() (c []*Container, err error)

ListContainers gives the state for a specific docker container

func (*Docker) ListImages

func (D *Docker) ListImages() (img []*Image, err error)

ListImages gives the state of the images for a specific Docker container

func (*Docker) Load

func (D *Docker) Load(imagename string) (I *Image, err error)

loadImage pulls a specified image into a docker instance

func (*Docker) Update

func (D *Docker) Update()

function to periodically update information in Docker struct

type EncWriter

type EncWriter struct {
	// contains filtered or unexported fields
}

func NewEncWriter

func NewEncWriter(w io.Writer) *EncWriter

func (*EncWriter) Log

func (enc *EncWriter) Log(s string)

func (*EncWriter) SetError

func (enc *EncWriter) SetError(err error)

func (*EncWriter) Write

func (enc *EncWriter) Write(p []byte) (n int, err error)

type HttpAPI

type HttpAPI struct {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(ip string) (h *HttpAPI)

function to initialize new http struct

func (*HttpAPI) Delete

func (h *HttpAPI) Delete(url string) (resp *http.Response, err error)

Delete function to clean up http.NewRequest("DELETE"...) call, method for http struct

func (*HttpAPI) Get

func (h *HttpAPI) Get(url string) (resp *http.Response, err error)

Get function to clean up http.Get calls in code, method for http struct

func (*HttpAPI) Post

func (h *HttpAPI) Post(url string, content string, b io.Reader) (resp *http.Response, err error)

Post function to clean up http.Post calls in code, method for http struct

func (*HttpAPI) PostHeader

func (h *HttpAPI) PostHeader(url string, content string, b io.Reader, header http.Header) (resp *http.Response, err error)

Post with a dictionary of header values

func (*HttpAPI) Put

func (h *HttpAPI) Put(url string, content string, b io.Reader) (resp *http.Response, err error)

Post function to clean up http.Post calls in code, method for http struct

type Image

type Image struct {
	Id         string
	Tag        string
	Repository string
	// contains filtered or unexported fields
}

func NewImage

func NewImage(id string) (i *Image)

func NewNamedImage

func NewNamedImage(name string) (i *Image)

func (*Image) AddTag

func (Img *Image) AddTag(D *Docker, tag string) (err error)

TagImage tags an already existing image in the repository

func (*Image) GetName

func (I *Image) GetName() (name string)

func (*Image) IsRunning

func (Img *Image) IsRunning(D *Docker, imagename string) (running bool, C *Container, err error)

ImageRunning states whether an image is running on a docker instance

func (*Image) Push

func (Img *Image) Push(D *Docker, w io.Writer, name string) (err error)

PushImage pushes an image to a docker index

func (*Image) Run

func (Img *Image) Run(D *Docker, env []string, port string) (C *Container, err error)

runImage takes a docker image to run, and makes sure it is running

func (*Image) Stop

func (Img *Image) Stop(D *Docker, imagename string)

StopImage takes a image to stop and stops it

type Message

type Message struct {
	Message_type string
	Status       string
	Message      string
}

type Multiplexer

type Multiplexer struct {
	// contains filtered or unexported fields
}

func NewMultiplexer

func NewMultiplexer() *Multiplexer

func (*Multiplexer) Attach

func (m *Multiplexer) Attach(w io.Writer)

func (*Multiplexer) Detach

func (m *Multiplexer) Detach(w io.Writer)

func (*Multiplexer) Write

func (m *Multiplexer) Write(p []byte) (n int, err error)

type PortBinding

type PortBinding struct {
	HostIp   string
	HostPort string
}

type SkeletonDeployment

type SkeletonDeployment struct {
	Machines struct {
		Provider string
		Ip       []string
	}

	Containers map[string]struct {
		Source      string
		Quantity    int
		Mode        string
		Granularity string
		Expose      []string
	}
}

Jump to

Keyboard shortcuts

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