浏览代码

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 2 年之前
父节点
当前提交
b663c7c5c3
共有 2 个文件被更改,包括 5 次插入0 次删除
  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"