mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #51265 from thaJeztah/client_gofumpt
client: gofumpt
This commit is contained in:
@@ -46,7 +46,8 @@ func TestImageHistory(t *testing.T) {
|
||||
ID: "image_id2",
|
||||
Tags: []string{"tag1", "tag2"},
|
||||
},
|
||||
}}
|
||||
},
|
||||
}
|
||||
|
||||
imageHistories, err := client.ImageHistory(context.Background(), "image_id", ImageHistoryWithPlatform(ocispec.Platform{
|
||||
Architecture: "arm64",
|
||||
|
||||
@@ -23,10 +23,10 @@ type ImagePullResponse interface {
|
||||
// It executes the privileged function if the operation is unauthorized
|
||||
// and it tries one more time.
|
||||
// Callers can:
|
||||
// - use [ImagePullResponse.Wait] to wait for pull to complete
|
||||
// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing.
|
||||
// - use [ImagePullResponse.Wait] to wait for pull to complete
|
||||
// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing.
|
||||
func (cli *Client) ImagePull(ctx context.Context, refStr string, options ImagePullOptions) (ImagePullResponse, error) {
|
||||
// FIXME(vdemeester): there is currently used in a few way in docker/docker
|
||||
// - if not in trusted content, ref is used to pass the whole reference, and tag is empty
|
||||
|
||||
@@ -27,10 +27,10 @@ type ImagePushResponse interface {
|
||||
// It executes the privileged function if the operation is unauthorized
|
||||
// and it tries one more time.
|
||||
// Callers can
|
||||
// - use [ImagePushResponse.Wait] to wait for push to complete
|
||||
// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing.
|
||||
// - use [ImagePushResponse.Wait] to wait for push to complete
|
||||
// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing.
|
||||
func (cli *Client) ImagePush(ctx context.Context, image string, options ImagePushOptions) (ImagePushResponse, error) {
|
||||
ref, err := reference.ParseNormalizedNamed(image)
|
||||
if err != nil {
|
||||
|
||||
@@ -5,8 +5,7 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type NodeRemoveResult struct {
|
||||
}
|
||||
type NodeRemoveResult struct{}
|
||||
|
||||
// NodeRemove removes a Node.
|
||||
func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options NodeRemoveOptions) (NodeRemoveResult, error) {
|
||||
|
||||
@@ -5,8 +5,7 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type NodeUpdateResult struct {
|
||||
}
|
||||
type NodeUpdateResult struct{}
|
||||
|
||||
// NodeUpdate updates a Node.
|
||||
func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, options NodeUpdateOptions) (NodeUpdateResult, error) {
|
||||
|
||||
@@ -195,7 +195,7 @@ type JSONMessagesStream iter.Seq2[JSONMessage, error]
|
||||
// each [JSONMessage] to out.
|
||||
// see DisplayJSONMessages for details
|
||||
func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error {
|
||||
var dec = json.NewDecoder(in)
|
||||
dec := json.NewDecoder(in)
|
||||
var f JSONMessagesStream = func(yield func(JSONMessage, error) bool) {
|
||||
for {
|
||||
var jm JSONMessage
|
||||
@@ -229,7 +229,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr,
|
||||
// called if a JSONMessage contains an Aux field, in which case
|
||||
// DisplayJSONMessagesStream does not present the JSONMessage.
|
||||
func DisplayJSONMessages(messages JSONMessagesStream, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error {
|
||||
var ids = make(map[string]uint)
|
||||
ids := make(map[string]uint)
|
||||
|
||||
for jm, err := range messages {
|
||||
var diff uint
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package client
|
||||
|
||||
// NodeInspectOptions holds parameters to inspect nodes with.
|
||||
type NodeInspectOptions struct {
|
||||
}
|
||||
type NodeInspectOptions struct{}
|
||||
|
||||
8
vendor/github.com/moby/moby/client/image_pull.go
generated
vendored
8
vendor/github.com/moby/moby/client/image_pull.go
generated
vendored
@@ -23,10 +23,10 @@ type ImagePullResponse interface {
|
||||
// It executes the privileged function if the operation is unauthorized
|
||||
// and it tries one more time.
|
||||
// Callers can:
|
||||
// - use [ImagePullResponse.Wait] to wait for pull to complete
|
||||
// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing.
|
||||
// - use [ImagePullResponse.Wait] to wait for pull to complete
|
||||
// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing.
|
||||
func (cli *Client) ImagePull(ctx context.Context, refStr string, options ImagePullOptions) (ImagePullResponse, error) {
|
||||
// FIXME(vdemeester): there is currently used in a few way in docker/docker
|
||||
// - if not in trusted content, ref is used to pass the whole reference, and tag is empty
|
||||
|
||||
8
vendor/github.com/moby/moby/client/image_push.go
generated
vendored
8
vendor/github.com/moby/moby/client/image_push.go
generated
vendored
@@ -27,10 +27,10 @@ type ImagePushResponse interface {
|
||||
// It executes the privileged function if the operation is unauthorized
|
||||
// and it tries one more time.
|
||||
// Callers can
|
||||
// - use [ImagePushResponse.Wait] to wait for push to complete
|
||||
// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing.
|
||||
// - use [ImagePushResponse.Wait] to wait for push to complete
|
||||
// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence
|
||||
// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case.
|
||||
// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing.
|
||||
func (cli *Client) ImagePush(ctx context.Context, image string, options ImagePushOptions) (ImagePushResponse, error) {
|
||||
ref, err := reference.ParseNormalizedNamed(image)
|
||||
if err != nil {
|
||||
|
||||
3
vendor/github.com/moby/moby/client/node_remove.go
generated
vendored
3
vendor/github.com/moby/moby/client/node_remove.go
generated
vendored
@@ -5,8 +5,7 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type NodeRemoveResult struct {
|
||||
}
|
||||
type NodeRemoveResult struct{}
|
||||
|
||||
// NodeRemove removes a Node.
|
||||
func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options NodeRemoveOptions) (NodeRemoveResult, error) {
|
||||
|
||||
3
vendor/github.com/moby/moby/client/node_update.go
generated
vendored
3
vendor/github.com/moby/moby/client/node_update.go
generated
vendored
@@ -5,8 +5,7 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type NodeUpdateResult struct {
|
||||
}
|
||||
type NodeUpdateResult struct{}
|
||||
|
||||
// NodeUpdate updates a Node.
|
||||
func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, options NodeUpdateOptions) (NodeUpdateResult, error) {
|
||||
|
||||
4
vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go
generated
vendored
4
vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go
generated
vendored
@@ -195,7 +195,7 @@ type JSONMessagesStream iter.Seq2[JSONMessage, error]
|
||||
// each [JSONMessage] to out.
|
||||
// see DisplayJSONMessages for details
|
||||
func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error {
|
||||
var dec = json.NewDecoder(in)
|
||||
dec := json.NewDecoder(in)
|
||||
var f JSONMessagesStream = func(yield func(JSONMessage, error) bool) {
|
||||
for {
|
||||
var jm JSONMessage
|
||||
@@ -229,7 +229,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr,
|
||||
// called if a JSONMessage contains an Aux field, in which case
|
||||
// DisplayJSONMessagesStream does not present the JSONMessage.
|
||||
func DisplayJSONMessages(messages JSONMessagesStream, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error {
|
||||
var ids = make(map[string]uint)
|
||||
ids := make(map[string]uint)
|
||||
|
||||
for jm, err := range messages {
|
||||
var diff uint
|
||||
|
||||
3
vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go
generated
vendored
3
vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go
generated
vendored
@@ -1,5 +1,4 @@
|
||||
package client
|
||||
|
||||
// NodeInspectOptions holds parameters to inspect nodes with.
|
||||
type NodeInspectOptions struct {
|
||||
}
|
||||
type NodeInspectOptions struct{}
|
||||
|
||||
Reference in New Issue
Block a user