Dagger
Search

lib

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/bradfordwagner/dagger-modules/lib@v0.2.0

Entrypoint

Return Type
Lib
Example
func (m *myModule) example() *Lib  {
	return dag.
			Lib()
}
@function
def example() -> dag.Lib:
	return (
		dag.lib()
	)
@func()
example(): Lib {
	return dag
		.lib()
}

Types

Lib 🔗

openConfigYaml() 🔗

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

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Lib().
			OpenConfigYaml(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.lib()
		.open_config_yaml(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.lib()
		.openConfigYaml(src)
}

archToRunner() 🔗

Returns the runner to run on for the given architecture

Return Type
String !
Arguments
NameTypeDefault ValueDescription
archString !-No description provided
Example
func (m *myModule) example(ctx context.Context, arch string) string  {
	return dag.
			Lib().
			ArchToRunner(ctx, arch)
}
@function
async def example(arch: str) -> str:
	return await (
		dag.lib()
		.arch_to_runner(arch)
	)
@func()
async example(arch: string): Promise<string> {
	return dag
		.lib()
		.archToRunner(arch)
}

archImageName() 🔗

ArchImageName returns the image name for the given image and architecture

Return Type
String !
Arguments
NameTypeDefault ValueDescription
imageString !-No description provided
archString !-No description provided
Example
func (m *myModule) example(ctx context.Context, image string, arch string) string  {
	return dag.
			Lib().
			ArchImageName(ctx, image, arch)
}
@function
async def example(image: str, arch: str) -> str:
	return await (
		dag.lib()
		.arch_image_name(image, arch)
	)
@func()
async example(image: string, arch: string): Promise<string> {
	return dag
		.lib()
		.archImageName(image, arch)
}

manifestTool() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
actorSecret !-GitHub actor, --token=env:github_actor,--token=cmd:"gh auth token"
tokenSecret !-GitHub API token, --token=env:github_token,--token=cmd:"gh auth token"
imageString !-No description provided
arches[String ! ] !-No description provided
Example
func (m *myModule) example(ctx context.Context, actor *Secret, token *Secret, image string, arches []string) string  {
	return dag.
			Lib().
			ManifestTool(ctx, actor, token, image, arches)
}
@function
async def example(actor: dagger.Secret, token: dagger.Secret, image: str, arches: List[str]) -> str:
	return await (
		dag.lib()
		.manifest_tool(actor, token, image, arches)
	)
@func()
async example(actor: Secret, token: Secret, image: string, arches: string[]): Promise<string> {
	return dag
		.lib()
		.manifestTool(actor, token, image, arches)
}

containerOutput() 🔗

ContainerOutput returns the output of a container as a string if stderr exists return that, else stdout

Return Type
String !
Arguments
NameTypeDefault ValueDescription
cContainer !-No description provided
Example
func (m *myModule) example(ctx context.Context, c *Container) string  {
	return dag.
			Lib().
			ContainerOutput(ctx, c)
}
@function
async def example(c: dagger.Container) -> str:
	return await (
		dag.lib()
		.container_output(c)
	)
@func()
async example(c: Container): Promise<string> {
	return dag
		.lib()
		.containerOutput(c)
}

fileContents() 🔗

FileContents - returns the contents of a file in a directory

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
pathString !-No description provided
Example
func (m *myModule) example(ctx context.Context, dir *Directory, path string) string  {
	return dag.
			Lib().
			FileContents(ctx, dir, path)
}
@function
async def example(dir: dagger.Directory, path: str) -> str:
	return await (
		dag.lib()
		.file_contents(dir, path)
	)
@func()
async example(dir: Directory, path: string): Promise<string> {
	return dag
		.lib()
		.fileContents(dir, path)
}

invalidateCache() 🔗

InvalidateCache invalidates the cache if the shouldInvalidate is true

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
shouldInvalidateBoolean !-No description provided
containerContainer !-No description provided
Example
func (m *myModule) example(shouldInvalidate bool, container *Container) *Container  {
	return dag.
			Lib().
			InvalidateCache(shouldInvalidate, container)
}
@function
def example(should_invalidate: bool, container: dagger.Container) -> dagger.Container:
	return (
		dag.lib()
		.invalidate_cache(should_invalidate, container)
	)
@func()
example(shouldInvalidate: boolean, container: Container): Container {
	return dag
		.lib()
		.invalidateCache(shouldInvalidate, container)
}