summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/util.go b/libpod/util.go
index 61546f23e..c8cbfa2fc 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -4,9 +4,17 @@ import (
"fmt"
"os"
"path/filepath"
+ "strings"
"time"
)
+// Runtime API constants
+const (
+ // DefaultTransport is a prefix that we apply to an image name
+ // to check docker hub first for the image
+ DefaultTransport = "docker://"
+)
+
// WriteFile writes a provided string to a provided path
func WriteFile(content string, path string) error {
baseDir := filepath.Dir(path)
@@ -42,3 +50,8 @@ func FuncTimer(funcName string) {
elapsed := time.Since(time.Now())
fmt.Printf("%s executed in %d ms\n", funcName, elapsed)
}
+
+// hasTransport determines if the image string contains '://', returns bool
+func hasTransport(image string) bool {
+ return strings.Contains(image, "://")
+}