Files
moby/client/system_info.go
Sebastiaan van Stijn 4dda328af8 client: rename files for system-commands to their canonical name
It took me some time to find these commands because they were not named
after their canonical name, unlike (most) other commands.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 00:12:36 +02:00

27 lines
540 B
Go

package client
import (
"context"
"encoding/json"
"fmt"
"net/url"
"github.com/moby/moby/api/types/system"
)
// Info returns information about the docker server.
func (cli *Client) Info(ctx context.Context) (system.Info, error) {
var info system.Info
resp, err := cli.get(ctx, "/info", url.Values{}, nil)
defer ensureReaderClosed(resp)
if err != nil {
return info, err
}
if err := json.NewDecoder(resp.Body).Decode(&info); err != nil {
return info, fmt.Errorf("Error reading remote info: %v", err)
}
return info, nil
}