Add new Client API

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
Helder Correia
2022-03-07 12:12:39 -01:00
parent a5a0207dde
commit da90baa087
30 changed files with 1566 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
package main
import (
"dagger.io/dagger"
)
dagger.#Plan & {
client: filesystem: "/foobar": read: contents: dagger.#FS
actions: test: {
}
}

View File

@@ -0,0 +1,22 @@
package main
import (
"dagger.io/dagger"
)
dagger.#Plan & {
client: filesystem: "../rootfs": read: {
contents: dagger.#FS
include: ["*.txt"]
}
actions: test: {
[string]: dagger.#ReadFile & {
input: client.filesystem."../rootfs".read.contents
}
valid: {
path: "test.txt"
contents: "local directory"
}
notIncluded: path: "test.log"
}
}

View File

@@ -0,0 +1 @@
excluded

View File

@@ -0,0 +1 @@
local directory

View File

@@ -0,0 +1,27 @@
package main
import (
"dagger.io/dagger"
)
dagger.#Plan & {
client: filesystem: rootfs: read: {
contents: dagger.#FS
exclude: ["*.log"]
}
actions: test: {
[string]: dagger.#ReadFile & {
input: client.filesystem.rootfs.read.contents
}
valid: {
path: "test.txt"
contents: "local directory"
}
conflictingValues: {
path: "test.txt"
contents: "local foobar"
}
excluded: path: "test.log"
notExists: path: "test.json"
}
}