Files
moby/client/system_info.go
Poyraz KüçükarslanandCopilot e0e4afd325 client: add missing doc comments to image tag, build cancel, and info types
Add missing Go doc comments to exported option and result types in
image_tag.go, build_cancel.go, and system_info.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Poyraz Küçükarslan <83272398+PoyrazK@users.noreply.github.com>
2026-03-14 10:56:00 +01:00

37 lines
855 B
Go

package client
import (
"context"
"encoding/json"
"fmt"
"net/url"
"github.com/moby/moby/api/types/system"
)
// InfoOptions holds options for [Client.Info].
type InfoOptions struct {
// No options currently; placeholder for future use
}
// SystemInfoResult holds the result of [Client.Info].
type SystemInfoResult struct {
Info system.Info
}
// Info returns information about the docker server.
func (cli *Client) Info(ctx context.Context, options InfoOptions) (SystemInfoResult, error) {
resp, err := cli.get(ctx, "/info", url.Values{}, nil)
defer ensureReaderClosed(resp)
if err != nil {
return SystemInfoResult{}, err
}
var info system.Info
if err := json.NewDecoder(resp.Body).Decode(&info); err != nil {
return SystemInfoResult{}, fmt.Errorf("Error reading remote info: %v", err)
}
return SystemInfoResult{Info: info}, nil
}