pkg

package
v0.0.0-...-bf267a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL