diff --git a/docs/reference/README.md b/docs/reference/README.md index e8c56b53..b4b2aed8 100644 --- a/docs/reference/README.md +++ b/docs/reference/README.md @@ -22,7 +22,7 @@ - [europa/dagger](./europa/dagger/README.md) - The Dagger API. - [europa/dagger/engine](./europa/dagger/engine/README.md) - - - [europa/dagger/engine/spec](./europa/dagger/engine/spec/README.md) - Placeholder package, to keep docs generating tool happy. -- [europa/dagger/engine/spec/engine](./europa/dagger/engine/spec/engine.md) - - +- [europa/dagger/engine/spec/engine](./europa/dagger/engine/spec/engine.md) - HTTP operations - [gcp](./gcp/README.md) - Google Cloud Platform - [gcp/cloudrun](./gcp/cloudrun.md) - - - [gcp/gcr](./gcp/gcr.md) - Google Container Registry diff --git a/docs/reference/europa/dagger/engine/spec/engine.md b/docs/reference/europa/dagger/engine/spec/engine.md index ec7fa55b..a29168e8 100644 --- a/docs/reference/europa/dagger/engine/spec/engine.md +++ b/docs/reference/europa/dagger/engine/spec/engine.md @@ -4,6 +4,8 @@ sidebar_label: engine # alpha.dagger.io/europa/dagger/engine/spec/engine +HTTP operations + ```cue import "alpha.dagger.io/europa/dagger/engine/spec/engine" ``` @@ -110,6 +112,18 @@ _No input._ _No output._ +## engine.#HTTPFetch + +Fetch a file over HTTP + +### engine.#HTTPFetch Inputs + +_No input._ + +### engine.#HTTPFetch Outputs + +_No output._ + ## engine.#ImageConfig Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) Container image config See [OCI](https://www.opencontainers.org) diff --git a/stdlib/europa/dagger/engine/spec/engine/http.cue b/stdlib/europa/dagger/engine/spec/engine/http.cue new file mode 100644 index 00000000..3ff794bd --- /dev/null +++ b/stdlib/europa/dagger/engine/spec/engine/http.cue @@ -0,0 +1,46 @@ +// HTTP operations +package engine + +// Raw buildkit API +// +// package llb // import "github.com/moby/buildkit/client/llb" +// +// func HTTP(url string, opts ...HTTPOption) State +// +// type HTTPOption interface { +// SetHTTPOption(*HTTPInfo) +// } +// func Checksum(dgst digest.Digest) HTTPOption +// func Chmod(perm os.FileMode) HTTPOption +// func Chown(uid, gid int) HTTPOption +// func Filename(name string) HTTPOption + +// Fetch a file over HTTP +#HTTPFetch: { + _httpFetch: {} + + // Source url + // Example: https://www.dagger.io/index.html + source: string + + // Destination path of the downloaded file + // Example: "/downloads/index.html" + dest: string + + // Optionally verify the file checksum + // FIXME: what is the best format to encode checksum? + checksum?: string + + // Optionally set file permissions on the downloaded file + // FIXME: find a more developer-friendly way to input file permissions + permissions?: int + + // Optionally set UID of the downloaded file + uid?: int + + // Optionally set GID of the downloaded file + gid?: int + + // New filesystem state containing the downloaded file + output: #FS +}