Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Socket
Sign inDemoInstall

github.com/Excoriate/daggerverse/module-template-light

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Excoriate/daggerverse/module-template-light


Version published
Created
Source

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 functionalityCommandExampleStatus
Add your feature hererundagger 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

FAQs

Package last updated on 16 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc