Skip to content

Commit

Permalink
formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Sep 12, 2023
1 parent 83f8063 commit 77e82f5
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions src/main/resources/com/github/jlangch/venice/docker.venice
Original file line number Diff line number Diff line change
Expand Up @@ -168,83 +168,83 @@


(defn
^{ :arglists '("(docker/image-pull name & options)")
^{ :arglists '("(docker/rmi image & options)")
:doc """
Download an image from a registry.

Images can be pulled by name, name and tag, or digest
Remove an image.

Returns the stdout text from the command.
Images can be removed by name, name and tag, or image id

Options:

| :quiet {true, false} | Suppress verbose output |
| :force {true, false} | Force removal of the image |
| :no-prune {true, false} | Do not delete untagged parents |
"""
:examples '(
"""
(println (docker/image-pull "arangodb/arangodb:3.10.10"))
(println (docker/image-pull "arangodb/arangodb"))
(println (docker/rmi "arangodb/arangodb:3.10.10" :force true))
""" )
:see-also '(
"docker/images"
"docker/rmi"
"docker/image-pull"
"docker/image-rm"
"docker/image-prune" )
:spec { :options { :quiet [:optional #{true, false}] } } }
:spec { :options { :force [:optional #{true, false}]
:no-prune [:optional #{true, false}] } } }

image-pull [name & options]
rmi [image & options]

{ :pre [(string? name)] }
{ :pre [(string? image)] }

(let [opts (apply hash-map options)
_ (validate-map "option" opts (-> docker/image-pull meta :spec :options))
quiet (:quiet opts false)
cmdargs* ["image" "pull"]
cmdargs* (if quiet (conj cmdargs* "--quiet") cmdargs*)
cmdargs* (conj cmdargs* name)]
_ (validate-map "option" opts (-> docker/rmi meta :spec :options))
force (:force opts false)
no-prune (:no-prune opts false)
cmdargs* ["rmi"]
cmdargs* (if force (conj cmdargs* "--force") cmdargs*)
cmdargs* (if no-prune (conj cmdargs* "--no-prune") cmdargs*)
cmdargs* (conj cmdargs* image)]
(:out (apply docker/cmd cmdargs*))))

(defn rmi* [image] (println (docker/rmi :force true)))


(defn
^{ :arglists '("(docker/rmi image & options)")
^{ :arglists '("(docker/image-pull name & options)")
:doc """
Remove an image.
Download an image from a registry.

Images can be removed by name, name and tag, or image id
Images can be pulled by name, name and tag, or digest

Returns the stdout text from the command.

Options:

| :force {true, false} | Force removal of the image |
| :no-prune {true, false} | Do not delete untagged parents |
| :quiet {true, false} | Suppress verbose output |
"""
:examples '(
"""
(println (docker/rmi "arangodb/arangodb:3.10.10" :force true))
(println (docker/image-pull "arangodb/arangodb:3.10.10"))
(println (docker/image-pull "arangodb/arangodb"))
""" )
:see-also '(
"docker/images"
"docker/image-pull"
"docker/rmi"
"docker/image-rm"
"docker/image-prune" )
:spec { :options { :force [:optional #{true, false}]
:no-prune [:optional #{true, false}] } } }
:spec { :options { :quiet [:optional #{true, false}] } } }

rmi [image & options]
image-pull [name & options]

{ :pre [(string? image)] }
{ :pre [(string? name)] }

(let [opts (apply hash-map options)
_ (validate-map "option" opts (-> docker/rmi meta :spec :options))
force (:force opts false)
no-prune (:no-prune opts false)
cmdargs* ["rmi"]
cmdargs* (if force (conj cmdargs* "--force") cmdargs*)
cmdargs* (if no-prune (conj cmdargs* "--no-prune") cmdargs*)
cmdargs* (conj cmdargs* image)]
_ (validate-map "option" opts (-> docker/image-pull meta :spec :options))
quiet (:quiet opts false)
cmdargs* ["image" "pull"]
cmdargs* (if quiet (conj cmdargs* "--quiet") cmdargs*)
cmdargs* (conj cmdargs* name)]
(:out (apply docker/cmd cmdargs*))))

(defn rmi* [image] (println (docker/rmi :force true)))


(defn
^{ :arglists '("(docker/image-rm image)")
Expand Down

0 comments on commit 77e82f5

Please sign in to comment.