server

package
v1.4.2-0...-b1053a7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2015 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logging     bool
	EnableCors  bool
	CorsHeaders string
	Version     string
	SocketGroup string
	TLSConfig   *tls.Config
}

Config provides the configuration for the API server

type HTTPAPIFunc

type HTTPAPIFunc func(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error

HTTPAPIFunc is an adapter to allow the use of ordinary functions as Docker API endpoints. Any function that has the appropriate signature can be register as a API endpoint (e.g. getVersion).

type HTTPServer

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

HTTPServer contains an instance of http server and the listener. srv *http.Server, contains configuration to create a http server and a mux router with all api end points. l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.

func (*HTTPServer) Close

func (s *HTTPServer) Close() error

Close closes the HTTPServer from listening for the inbound requests.

func (*HTTPServer) Serve

func (s *HTTPServer) Serve() error

Serve starts listening for inbound requests.

type Server

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

Server contains instance details for the server

func New

func New(cfg *Config) *Server

New returns a new instance of the server based on the specified configuration.

func (*Server) AcceptConnections

func (s *Server) AcceptConnections(d *daemon.Daemon)

AcceptConnections allows clients to connect to the API server. Referenced Daemon is notified about this server, and waits for the daemon acknowledgement before the incoming connections are accepted.

func (*Server) Close

func (s *Server) Close()

Close closes servers and thus stop receiving requests

func (*Server) ServeAPI

func (s *Server) ServeAPI(protoAddrs []string) error

ServeAPI loops through all of the protocols sent in to docker and spawns off a go routine to setup a serving http.Server for each.

Jump to

Keyboard shortcuts

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