Dagger
Search

gopkg

This module has been generated via dagger init and serves as a reference to
basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate 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.

Installation

dagger install github.com/MartinSimango/daggerverse/gopkg@v0.4.0

Entrypoint

Return Type
Gopkg
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
func (m *myModule) example() *Gopkg  {
	return dag.
			Gopkg()
}
@function
def example() -> dag.Gopkg:
	return (
		dag.gopkg()
	)
@func()
example(): Gopkg {
	return dag
		.gopkg()
}

Types

Gopkg 🔗

gpgConfig() 🔗

Return Type
GitGpgConfig !
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 gpg-config
func (m *myModule) example() *GopkgGitGpgConfig  {
	return dag.
			Gopkg().
			GpgConfig()
}
@function
def example() -> dag.GopkgGitGpgConfig:
	return (
		dag.gopkg()
		.gpg_config()
	)
@func()
example(): GopkgGitGpgConfig {
	return dag
		.gopkg()
		.gpgConfig()
}

test() 🔗

Test the project

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory for the project
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 test
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Gopkg().
			Test(ctx)
}
@function
async def example() -> str:
	return await (
		dag.gopkg()
		.test()
	)
@func()
async example(): Promise<string> {
	return dag
		.gopkg()
		.test()
}

release() 🔗

Release a new version of the project using semantic-release

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory for the project
tokenSecret !-GitHub token for the release
dryRunBoolean trueDry run the release
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 release --token env:MYSECRET
func (m *myModule) example(ctx context.Context, token *Secret) string  {
	return dag.
			Gopkg().
			Release(ctxtoken)
}
@function
async def example(token: dagger.Secret) -> str:
	return await (
		dag.gopkg()
		.release(token)
	)
@func()
async example(token: Secret): Promise<string> {
	return dag
		.gopkg()
		.release(token)
}

lint() 🔗

Lint the project using golangci-lint with the provided configuration

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
configString ".golangcli.yml"Lint configuration file
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 lint --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string  {
	return dag.
			Gopkg().
			Lint(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.gopkg()
		.lint(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.gopkg()
		.lint(source)
}

gopkgFlow() 🔗

GopkgFlow runs a release flow for a Go project using semantic-release This runs the following steps: 1. Test the project 2. Release a new version of the project using semantic-release

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory for the project
tokenSecret !-GitHub token for the release
configString ".golangcli.yml"Lint configuration file
dryRunBoolean trueDry run the release
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 gopkg-flow --token env:MYSECRET
func (m *myModule) example(ctx context.Context, token *Secret) string  {
	return dag.
			Gopkg().
			GopkgFlow(ctxtoken)
}
@function
async def example(token: dagger.Secret) -> str:
	return await (
		dag.gopkg()
		.gopkg_flow(token)
	)
@func()
async example(token: Secret): Promise<string> {
	return dag
		.gopkg()
		.gopkgFlow(token)
}

withGitGpgConfig() 🔗

WithGitGpgConfig sets the GPG configuration for the git repository. To be used with Release.

Return Type
Gopkg !
Arguments
NameTypeDefault ValueDescription
gpgKeySecret !-GPG private key for signing the semantic-release bot
gpgKeyIdSecret !-GPG key ID
gpgPasswordSecret -GPG password for the private key, if any
gitAuthorNameString !-Git author name for the release commits
gitAuthorEmailString !-Git author email for the release commits
Example
dagger -m github.com/MartinSimango/daggerverse/gopkg@3653768fa864ba60ed32eab0dde3c446d13e2820 call \
 with-git-gpg-config --gpg-key env:MYSECRET --gpg-key-id env:MYSECRET --git-author-name string --git-author-email string
func (m *myModule) example(gpgKey *Secret, gpgKeyId *Secret, gitAuthorName string, gitAuthorEmail string) *Gopkg  {
	return dag.
			Gopkg().
			WithGitGpgConfig(gpgKey, gpgKeyId, gitAuthorName, gitAuthorEmail)
}
@function
def example(gpg_key: dagger.Secret, gpg_key_id: dagger.Secret, git_author_name: str, git_author_email: str) -> dag.Gopkg:
	return (
		dag.gopkg()
		.with_git_gpg_config(gpg_key, gpg_key_id, git_author_name, git_author_email)
	)
@func()
example(gpgKey: Secret, gpgKeyId: Secret, gitAuthorName: string, gitAuthorEmail: string): Gopkg {
	return dag
		.gopkg()
		.withGitGpgConfig(gpgKey, gpgKeyId, gitAuthorName, gitAuthorEmail)
}

GitGpgConfig 🔗

gpgKey() 🔗

Return Type
Secret !
Example
Function GopkgGitGpgConfig.gpgKey is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKey is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKey is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKey is not accessible from the gopkg module

gpgKeyId() 🔗

Return Type
Secret !
Example
Function GopkgGitGpgConfig.gpgKeyId is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKeyId is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKeyId is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgKeyId is not accessible from the gopkg module

gpgPassword() 🔗

Return Type
Secret !
Example
Function GopkgGitGpgConfig.gpgPassword is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgPassword is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgPassword is not accessible from the gopkg module
Function GopkgGitGpgConfig.gpgPassword is not accessible from the gopkg module

gitAuthorName() 🔗

Return Type
String !
Example
Function GopkgGitGpgConfig.gitAuthorName is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorName is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorName is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorName is not accessible from the gopkg module

gitAuthorEmail() 🔗

Return Type
String !
Example
Function GopkgGitGpgConfig.gitAuthorEmail is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorEmail is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorEmail is not accessible from the gopkg module
Function GopkgGitGpgConfig.gitAuthorEmail is not accessible from the gopkg module