Dagger
Search

go

Copyright © 2024 Patrick Hermann patrick.hermann@sva.de

Installation

dagger install github.com/stuttgart-things/dagger/go@v0.0.1

Entrypoint

Return Type
Go !
Arguments
NameTypeDefault ValueDescription
goLangContainerContainer -golang container It need contain golang
koContainerContainer -No description provided
srcDirectory -No description provided
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
func (m *myModule) example() *Go  {
	return dag.
			Go()
}
@function
def example() -> dag.Go:
	return (
		dag.go()
	)
@func()
example(): Go {
	return dag
		.go()
}

Types

Go 🔗

src() 🔗

Return Type
Directory !
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 src
func (m *myModule) example() *Directory  {
	return dag.
			Go().
			Src()
}
@function
def example() -> dagger.Directory:
	return (
		dag.go()
		.src()
	)
@func()
example(): Directory {
	return dag
		.go()
		.src()
}

goLangContainer() 🔗

Return Type
Container !
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 go-lang-container
func (m *myModule) example() *Container  {
	return dag.
			Go().
			GoLangContainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.go()
		.go_lang_container()
	)
@func()
example(): Container {
	return dag
		.go()
		.goLangContainer()
}

koContainer() 🔗

Return Type
Container !
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 ko-container
func (m *myModule) example() *Container  {
	return dag.
			Go().
			KoContainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.go()
		.ko_container()
	)
@func()
example(): Container {
	return dag
		.go()
		.koContainer()
}

getGoLangContainer() 🔗

GetGoLangContainer return the default image for golang

Return Type
Container !
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 get-go-lang-container
func (m *myModule) example() *Container  {
	return dag.
			Go().
			GetGoLangContainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.go()
		.get_go_lang_container()
	)
@func()
example(): Container {
	return dag
		.go()
		.getGoLangContainer()
}

getKoContainer() 🔗

Return Type
Container !
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 get-ko-container
func (m *myModule) example() *Container  {
	return dag.
			Go().
			GetKoContainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.go()
		.get_ko_container()
	)
@func()
example(): Container {
	return dag
		.go()
		.getKoContainer()
}

lint() 🔗

Lint runs the linter on the provided source code

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 lint --src DIR_PATH
func (m *myModule) example(src *Directory) *Container  {
	return dag.
			Go().
			Lint(src)
}
@function
def example(src: dagger.Directory) -> dagger.Container:
	return (
		dag.go()
		.lint(src)
	)
@func()
example(src: Directory): Container {
	return dag
		.go()
		.lint(src)
}

runPipeline() 🔗

RunPipeline orchestrates running both Lint and Build steps

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 run-pipeline --src DIR_PATH
func (m *myModule) example(src *Directory) *Directory  {
	return dag.
			Go().
			RunPipeline(src)
}
@function
def example(src: dagger.Directory) -> dagger.Directory:
	return (
		dag.go()
		.run_pipeline(src)
	)
@func()
example(src: Directory): Directory {
	return dag
		.go()
		.runPipeline(src)
}

build() 🔗

Returns lines that match a pattern in the files of the provided Directory

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 build --src DIR_PATH
func (m *myModule) example(src *Directory) *Directory  {
	return dag.
			Go().
			Build(src)
}
@function
def example(src: dagger.Directory) -> dagger.Directory:
	return (
		dag.go()
		.build(src)
	)
@func()
example(src: Directory): Directory {
	return dag
		.go()
		.build(src)
}

koBuild() 🔗

Returns lines that match a pattern in the files of the provided Directory

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
tokenNameString "GITHUB_TOKEN"No description provided
tokenSecret !-No description provided
repoString "ko.local"No description provided
buildArgString "."No description provided
Example
dagger -m github.com/stuttgart-things/dagger/go@17b6e66e406f15c31bbf1ae09eac7d2916370c0b call \
 ko-build --src DIR_PATH --token env:MYSECRET
func (m *myModule) example(ctx context.Context, src *Directory, token *Secret) string  {
	return dag.
			Go().
			KoBuild(ctx, src, token)
}
@function
async def example(src: dagger.Directory, token: dagger.Secret) -> str:
	return await (
		dag.go()
		.ko_build(src, token)
	)
@func()
async example(src: Directory, token: Secret): Promise<string> {
	return dag
		.go()
		.koBuild(src, token)
}