opts

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHTTPHost = "localhost"

DefaultHTTPHost http host

Variables

View Source
var (
	// DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. dockerd -H tcp://
	// These are the IANA registered port numbers for use with Docker
	// see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker
	DefaultHTTPPort = 2375 // Default HTTP Port
	// DefaultTLSHTTPPort Default HTTP Port used when TLS enabled
	DefaultTLSHTTPPort = 2376 // Default TLS encrypted HTTP Port
	// DefaultUnixSocket Path for the unix socket.
	// Docker daemon by default always listens on the default unix socket
	DefaultUnixSocket = "/var/run/docker.sock"
	// DefaultTCPHost constant defines the default host string used by docker on Windows
	DefaultTCPHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort)
	// DefaultTLSHost constant defines the default host string used by docker for TLS sockets
	DefaultTLSHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultTLSHTTPPort)
	// DefaultNamedPipe defines the default named pipe used by docker on Windows
	DefaultNamedPipe = `//./pipe/docker_engine`
)
View Source
var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket)

DefaultHost constant defines the default host string used by docker on other hosts than Windows

Functions

func ParseHost

func ParseHost(defaultToTLS bool, val string) (string, error)

ParseHost and set defaults for a Daemon host string

func ParseTCPAddr

func ParseTCPAddr(tryAddr string, defaultAddr string) (string, error)

ParseTCPAddr parses and validates that the specified address is a valid TCP address. It returns a formatted TCP address, either using the address parsed from tryAddr, or the contents of defaultAddr if tryAddr is a blank string. tryAddr is expected to have already been Trim()'d defaultAddr must be in the full `tcp://host:port` form

func ValidateHost

func ValidateHost(val string) (string, error)

ValidateHost validates that the specified string is a valid host and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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