dockerclient

package
v0.0.0-...-f42872a Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDockerAPIVer    = "DOCKER_API_VERSION"
	EnvDockerHost      = "DOCKER_HOST"
	EnvDockerTLSVerify = "DOCKER_TLS_VERIFY"
	EnvDockerCertPath  = "DOCKER_CERT_PATH"
	UnixSocketPath     = "/var/run/docker.sock"
	UnixSocketAddr     = "unix:///var/run/docker.sock"
)

Variables

View Source
var (
	ErrNoDockerInfo = errors.New("no docker info")
)

Functions

func HasSocket

func HasSocket(name string) bool

func HasSystemDockerSocket

func HasSystemDockerSocket() bool

func HasUserDockerSocket

func HasUserDockerSocket() bool

func New

func New(config *config.DockerClient) (*docker.Client, error)

New creates a new Docker client instance

func UserDockerSocket

func UserDockerSocket() string

Types

type SocketInfo

type SocketInfo struct {
	Address       string `json:"address"`
	FilePath      string `json:"file_path"`
	FileType      string `json:"type"`
	FilePerms     string `json:"perms"`
	SymlinkTarget string `json:"symlink_target,omitempty"`
	TargetPerms   string `json:"target_perms,omitempty"`
	TargetType    string `json:"target_type,omitempty"`
	CanRead       bool   `json:"can_read"`
	CanWrite      bool   `json:"can_write"`
}

func GetUnixSocketAddr

func GetUnixSocketAddr() (*SocketInfo, error)

Jump to

Keyboard shortcuts

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