Skip to content

client: remove "convenience" methods #50968

@thaJeztah

Description

@thaJeztah

client: remove "convenience" methods

The client gained various methods that were created for convenience. Some
of those methods were created because the existing methods did not have
the right options, and adding more options would break the signature. As
we're not making a breaking change, and are adding option-structs (or
function options), we can remove such functions, and combine them.

Why it's important

We should reduce the number of methods to provide a shallower interface,
but also because more methods may result in more client option-structs,
and with functional options, may require us to (re)define functional options
for each method.

Reducing the number of methods and make them more useful will help with
this. Consumers of the client module can still define their own wrappers
or convenience functions for ergonomics.

Example: client.ContainerStatsOneShot

The client.ContainerStatsOneShot method is identical to client.ContainerStats.
It's using the same endpoint, the same return-type, but with some options
set by default. Having two separate methods for this is confusing, so we
should remove one.

Checklist of client methods to update

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions