Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
docker represents a Docker client with methods for managing Docker operations
func (*DockerClient) NewClient ¶
func (d *DockerClient) NewClient() (*client.Client, error)
NewClient creates a new Docker client and returns it along with any error encountered. It initializes a new Docker client using the client.NewClientWithOpts function with client.FromEnv option.
Parameters: - d: a pointer to a docker struct, which holds the Docker client instance
Returns: - *client.Client: a pointer to the newly created Docker client - error: an error, if any, encountered during the creation of the Docker client
Example usage:
docker := &docker{}
dockerClient, err := docker.NewClient()
if err != nil {
log.Fatalf("Error creating Docker client: %v", err)
}
defer dockerClient.Close()
Click to show internal directories.
Click to hide internal directories.