Dagger
Search

go-sdk

No long description provided.

Installation

dagger install github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0

Entrypoint

Return Type
GoSdkMod !
Arguments
NameTypeDefault ValueDescription
pathString !-Workspace-relative path of this module root.
workspacePathString !-Workspace-relative path where changesets should be rooted.
daggerJsonFile !-This module's dagger.json.
skipGenerateFilenameString !-Marker filename that skips generate when found at or above this module root.
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
 --path string --workspace-path string --dagger-json file:path --skip-generate-filename string
func (m *MyModule) Example(path string, workspacePath string, daggerJson *dagger.File, skipGenerateFilename string) *dagger.GoSdkMod  {
	return dag.
			GoSdk(path, workspacePath, daggerJson, skipGenerateFilename)
}
@function
def example(path: str, workspace_path: str, dagger_json: dagger.File, skip_generate_filename: str) -> dagger.GoSdkMod:
	return (
		dag.go_sdk(path, workspace_path, dagger_json, skip_generate_filename)
	)
@func()
example(path: string, workspacePath: string, daggerJson: File, skipGenerateFilename: string): GoSdkMod {
	return dag
		.goSdk(path, workspacePath, daggerJson, skipGenerateFilename)
}

Entrypoint

Return Type
GoSdkModEngine !
Arguments
NameTypeDefault ValueDescription
pathString !-Workspace-relative path of the module root.
workspacePathString !-Workspace-relative path where changesets should be rooted.
daggerJsonFile !-This module's dagger.json.
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
 --path string --workspace-path string --dagger-json file:path
func (m *MyModule) Example(path string, workspacePath string, daggerJson *dagger.File) *dagger.GoSdkModEngine  {
	return dag.
			GoSdk(path, workspacePath, daggerJson)
}
@function
def example(path: str, workspace_path: str, dagger_json: dagger.File) -> dagger.GoSdkModEngine:
	return (
		dag.go_sdk(path, workspace_path, dagger_json)
	)
@func()
example(path: string, workspacePath: string, daggerJson: File): GoSdkModEngine {
	return dag
		.goSdk(path, workspacePath, daggerJson)
}

Entrypoint

Return Type
GoSdkTemplate !
Arguments
NameTypeDefault ValueDescription
nameString !-Template name passed to init.
sourceDirectory !-Template source files materialized into the new module before generation.
Example
Function GoSdkTemplate.Constructor is not accessible from the go-sdk module
Function GoSdkTemplate.Constructor is not accessible from the go-sdk module
Function GoSdkTemplate.Constructor is not accessible from the go-sdk module
Function GoSdkTemplate.Constructor is not accessible from the go-sdk module

Entrypoint

Return Type
GoSdkModDeps !
Arguments
NameTypeDefault ValueDescription
pathString !-Workspace-relative path of the module root.
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
 --path string
func (m *MyModule) Example(path string) *dagger.GoSdkModDeps  {
	return dag.
			GoSdk(path)
}
@function
def example(path: str) -> dagger.GoSdkModDeps:
	return (
		dag.go_sdk(path)
	)
@func()
example(path: string): GoSdkModDeps {
	return dag
		.goSdk(path)
}

Entrypoint

Return Type
GoSdk !
Arguments
NameTypeDefault ValueDescription
skipGenerateFilenameString -Marker filename that skips generate when found at or above a Go SDK module root.
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
func (m *MyModule) Example() *dagger.GoSdk  {
	return dag.
			GoSdk()
}
@function
def example() -> dagger.GoSdk:
	return (
		dag.go_sdk()
	)
@func()
example(): GoSdk {
	return dag
		.goSdk()
}

Types

GoSdkMod 🔗

A Dagger module that uses the Go SDK.

path() 🔗

Workspace-relative path of this module root.

Return Type
String !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			GoSdk().
			Mod().
			Path(ctx)
}
@function
async def example() -> str:
	return await (
		dag.go_sdk()
		.mod()
		.path()
	)
@func()
async example(): Promise<string> {
	return dag
		.goSdk()
		.mod()
		.path()
}

skipGenerate() 🔗

Whether this module or an ancestor contains the configured generate skip marker.

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) bool  {
	return dag.
			GoSdk().
			Mod().
			SkipGenerate(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.go_sdk()
		.mod()
		.skip_generate()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.goSdk()
		.mod()
		.skipGenerate()
}

engine() 🔗

Manage the Dagger engine version required by this module.

Return Type
GoSdkModEngine !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.GoSdkModEngine  {
	return dag.
			GoSdk().
			Mod().
			Engine()
}
@function
def example() -> dagger.GoSdkModEngine:
	return (
		dag.go_sdk()
		.mod()
		.engine()
	)
@func()
example(): GoSdkModEngine {
	return dag
		.goSdk()
		.mod()
		.engine()
}

deps() 🔗

Manage this module’s Dagger dependencies.

Return Type
GoSdkModDeps !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.GoSdkModDeps  {
	return dag.
			GoSdk().
			Mod().
			Deps()
}
@function
def example() -> dagger.GoSdkModDeps:
	return (
		dag.go_sdk()
		.mod()
		.deps()
	)
@func()
example(): GoSdkModDeps {
	return dag
		.goSdk()
		.mod()
		.deps()
}

generate() 🔗

Generate this module. If the generate skip marker is present, the changeset is empty.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Generate()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.generate()
	)
@func()
example(): Changeset {
	return dag
		.goSdk()
		.mod()
		.generate()
}

GoSdkModEngine 🔗

Required Dagger engine version for a Go SDK module.

required() 🔗

The Dagger engine version required by this module, without a leading “v”.

Return Type
String !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			GoSdk().
			Mod().
			Engine().
			Required(ctx)
}
@function
async def example() -> str:
	return await (
		dag.go_sdk()
		.mod()
		.engine()
		.required()
	)
@func()
async example(): Promise<string> {
	return dag
		.goSdk()
		.mod()
		.engine()
		.required()
}

require() 🔗

Configure this module to require the given Dagger engine version.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
versionString !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(version string) *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Engine().
			Require(version)
}
@function
def example(version: str) -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.engine()
		.require(version)
	)
@func()
example(version: string): Changeset {
	return dag
		.goSdk()
		.mod()
		.engine()
		.require(version)
}

requireCurrent() 🔗

Configure this module to require the current Dagger engine version.

Return Type
Changeset !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Engine().
			RequireCurrent()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.engine()
		.require_current()
	)
@func()
example(): Changeset {
	return dag
		.goSdk()
		.mod()
		.engine()
		.requireCurrent()
}

requireLatest() 🔗

Configure this module to require the latest stable Dagger engine version.

Return Type
Changeset !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Engine().
			RequireLatest()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.engine()
		.require_latest()
	)
@func()
example(): Changeset {
	return dag
		.goSdk()
		.mod()
		.engine()
		.requireLatest()
}

GoSdkTemplate 🔗

An init template tracked by this module.

name() 🔗

Template name passed to init.

Return Type
String !
Example
Function GoSdkTemplate.name is not accessible from the go-sdk module
Function GoSdkTemplate.name is not accessible from the go-sdk module
Function GoSdkTemplate.name is not accessible from the go-sdk module
Function GoSdkTemplate.name is not accessible from the go-sdk module

source() 🔗

Template source files materialized into the new module before generation.

Return Type
Directory !
Example
Function GoSdkTemplate.source is not accessible from the go-sdk module
Function GoSdkTemplate.source is not accessible from the go-sdk module
Function GoSdkTemplate.source is not accessible from the go-sdk module
Function GoSdkTemplate.source is not accessible from the go-sdk module

GoSdkModDeps 🔗

Dagger dependencies for a Go SDK module.

add() 🔗

Add a Dagger dependency to this module.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
sourceString !-No description provided
nameString -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(source string) *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Deps().
			Add(source)
}
@function
def example(source: str) -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.deps()
		.add(source)
	)
@func()
example(source: string): Changeset {
	return dag
		.goSdk()
		.mod()
		.deps()
		.add(source)
}

remove() 🔗

Remove a Dagger dependency from this module by name or source.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
nameString !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(name string) *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Deps().
			Remove(name)
}
@function
def example(name: str) -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.deps()
		.remove(name)
	)
@func()
example(name: string): Changeset {
	return dag
		.goSdk()
		.mod()
		.deps()
		.remove(name)
}

update() 🔗

Update one Dagger dependency by name or source, or all remote dependencies.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
nameString -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			GoSdk().
			Mod().
			Deps().
			Update()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.go_sdk()
		.mod()
		.deps()
		.update()
	)
@func()
example(): Changeset {
	return dag
		.goSdk()
		.mod()
		.deps()
		.update()
}

GoSdk 🔗

A Dagger module for Go SDK modules.

skipGenerateFilename() 🔗

Marker filename that skips generate when found at or above a Go SDK module root.

Return Type
String !
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
 skip-generate-filename
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			GoSdk().
			SkipGenerateFilename(ctx)
}
@function
async def example() -> str:
	return await (
		dag.go_sdk()
		.skip_generate_filename()
	)
@func()
async example(): Promise<string> {
	return dag
		.goSdk()
		.skipGenerateFilename()
}

mod() 🔗

Return the Go SDK module containing a workspace path.

Return Type
GoSdkMod !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
pathString -No description provided
findUpBoolean -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.GoSdkMod  {
	return dag.
			GoSdk().
			Mod()
}
@function
def example() -> dagger.GoSdkMod:
	return (
		dag.go_sdk()
		.mod()
	)
@func()
example(): GoSdkMod {
	return dag
		.goSdk()
		.mod()
}

init() 🔗

Create a new Go SDK Dagger module and return the files to write.

By default, the new module is created under the nearest .dagger directory visible from the current workspace path:

/modules/

Pass path to choose a different module location. The target path must not already contain a Dagger module.

Pass template to materialize files from templates/ before generation. The empty default uses this module’s minimal template.

By default, generated SDK files are checked into version control. Pass ignoreGenerated to add generated SDK paths to .gitignore instead.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
nameString !-No description provided
pathString -No description provided
templateString -No description provided
generateBoolean -No description provided
ignoreGeneratedBoolean -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(name string) *dagger.Changeset  {
	return dag.
			GoSdk().
			Init(name)
}
@function
def example(name: str) -> dagger.Changeset:
	return (
		dag.go_sdk()
		.init(name)
	)
@func()
example(name: string): Changeset {
	return dag
		.goSdk()
		.init(name)
}

modules() 🔗

Return every Dagger module whose sdk.source is “go”.

Return Type
[GoSdkMod ! ] !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() []*dagger.GoSdkMod  {
	return dag.
			GoSdk().
			Modules()
}
@function
def example() -> List[dagger.GoSdkMod]:
	return (
		dag.go_sdk()
		.modules()
	)
@func()
example(): GoSdkMod[] {
	return dag
		.goSdk()
		.modules()
}

templates() 🔗

Return init templates tracked by this module.

Templates live under templates/ and are materialized into the new module before generation. Passing an empty template to init uses the module default.

Return Type
[GoSdkTemplate ! ] !
Example
dagger -m github.com/shykes/dagger-go-sdk@2dd9e7cc6623c188df6cc5a7e7990da733ff67f0 call \
 templates
func (m *MyModule) Example() []*dagger.GoSdkTemplate  {
	return dag.
			GoSdk().
			Templates()
}
@function
def example() -> List[dagger.GoSdkTemplate]:
	return (
		dag.go_sdk()
		.templates()
	)
@func()
example(): GoSdkTemplate[] {
	return dag
		.goSdk()
		.templates()
}

workspaceModuleSource() 🔗

Return a module source backed by the narrowest workspace directory this shim can compute from dagger.json.

Return Type
ModuleSource !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
pathString -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.ModuleSource  {
	return dag.
			GoSdk().
			WorkspaceModuleSource()
}
@function
def example() -> dagger.ModuleSource:
	return (
		dag.go_sdk()
		.workspace_module_source()
	)
@func()
example(): ModuleSource {
	return dag
		.goSdk()
		.workspaceModuleSource()
}

workspaceModuleSourceInclude() 🔗

Workspace-root include patterns needed to load a module source and its local module source references.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
pathString !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context, path string) []string  {
	return dag.
			GoSdk().
			WorkspaceModuleSourceInclude(ctxpath)
}
@function
async def example(path: str) -> List[str]:
	return await (
		dag.go_sdk()
		.workspace_module_source_include(path)
	)
@func()
async example(path: string): Promise<string[]> {
	return dag
		.goSdk()
		.workspaceModuleSourceInclude(path)
}

generateAll() 🔗

Generate all discovered Go SDK modules. Modules with the generate skip marker are skipped.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			GoSdk().
			GenerateAll()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.go_sdk()
		.generate_all()
	)
@func()
example(): Changeset {
	return dag
		.goSdk()
		.generateAll()
}