Jelajahi Sumber

Fix the inconsistent function name for client

Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
yuexiao-wang 8 tahun lalu
induk
melakukan
16233eb055
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 1 1
      client/login.go
  2. 3 3
      client/request.go

+ 1 - 1
client/login.go

@@ -11,7 +11,7 @@ import (
 )
 
 // RegistryLogin authenticates the docker server with a given docker registry.
-// It returns UnauthorizerError when the authentication fails.
+// It returns unauthorizedError when the authentication fails.
 func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) {
 	resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil)
 

+ 3 - 3
client/request.go

@@ -31,12 +31,12 @@ func (cli *Client) head(ctx context.Context, path string, query url.Values, head
 	return cli.sendRequest(ctx, "HEAD", path, query, nil, headers)
 }
 
-// getWithContext sends an http request to the docker API using the method GET with a specific go context.
+// get sends an http request to the docker API using the method GET with a specific Go context.
 func (cli *Client) get(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) {
 	return cli.sendRequest(ctx, "GET", path, query, nil, headers)
 }
 
-// postWithContext sends an http request to the docker API using the method POST with a specific go context.
+// post sends an http request to the docker API using the method POST with a specific Go context.
 func (cli *Client) post(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) {
 	body, headers, err := encodeBody(obj, headers)
 	if err != nil {
@@ -58,7 +58,7 @@ func (cli *Client) put(ctx context.Context, path string, query url.Values, obj i
 	return cli.sendRequest(ctx, "PUT", path, query, body, headers)
 }
 
-// put sends an http request to the docker API using the method PUT.
+// putRaw sends an http request to the docker API using the method PUT.
 func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) {
 	return cli.sendRequest(ctx, "PUT", path, query, body, headers)
 }