docker

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package docker provides utility functions for checking the Docker environment. It also provides two implementations of the NodeService interface defined in the privatebtc package.

Index

Constants

View Source
const BitcoinImage = "ruimarinho/bitcoin-core:latest"

BitcoinImage is the name of the docker Image used for the bitcoin node.

Variables

This section is empty.

Functions

func CheckImageExistsInLocalCache

func CheckImageExistsInLocalCache(
	ctx context.Context,
	dockerClient *client.Client,
	imageName string,
) error

CheckImageExistsInLocalCache returns whether the given docker Image exists in the local Image cache.

func GetDockerHost

func GetDockerHost() (string, error)

GetDockerHost returns the actual docker host from different alternatives. Windows is not supported.

func NewClient

func NewClient() (*client.Client, error)

NewClient returns a new docker client.

func PullImage

func PullImage(
	ctx context.Context,
	dockerClient *client.Client,
	imageName string,
) error

PullImage pulls the docker Image with the given name.

Types

type ImageNotFoundError

type ImageNotFoundError struct {
	Image string
}

ImageNotFoundError is used to whenever the ruimarinho/bitcoin-core docker Image is not found in the local Image cache.

func (*ImageNotFoundError) Error

func (e *ImageNotFoundError) Error() string

func (*ImageNotFoundError) Is

func (e *ImageNotFoundError) Is(target error) bool

Is implements errors.Is.

Directories

Path Synopsis
Package dockertest provides implementations of the privatebtc.NodeService and privatebtc.NodeHandler interfaces using the https://github.com/ory/dockertest package.
Package dockertest provides implementations of the privatebtc.NodeService and privatebtc.NodeHandler interfaces using the https://github.com/ory/dockertest package.
Package testcontainers provides implementations of the privatebtc.NodeService and privatebtc.NodeHandler interfaces the using the https://github.com/testcontainers/testcontainers-go package.
Package testcontainers provides implementations of the privatebtc.NodeService and privatebtc.NodeHandler interfaces the using the https://github.com/testcontainers/testcontainers-go package.

Jump to

Keyboard shortcuts

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