Documentation ¶
Index ¶
- Constants
- Variables
- type DockerImage
- func (img DockerImage) DefaultLatestVersion() DockerImage
- func (img DockerImage) DefaultLibraryNamespace() DockerImage
- func (img DockerImage) MarshalJSON() ([]byte, error)
- func (img DockerImage) String() string
- func (img *DockerImage) UnmarshalJSON(data []byte) error
- func (img DockerImage) UnversionedString() string
- func (img DockerImage) Validate() error
- type DockerPort
- type Domain
Constants ¶
View Source
const ( ProtocolTCP = "tcp" ProtocolUDP = "udp" )
Variables ¶
View Source
var ( // https://github.com/docker/docker/blob/6d6dc2c1a1e36a2c3992186664d4513ce28e84ae/registry/registry.go#L27 PatternNamespace = regexp.MustCompile(`^([a-z0-9_]{4,30})$`) PatternImage = regexp.MustCompile(`^([a-z0-9-_.]+)$`) PatternVersion = regexp.MustCompile("^[a-zA-Z0-9-\\._]+$") )
View Source
var ( // NOTE: This format description is slightly different from what we parse down there. // The format given here is the one docker documents. But the repository also consist of a // namespace which is more or less always there. Since our business logic requires some checks based on the // namespace, we parse it explicitly. ErrInvalidFormat = errgo.New("Not a valid docker image. Format: [<registry>/]<repository>[:<version>]") )
Functions ¶
This section is empty.
Types ¶
type DockerImage ¶
type DockerImage struct { Registry string // The registry name Namespace string // The namespace Repository string // The repository name Version string // The version part }
func MustParseDockerImage ¶
func MustParseDockerImage(image string) DockerImage
func ParseDockerImage ¶
func ParseDockerImage(image string) (DockerImage, error)
func (DockerImage) DefaultLatestVersion ¶
func (img DockerImage) DefaultLatestVersion() DockerImage
DefaultLatestVersion returns an image that has Version set to "latest" when it is unspecified.
func (DockerImage) DefaultLibraryNamespace ¶
func (img DockerImage) DefaultLibraryNamespace() DockerImage
DefaultLibraryNamespace returns an image that has Namespace set to "library" when it is unspecified.
func (DockerImage) MarshalJSON ¶
func (img DockerImage) MarshalJSON() ([]byte, error)
func (DockerImage) String ¶
func (img DockerImage) String() string
Returns all image information combined: <registry>/<namespace>/<repository>:<version>
func (*DockerImage) UnmarshalJSON ¶
func (img *DockerImage) UnmarshalJSON(data []byte) error
func (DockerImage) UnversionedString ¶
func (img DockerImage) UnversionedString() string
Returns all image information except for the version: <registry>/<namespace>/<repository>
func (DockerImage) Validate ¶
func (img DockerImage) Validate() error
Validate checks that the given docker image is valid. Returns nil if valid, or an error if not valid.
type DockerPort ¶
type DockerPort struct { // The port number. Port string // The protocol to use. "tcp" or "udp" Protocol string // contains filtered or unexported fields }
func MustParseDockerPort ¶
func MustParseDockerPort(port string) DockerPort
func ParseDockerPort ¶
func ParseDockerPort(port string) (DockerPort, error)
func (*DockerPort) Empty ¶
func (d *DockerPort) Empty() bool
Empty returns true if this port is equal to "", false otherwise.
func (*DockerPort) Equals ¶
func (d *DockerPort) Equals(other DockerPort) bool
func (DockerPort) MarshalJSON ¶
func (d DockerPort) MarshalJSON() ([]byte, error)
func (DockerPort) String ¶
func (d DockerPort) String() string
func (*DockerPort) UnmarshalJSON ¶
func (d *DockerPort) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.