-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kenfe-Mickael Laventure <[email protected]>
- Loading branch information
1 parent
0ab13dd
commit 7781a1b
Showing
112 changed files
with
782 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package middleware | ||
|
||
import ( | ||
"net/http" | ||
|
||
"golang.org/x/net/context" | ||
) | ||
|
||
// ExperimentalMiddleware is a the middleware in charge of adding the | ||
// 'Docker-Experimental' header to every outgoing request | ||
type ExperimentalMiddleware struct { | ||
experimental string | ||
} | ||
|
||
// NewExperimentalMiddleware creates a new ExperimentalMiddleware | ||
func NewExperimentalMiddleware(experimentalEnabled bool) ExperimentalMiddleware { | ||
if experimentalEnabled { | ||
return ExperimentalMiddleware{"true"} | ||
} | ||
return ExperimentalMiddleware{"false"} | ||
} | ||
|
||
// WrapHandler returns a new handler function wrapping the previous one in the request chain. | ||
func (e ExperimentalMiddleware) WrapHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { | ||
return func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { | ||
w.Header().Set("Docker-Experimental", e.experimental) | ||
return handler(ctx, w, r, vars) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package checkpoint | ||
|
||
import "github.com/docker/docker/api/types" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package checkpoint | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package plugin | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package plugin | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package bundlefile | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package bundlefile | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
// +build !experimental | ||
|
||
package checkpoint | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/docker/docker/cli" | ||
"github.com/docker/docker/cli/command" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewCheckpointCommand returns the `checkpoint` subcommand (only in experimental) | ||
func NewCheckpointCommand(dockerCli *command.DockerCli) *cobra.Command { | ||
return &cobra.Command{} | ||
cmd := &cobra.Command{ | ||
Use: "checkpoint", | ||
Short: "Manage checkpoints", | ||
Args: cli.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) | ||
}, | ||
} | ||
cmd.AddCommand( | ||
newCreateCommand(dockerCli), | ||
newListCommand(dockerCli), | ||
newRemoveCommand(dockerCli), | ||
) | ||
return cmd | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package checkpoint | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package checkpoint | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// +build experimental | ||
|
||
package checkpoint | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
// +build !experimental | ||
|
||
package plugin | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/docker/docker/cli" | ||
"github.com/docker/docker/cli/command" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewPluginCommand returns a cobra command for `plugin` subcommands | ||
func NewPluginCommand(dockerCli *command.DockerCli) *cobra.Command { | ||
return &cobra.Command{} | ||
cmd := &cobra.Command{ | ||
Use: "plugin", | ||
Short: "Manage plugins", | ||
Args: cli.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) | ||
}, | ||
} | ||
|
||
cmd.AddCommand( | ||
newDisableCommand(dockerCli), | ||
newEnableCommand(dockerCli), | ||
newInspectCommand(dockerCli), | ||
newInstallCommand(dockerCli), | ||
newListCommand(dockerCli), | ||
newRemoveCommand(dockerCli), | ||
newSetCommand(dockerCli), | ||
newPushCommand(dockerCli), | ||
) | ||
return cmd | ||
} |
Oops, something went wrong.