Module {{.module_name}} for Dagger
A simple Dagger place the description of the module here
Configuration ๐ ๏ธ
Through the Dagger CLI, or by using it directly within your module, you can configure the following options:
- โ๏ธ
ctr
: The container to use as a base container. If not specified, a new container is created. - โ๏ธ
version
: The version of the Go image to use. Defaults to latest
. - โ๏ธ
image
: The Go image to use. Defaults to golang:alpine
.
Structure ๐๏ธ
{{.module_name_pkg}} // main module
โโโ .gitattributes
โโโ .gitignore
โโโ LICENSE
โโโ README.md
โโโ apis.go
โโโ cloud.go
โโโ commands.go
โโโ common.go
โโโ config.go
โโโ dagger.json
โโโ examples // Sub modules that represent examples of the module's functions with each SDK
โ โโโ go
โ โโโ .gitattributes
โ โโโ .gitignore
โ โโโ dagger.json
โ โโโ go.mod
โ โโโ go.sum
โ โโโ main.go
โ โโโ testdata
โ โโโ common
โ โโโ README.md
โ โโโ test-file.yml
โโโ go.mod
โโโ go.sum
โโโ main.go
โโโ tests // Sub module that represent tests of the module's functions
โโโ .gitattributes
โโโ .gitignore
โโโ dagger.json
โโโ go.mod
โโโ go.sum
โโโ main.go
โโโ testdata
โโโ common
โโโ README.md
โโโ test-file.yml
NOTE: This structure comes out of the box if it's generated through Daggy. Just run just create <module-name>
and you'll get the structure.
Features ๐จ
Command or functionality | Command | Example | Status |
---|
Add your feature here | run | dagger call <my function> | โ
|
Using the {{.module_name}} Module ๐
Place the description of the module here
Usage through the Dagger CLI ๐
List all the functions available in the module:
cd {{.module_name}}
dagger develop && dagger functions
Call a function:
dagger call github.com/excoriate/daggerverse/{{.module_name}}@version <function-name> [arguments]
Testing ๐งช
This module includes a testing module that aims to test the functionality of the {{.module_name}} module. The tests are written in Go and can be run using the following command:
just test {{.module_name}}
Developer Experience ๐ ๏ธ
If you'd like to contribute, mostly we use Just to automate tasks and Nix to manage the development environment. You can use the following commands to get started:
just init
just golint {{.module_name}}
just test {{.module_name}}
just cilocal {{.module_name}}
Examples (aka Recipes) ๐ฒ
Additionally, this module brings a new Daggerverse functionality that allows to automatically generate the module's documentation using an special (sub) module called {{.module_name_pkg}}/examples/sdk. This module contains a set of examples hat demonstrate how to use the module's functions.
To generate the documentation
It's important to notice that each example function in order to be rendered in the documentation, it must be preprocessed by module's name, in this case (camelCase) {{.module_name}}
.
NOTE: The just
command entails the use of the Justfile for task automation. If you don't have it, don't worry, you just need Nix to run the tasks using the dev-shell
built-in command: nix develop --impure --extra-experimental-features nix-command --extra-experimental-features flakes