Documentation ¶
Overview ¶
Package parsers provides helper functions to parse and validate different type of string. It can be hosts, unix addresses, tcp addresses, filters, kernel operating system versions.
Index ¶
- func ParseHost(defaultTCPAddr, defaultUnixAddr, addr string) (string, error)
- func ParseKeyValueOpt(opt string) (string, string, error)
- func ParseLink(val string) (string, string, error)
- func ParsePortRange(ports string) (uint64, uint64, error)
- func ParseRepositoryTag(repos string) (string, string)
- func ParseTCPAddr(addr string, defaultAddr string) (string, error)
- func ParseUnixAddr(addr string, defaultAddr string) (string, error)
- func PartParser(template, data string) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseHost ¶
ParseHost parses the specified address and returns an address that will be used as the host. Depending of the address specified, will use the defaultTCPAddr or defaultUnixAddr FIXME: Change this not to receive default value as parameter
func ParseKeyValueOpt ¶
ParseKeyValueOpt parses and validates the specified string as a key/value pair (key=value)
func ParsePortRange ¶
ParsePortRange parses and validates the specified string as a port-range (8000-9000)
func ParseRepositoryTag ¶
ParseRepositoryTag gets a repos name and returns the right reposName + tag|digest The tag can be confusing because of a port in a repository name.
Ex: localhost.localdomain:5000/samalba/hipache:latest Digest ex: localhost:5000/foo/bar@sha256:bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb
func ParseTCPAddr ¶
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 addr, or the contents of defaultAddr if addr is a blank string.
func ParseUnixAddr ¶
ParseUnixAddr parses and validates that the specified address is a valid UNIX socket address. It returns a formatted UNIX socket address, either using the address parsed from addr, or the contents of defaultAddr if addr is a blank string.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands.
|
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands. |
Package kernel provides helper function to get, parse and compare kernel versions for different platforms.
|
Package kernel provides helper function to get, parse and compare kernel versions for different platforms. |
Package operatingsystem provides helper function to get the operating system name for different platforms.
|
Package operatingsystem provides helper function to get the operating system name for different platforms. |