parse

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

nolint most of these validate and parse functions have been taken from projectatomic/docker and modified for cri-o

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAllLatestAndCIDFile

func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool, cidfile bool) error

CheckAllLatestAndCIDFile checks that --all and --latest are used correctly. If cidfile is set, also check for the --cidfile flag.

func GetAllLabels

func GetAllLabels(labelFile, inputLabels []string) (map[string]string, error)

GetAllLabels retrieves all labels given a potential label file and a number of labels provided from the command line.

func ValidURL

func ValidURL(urlStr string) error

ValidURL checks a string urlStr is a url or not

func ValidateDomain

func ValidateDomain(val string) (string, error)

func ValidateExtraHost

func ValidateExtraHost(val string) (string, error)

validateExtraHost validates that the specified string is a valid extrahost and returns it. ExtraHost is in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6). for add-host flag

func ValidateFileName

func ValidateFileName(filename string) error

ValidateFileName returns an error if filename contains ":" as it is currently not supported

Types

type PortMapping

type PortMapping struct {
	// Protocol of the port mapping.
	Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=runtime.Protocol" json:"protocol,omitempty"`
	// Port number within the container. Default: 0 (not specified).
	ContainerPort int32 `protobuf:"varint,2,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
	// Port number on the host. Default: 0 (not specified).
	HostPort int32 `protobuf:"varint,3,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"`
	// Host IP.
	HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"`
}

PortMapping specifies the port mapping configurations of a sandbox.

type Protocol

type Protocol int32
const (
	Protocol_TCP Protocol = 0
	Protocol_UDP Protocol = 1
)

Jump to

Keyboard shortcuts

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