sdk

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2016 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultContentTypeV1_1 = "application/vnd.docker.plugins.v1.1+json"

DefaultContentTypeV1_1 is the default content type accepted and sent by the plugins.

Variables

This section is empty.

Functions

func DecodeRequest

func DecodeRequest(w http.ResponseWriter, r *http.Request, req interface{}) (err error)

DecodeRequest decodes an http request into a given structure.

func EncodeResponse

func EncodeResponse(w http.ResponseWriter, res interface{}, err string)

EncodeResponse encodes the given structure into an http response.

Types

type Handler

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

Handler is the base to create plugin handlers. It initializes connections and sockets to listen to.

func NewHandler

func NewHandler(manifest string) Handler

NewHandler creates a new Handler with an http mux.

func (Handler) HandleFunc

func (h Handler) HandleFunc(path string, fn func(w http.ResponseWriter, r *http.Request))

HandleFunc registers a function to handle a request path with.

func (Handler) Serve

func (h Handler) Serve(l net.Listener) error

Serve sets up the handler to serve requests on the passed in listener

func (Handler) ServeTCP

func (h Handler) ServeTCP(pluginName, addr string) error

ServeTCP makes the handler to listen for request in a given TCP address. It also writes the spec file on the right directory for docker to read.

func (Handler) ServeUnix

func (h Handler) ServeUnix(systemGroup, addr string) error

ServeUnix makes the handler to listen for requests in a unix socket. It also creates the socket file on the right directory for docker to read.

Jump to

Keyboard shortcuts

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