go-sdk
No long description provided.
Installation
dagger install github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6Entrypoint
Return Type
GoSdk !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| skipGenerateFilename | String | - | Marker filename that skips generate when found at or above a Go SDK module root. |
| targetRuntime | String | - | Runtime source to write into modules created by this SDK. |
Example
dagger -m github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6 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()
}Entrypoint
Return Type
GoSdkTemplate !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | Template name passed to init. |
| source | Directory ! | - | Template source files materialized into the new module before generation. |
Example
Function GoSdkTemplate.Constructor is not accessible from the go-sdk moduleFunction GoSdkTemplate.Constructor is not accessible from the go-sdk moduleFunction GoSdkTemplate.Constructor is not accessible from the go-sdk moduleFunction GoSdkTemplate.Constructor is not accessible from the go-sdk moduleEntrypoint
Return Type
GoSdkMod !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | Workspace-relative path of this module root. |
| ws | Workspace | - | Workspace containing this module. |
| skipGenerateFilename | String ! | - | Marker filename that skips generate when found at or above this module root. |
Example
dagger -m github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6 call \
--path string --skip-generate-filename stringfunc (m *MyModule) Example(path string, skipGenerateFilename string) *dagger.GoSdkMod {
return dag.
GoSdk(path, skipGenerateFilename)
}@function
def example(path: str, skip_generate_filename: str) -> dagger.GoSdkMod:
return (
dag.go_sdk(path, skip_generate_filename)
)@func()
example(path: string, skipGenerateFilename: string): GoSdkMod {
return dag
.goSdk(path, skipGenerateFilename)
}Types
GoSdk 🔗
Manage Dagger modules that use the Go SDK.
skipGenerateFilename() 🔗
Marker filename that skips generate when found at or above a Go SDK module root.
Return Type
String ! Example
dagger -m github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6 call \
skip-generate-filenamefunc (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()
}targetRuntime() 🔗
Runtime source to write into modules created by this SDK.
Return Type
String ! Example
dagger -m github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6 call \
target-runtimefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
GoSdk().
TargetRuntime(ctx)
}@function
async def example() -> str:
return await (
dag.go_sdk()
.target_runtime()
)@func()
async example(): Promise<string> {
return dag
.goSdk()
.targetRuntime()
}modules() 🔗
Return every legacy dagger.json Dagger module whose sdk.source is “go”.
Return Type
[GoSdkMod ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | 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. Passing an empty template to init uses the module default.
Return Type
[GoSdkTemplate ! ] ! Example
dagger -m github.com/dagger/go-sdk@0079b741a7a166b16bbe9aaf7088e3f7e2c91bd6 call \
templatesfunc (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()
}mod() 🔗
Return the Go SDK module at or above a workspace path.
When findUp is true, path may point inside the module.
Return Type
GoSdkMod !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | No description provided |
| path | String | - | No description provided |
| findUp | Boolean | - | 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()
}initModule() 🔗
Initialize Go-owned files for a new Dagger module.
Pass template to materialize files from templates/. The empty
default uses this module’s minimal template.
Return Type
Changeset !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | No description provided |
| name | String ! | - | No description provided |
| path | String ! | - | No description provided |
| template | String | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(name string, path string) *dagger.Changeset {
return dag.
GoSdk().
InitModule(name, path)
}@function
def example(name: str, path: str) -> dagger.Changeset:
return (
dag.go_sdk()
.init_module(name, path)
)@func()
example(name: string, path: string): Changeset {
return dag
.goSdk()
.initModule(name, path)
}generateAll() 🔗
Generate all discovered legacy dagger.json Go SDK modules.
This discovery path is obsolete for workspace-managed modules; the engine owns the modules..as-sdk.modules source of truth.
Modules with the generate skip marker are skipped.
Return Type
Changeset !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | 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()
}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 moduleFunction GoSdkTemplate.name is not accessible from the go-sdk moduleFunction GoSdkTemplate.name is not accessible from the go-sdk moduleFunction GoSdkTemplate.name is not accessible from the go-sdk modulesource() 🔗
Template source files materialized into the new module before generation.
Return Type
Directory ! Example
Function GoSdkTemplate.source is not accessible from the go-sdk moduleFunction GoSdkTemplate.source is not accessible from the go-sdk moduleFunction GoSdkTemplate.source is not accessible from the go-sdk moduleFunction GoSdkTemplate.source is not accessible from the go-sdk moduleGoSdkMod 🔗
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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | 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()
}generate() 🔗
Generate this module. If the generate skip marker is present, the changeset is empty.
Return Type
Changeset !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | 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()
}