Browse Source

pkg/plugins: add convenience alias for VersionMimeType

Add an alias in the pkg/plugins package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 year ago
parent
commit
b663c7c5c3
2 changed files with 5 additions and 0 deletions
  1. 3 0
      pkg/plugins/client.go
  2. 2 0
      pkg/plugins/transport/mimetype.go

+ 3 - 0
pkg/plugins/client.go

@@ -26,6 +26,9 @@ const (
 	dummyHost = "plugin.moby.localhost"
 )
 
+// VersionMimetype is the Content-Type the engine sends to plugins.
+const VersionMimetype = transport.VersionMimetype
+
 func newTransport(addr string, tlsConfig *tlsconfig.Options) (*transport.HTTPTransport, error) {
 	tr := &http.Transport{}
 

+ 2 - 0
pkg/plugins/transport/transport.go → pkg/plugins/transport/mimetype.go

@@ -1,4 +1,6 @@
 package transport // import "github.com/docker/docker/pkg/plugins/transport"
 
 // VersionMimetype is the Content-Type the engine sends to plugins.
+//
+// For convenience, there is an alias in [github.com/docker/docker/pkg/plugins.VersionMimetype].
 const VersionMimetype = "application/vnd.docker.plugins.v1.2+json"