Documentation ¶
Index ¶
- Constants
- Variables
- func FormatMountLabel(src, mountLabel string) string
- func GetHostIP() string
- func IsDNS1123Label(value string) bool
- func IsDNSLabel(value string) bool
- func JSONMarshal(v interface{}, safeEncoding bool) ([]byte, error)
- func MatchesContentType(contentType, expectedType string) bool
- func Mount(source string, target string, fstype string, flags uintptr, data string) error
- func ParseImageRepoTag(image string) (repo, name, tag string)
- func ParseTimeString(str string) (time.Time, error)
- func PermInt(str string) int
- func RandStr(strSize int, randType string) string
- func RsplitN(s, sep string, n int) []string
- func SetDaemon(d interface{})
- func StringToSignal(s string) syscall.Signal
- func Timeout(second int) <-chan time.Time
- func UidInt(str string) int
- func UriReader(uri string) (io.ReadCloser, error)
- type FutureSet
- type Initializer
- type WaitGroupWithFail
Constants ¶
const (
APIVERSION = "1.17"
)
const (
Dns1123LabelFmt = "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
)
const DockerRestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
Variables ¶
var ( ErrTimeout = fmt.Errorf("timeout") BrokenChan = fmt.Errorf("Unexpected broken chan") )
var ( GITCOMMIT string = "0" VERSION string IAMSTATIC string = "true" INITSHA1 string = "" INITPATH string = "" HYPER_ROOT string HYPER_FILE string HYPER_DAEMON interface{} )
var DockerRestrictedNamePattern = regexp.MustCompile(`^/?` + DockerRestrictedNameChars + `+$`)
RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters.
var (
MS_BIND uintptr = syscall.MS_BIND
)
var RestrictedVolumeNamePattern = regexp.MustCompile(`^` + DockerRestrictedNameChars + `+$`)
RestrictedVolumeNamePattern is a regular expression to validate volume names against the collection of restricted characters.
Functions ¶
func FormatMountLabel ¶
FormatMountLabel returns a string to be used by the mount command. The format of this string will be used to alter the labeling of the mountpoint. The string returned is suitable to be used as the options field of the mount command. If you need to have additional mount point options, you can pass them in as the first parameter. Second parameter is the label that you wish to apply to all content in the mount point.
func IsDNS1123Label ¶ added in v0.8.0
IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).
func IsDNSLabel ¶ added in v0.8.0
func JSONMarshal ¶ added in v0.5.0
func MatchesContentType ¶
func ParseImageRepoTag ¶ added in v0.8.0
func StringToSignal ¶ added in v0.8.0
Types ¶
type FutureSet ¶ added in v0.8.0
func NewFutureSet ¶ added in v0.8.0
func NewFutureSet() *FutureSet
func (*FutureSet) IsFinished ¶ added in v0.8.0
type Initializer ¶ added in v0.8.0
type Initializer struct {
// contains filtered or unexported fields
}
func NewInitializer ¶ added in v0.8.0
func NewInitializer(fn func()) *Initializer
func (*Initializer) Do ¶ added in v0.8.0
func (i *Initializer) Do()
type WaitGroupWithFail ¶ added in v0.8.0
type WaitGroupWithFail struct { sync.WaitGroup sync.Mutex // contains filtered or unexported fields }
func (*WaitGroupWithFail) Fail ¶ added in v0.8.0
func (wg *WaitGroupWithFail) Fail(err error)
func (*WaitGroupWithFail) Wait ¶ added in v0.8.0
func (wg *WaitGroupWithFail) Wait() error