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

github.com/Excoriate/daggerverse/gotoolbox

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Excoriate/daggerverse/gotoolbox

  • v0.11.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

🧰 Gotoolbox Module for Dagger

A powerful Dagger module for Go development and CI/CD workflows.

🛠️ Configuration

Through the Dagger CLI or within your module, you can configure:

  • ⚙️ ctr: Base container (default: new container created)
  • ⚙️ version: Go image version (default: latest)
  • ⚙️ image: Go image (default: golang:alpine)

🌟 Features

FunctionDescriptionExample
🐳 BaseSet base image and versiondagger call base --image-url golang:1.22-alpine
📦 WithEnvironmentVariableSet environment variabledagger call with-environment-variable --name GO_ENV --value production
📂 WithSourceMount source directorydagger call with-source --src . --workdir /app
🔒 WithSecretAsEnvVarSet secret as env vardagger call with-secret-as-env-var --name API_KEY --secret mysecret
📥 WithDownloadedFileDownload and mount filedagger call with-downloaded-file --url https://example.com/file.txt
🔄 WithClonedGitRepoClone and mount Git repodagger call with-cloned-git-repo --repo-url https://github.com/user/repo
🔄 WithCacheBusterAdd cache bustingdagger call with-cache-buster
🛠️ WithGitInAlpineContainerInstall Gitdagger call with-git-in-alpine-container
🧰 WithUtilitiesInAlpineContainerInstall common utilitiesdagger call with-utilities-in-alpine-container
🖥️ WithGoPlatformSet Go platformdagger call with-go-platform --platform linux/amd64
🔧 WithGoCgoEnabledEnable CGOdagger call with-go-cgo-enabled
🚫 WithCgoDisabledDisable CGOdagger call with-cgo-disabled
💾 WithGoBuildCacheConfigure Go build cachedagger call with-go-build-cache
📦 WithGoModCacheConfigure Go mod cachedagger call with-go-mod-cache
📥 WithGoInstallInstall Go packagesdagger call with-go-install --pkgs github.com/user/pkg@latest
🏃 WithGoExecExecute Go commanddagger call with-go-exec --args build --args ./...
🛠️ WithGoBuildConfigure Go builddagger call with-go-build --pkg ./cmd/app --race
🔒 WithGoPrivateSet GOPRIVATEdagger call with-go-private --private-host example.com
🔧 WithGoGCCCompilerInstall GCC compilerdagger call with-go-gcc-compiler
📊 WithGoTestSumInstall GoTestSumdagger call with-go-test-sum
🚀 WithGoReleaserInstall GoReleaserdagger call with-go-releaser
🔍 WithGoLintInstall golangci-lintdagger call with-go-lint --version v1.60.1
🖥️ OpenTerminalOpen interactive terminaldagger call open-terminal
🐚 RunShellRun shell commanddagger call run-shell --cmd "echo Hello, World!"
🖨️ PrintEnvVarsPrint environment variablesdagger call print-env-vars
🔍 InspectEnvVarInspect specific env vardagger call inspect-env-var --key GO_VERSION
🏃 RunGoCMDRun Go commanddagger call run-go-cmd --cmd test --cmd ./...
🏃 RunAnyCmdRun any commanddagger call run-any-cmd --cmd go --cmd version

Using the Gotoolbox Module 🚀

Refer to the examples in the {{.module_name_pkg}}/examples module to see how to use the module's functions.


Usage through the Dagger CLI 🚀

List all the functions available in the module:

# enter into the module's directory
cd gotoolbox

# 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/gotoolbox@version <function-name> [arguments]

Testing 🧪

This module includes a testing module that aims to test the functionality of the Gotoolbox module. The tests are written in Go and can be run using the following command:

## Run the tests using the just command
just test gotoolbox

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 gotoolbox
# run the tests
just test gotoolbox
# Run the entire CI tasks locally
just cilocal gotoolbox

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) gotoolbox.

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 21 Nov 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