Documentation
¶
Overview ¶
Based on net/http/internal
Index ¶
- Constants
- Variables
- type ChunkedReader
- type Config
- type ErrNoSuchImage
- type Proxy
- func (proxy *Proxy) AttachExistingContainers()
- func (proxy *Proxy) ContainerDestroyed(ident string)
- func (proxy *Proxy) ContainerDied(ident string)
- func (proxy *Proxy) ContainerStarted(ident string)
- func (proxy *Proxy) Dial() (net.Conn, error)
- func (proxy *Proxy) Intercept(i interceptor, w http.ResponseWriter, r *http.Request)
- func (proxy *Proxy) Listen() []net.Listener
- func (proxy *Proxy) ListenAndServeStatus(socket string)
- func (proxy *Proxy) Serve(listeners []net.Listener)
- func (proxy *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (proxy *Proxy) StatusHTTP(w http.ResponseWriter, r *http.Request)
- func (proxy *Proxy) Stop()
- type TLSConfig
- type UnmarshalWrongTypeError
Constants ¶
const MaxDockerHostname = 64
Variables ¶
var ( ErrLineTooLong = errors.New("header line too long") ErrInvalidChunkLength = errors.New("invalid byte in chunk length") )
var ( ErrWeaveCIDRNone = errors.New("the container was created with the '-e WEAVE_CIDR=none' option") ErrNoDefaultIPAM = errors.New("the container was created without specifying an IP address with '-e WEAVE_CIDR=...' and the proxy was started with the '--no-default-ipalloc' option") )
var (
ErrNoCommandSpecified = errors.New("No command specified")
)
var (
Log = common.Log
)
Functions ¶
This section is empty.
Types ¶
type ChunkedReader ¶
type ChunkedReader struct {
// contains filtered or unexported fields
}
func NewChunkedReader ¶
func NewChunkedReader(r io.Reader) *ChunkedReader
Unlike net/http/internal.chunkedReader, this has an interface where we can handle individual chunks. The interface is based on database/sql.Rows.
func (*ChunkedReader) Chunk ¶
func (cr *ChunkedReader) Chunk() io.Reader
Chunk returns the io.Reader of the current chunk. On each call, this returns the same io.Reader for a given chunk.
func (*ChunkedReader) Err ¶
func (cr *ChunkedReader) Err() error
Err returns the error, if any, that was encountered during iteration.
func (*ChunkedReader) Next ¶
func (cr *ChunkedReader) Next() bool
Next prepares the next chunk for reading. It returns true on success, or false if there is no next chunk or an error happened while preparing it. Err should be consulted to distinguish between the two cases.
Every call to Chunk, even the first one, must be preceded by a call to Next.
Calls to Next will discard any unread bytes in the current Chunk.
type ErrNoSuchImage ¶
type ErrNoSuchImage struct {
Name string
}
ErrNoSuchImage replaces docker.NoSuchImage, which does not contain the image name, which in turn breaks docker clients post 1.7.0 since they expect the image name to be present in errors.
func (*ErrNoSuchImage) Error ¶
func (err *ErrNoSuchImage) Error() string
type Proxy ¶
func (*Proxy) AttachExistingContainers ¶
func (proxy *Proxy) AttachExistingContainers()
func (*Proxy) ContainerDestroyed ¶
func (*Proxy) ContainerDied ¶
func (*Proxy) ContainerStarted ¶
weavedocker.ContainerObserver interface
func (*Proxy) Intercept ¶
func (proxy *Proxy) Intercept(i interceptor, w http.ResponseWriter, r *http.Request)
func (*Proxy) ListenAndServeStatus ¶
func (*Proxy) StatusHTTP ¶
func (proxy *Proxy) StatusHTTP(w http.ResponseWriter, r *http.Request)
type TLSConfig ¶
type UnmarshalWrongTypeError ¶
type UnmarshalWrongTypeError struct {
Field, Expected string
Got interface{}
}
func (*UnmarshalWrongTypeError) Error ¶
func (e *UnmarshalWrongTypeError) Error() string