module-template-light

command module
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README ΒΆ

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:

# enter into the module's directory
cd {{.module_name}}

# list all the functions available in the module
dagger develop && dagger functions

Call a function:

# call a function
# dagger call <function-name> [arguments]
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:

## Run the tests using the just 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:

# initialize the pre-commit hooks
just init
# run CI or common things locally
just golint {{.module_name}}
# run the tests
just test {{.module_name}}
# Run the entire CI tasks locally
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

Documentation ΒΆ

Overview ΒΆ

Package main provides methods for setting up and managing a container environment. This includes setting environment variables, mounting directories and files, and configuring services such as Docker within the container.

Copyright: Excoriate alex_torres@outlook.com License: MIT

Package main provides utility functions for working with Docker containers.

This package includes constants and a function for getting the Docker-in-Docker image.

Copyright: Excoriate License: Apache-2.0

Package main provides the ModuleTemplateLight Dagger module and related functions.

This module has been generated via dagger init and serves as a reference to basic module structure as you get started with Dagger. The module demonstrates usage of arguments and return types using simple echo and grep commands. The functions can be called from the dagger CLI or from one of the SDKs.

The first line in this comment block is a short description line and the rest is a long description with more detail on the module's purpose or usage, if appropriate. All modules should have a short description.

Directories ΒΆ

Path Synopsis
examples
go Module
tests module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL