summaryrefslogtreecommitdiff
path: root/api/server
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2023-03-01 09:38:18 -0500
committerGitHub <noreply@github.com>2023-03-01 09:38:18 -0500
commit7568bbc4917d11252fa1453ca4fc878dbb96dc07 (patch)
tree5b53bd9d2e7282e46482ecd588d149261d88460d /api/server
parente979518a696e1d98551c0f6aab9539977537b03d (diff)
parent0a6a726d267e663d4003435c62ed9475e541cd5c (diff)
downloaddocker-7568bbc4917d11252fa1453ca4fc878dbb96dc07.tar.gz
Merge pull request #45083 from corhere/unused-api-config-struct
api/server: drop unused Config struct
Diffstat (limited to 'api/server')
-rw-r--r--api/server/server.go20
-rw-r--r--api/server/server_test.go7
2 files changed, 1 insertions, 26 deletions
diff --git a/api/server/server.go b/api/server/server.go
index e8714eb060..3ce2659287 100644
--- a/api/server/server.go
+++ b/api/server/server.go
@@ -2,7 +2,6 @@ package server // import "github.com/docker/docker/api/server"
import (
"context"
- "crypto/tls"
"net"
"net/http"
"strings"
@@ -22,32 +21,13 @@ import (
// when a request is about to be served.
const versionMatcher = "/v{version:[0-9.]+}"
-// Config provides the configuration for the API server
-type Config struct {
- CorsHeaders string
- Version string
- SocketGroup string
- TLSConfig *tls.Config
- // Hosts is a list of addresses for the API to listen on.
- Hosts []string
-}
-
// Server contains instance details for the server
type Server struct {
- cfg *Config
servers []*HTTPServer
routers []router.Router
middlewares []middleware.Middleware
}
-// 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 New(cfg *Config) *Server {
- return &Server{
- cfg: cfg,
- }
-}
-
// UseMiddleware appends a new middleware to the request chain.
// This needs to be called before the API routes are configured.
func (s *Server) UseMiddleware(m middleware.Middleware) {
diff --git a/api/server/server_test.go b/api/server/server_test.go
index a3e8124a88..8b71e9fce6 100644
--- a/api/server/server_test.go
+++ b/api/server/server_test.go
@@ -13,12 +13,7 @@ import (
)
func TestMiddlewares(t *testing.T) {
- cfg := &Config{
- Version: "0.1omega2",
- }
- srv := &Server{
- cfg: cfg,
- }
+ srv := &Server{}
srv.UseMiddleware(middleware.NewVersionMiddleware("0.1omega2", api.DefaultVersion, api.MinVersion))