docker: github.com/docker/docker/api/server Index | Files | Directories

package server

import "github.com/docker/docker/api/server"

Index

Package Files

middleware.go server.go

type Config Uses

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

Config provides the configuration for the API server

type HTTPServer Uses

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 an 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 Uses

func (s *HTTPServer) Close() error

Close closes the HTTPServer from listening for the inbound requests.

func (*HTTPServer) Serve Uses

func (s *HTTPServer) Serve() error

Serve starts listening for inbound requests.

type Server Uses

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

Server contains instance details for the server

func New Uses

func New(cfg *Config) *Server

New returns a new instance of the server based on the specified configuration. It allocates resources which will be needed for ServeAPI(ports, unix-sockets).

func (*Server) Accept Uses

func (s *Server) Accept(addr string, listeners ...net.Listener)

Accept sets a listener the server accepts connections into.

func (*Server) Close Uses

func (s *Server) Close()

Close closes servers and thus stop receiving requests

func (*Server) InitRouter Uses

func (s *Server) InitRouter(routers ...router.Router)

InitRouter initializes the list of routers for the server. This method also enables the Go profiler.

func (*Server) UseMiddleware Uses

func (s *Server) UseMiddleware(m middleware.Middleware)

UseMiddleware appends a new middleware to the request chain. This needs to be called before the API routes are configured.

func (*Server) Wait Uses

func (s *Server) Wait(waitChan chan error)

Wait blocks the server goroutine until it exits. It sends an error message if there is any error during the API execution.

Directories

PathSynopsis
backend/build
httputils
middleware
router
router/build
router/checkpoint
router/container
router/debug
router/distribution
router/grpc
router/image
router/network
router/plugin
router/session
router/swarm
router/system
router/volume

Package server imports 13 packages (graph) and is imported by 241 packages. Updated 2020-10-26. Refresh now. Tools for package owners.