Dagger.Client (dagger v1.0.0-beta.11)

Copy Markdown View Source

The root of the DAG.

Summary

Functions

initialize an address to load directories, containers, secrets or other object types.

Constructs a cache volume for a given cache key.

Creates an empty changeset

Dagger Cloud configuration and state

Creates a scratch container, with no image or metadata.

The FunctionCall context that the SDK caller is currently executing in.

The module currently being served in the session, if any.

The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).

The TypeDef representations of the objects currently being served in the session.

Detect and return the current workspace.

The default platform of the engine.

Creates an empty directory.

The Dagger engine container configuration and state

Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.

Initialize an environment file

Create a new error.

Creates a file with the specified contents.

Create a code generation result, given a directory containing the generated code.

Queries a Git repository.

Queries the host environment.

Returns a file containing an http remote url content.

A unique identifier for this Query.

Initialize a JSON value

Initialize a new LLM conversation.

Create a new module.

Create a new module source instance from a source ref string

Load any object by its ID.

Load a GraphQL introspection schema for merging.

Sets a secret given a user defined name to its plaintext and returns the secret.

Creates source map metadata.

Create a new TypeDef.

Get the current Dagger Engine version.

Types

t()

@type t() :: %Dagger.Client{client: term(), query_builder: term()}

Functions

address(client, value)

@spec address(t(), String.t()) :: Dagger.Address.t()

initialize an address to load directories, containers, secrets or other object types.

cache_volume(client, key, optional_args \\ [])

@spec cache_volume(t(), String.t(),
  source: Dagger.Directory.t() | nil,
  sharing: Dagger.CacheSharingMode.t() | nil,
  owner: String.t() | nil
) :: Dagger.CacheVolume.t()

Constructs a cache volume for a given cache key.

changeset(client)

@spec changeset(t()) :: Dagger.Changeset.t()

Creates an empty changeset

cloud(client)

@spec cloud(t()) :: Dagger.Cloud.t()

Dagger Cloud configuration and state

container(client, optional_args \\ [])

@spec container(t(), [{:platform, Dagger.Platform.t() | nil}]) :: Dagger.Container.t()

Creates a scratch container, with no image or metadata.

To pull an image, follow up with the "from" function.

current_function_call(client)

@spec current_function_call(t()) :: Dagger.FunctionCall.t()

The FunctionCall context that the SDK caller is currently executing in.

If the caller is not currently executing in a function, this will return an error.

current_module(client)

@spec current_module(t()) :: Dagger.CurrentModule.t()

The module currently being served in the session, if any.

current_node(client)

@spec current_node(t()) :: Dagger.Node.t()

The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).

current_type_defs(client, optional_args \\ [])

@spec current_type_defs(t(),
  return_all_types: boolean() | nil,
  hide_core: boolean() | nil
) ::
  {:ok, [Dagger.TypeDef.t()]} | {:error, term()}

The TypeDef representations of the objects currently being served in the session.

current_workspace(client)

@spec current_workspace(t()) :: Dagger.Workspace.t()

Detect and return the current workspace.

Experimental

"Highly experimental API extracted from a more ambitious workspace implementation."

default_platform(client)

@spec default_platform(t()) :: {:ok, Dagger.Platform.t()} | {:error, term()}

The default platform of the engine.

directory(client)

@spec directory(t()) :: Dagger.Directory.t()

Creates an empty directory.

engine(client)

@spec engine(t()) :: Dagger.Engine.t()

The Dagger engine container configuration and state

engine_volume(client, name, optional_args \\ [])

@spec engine_volume(t(), String.t(), [{:subdir, String.t() | nil}]) ::
  Dagger.Volume.t()

Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.

env_file(client, optional_args \\ [])

@spec env_file(t(), [{:expand, boolean() | nil}]) :: Dagger.EnvFile.t()

Initialize an environment file

error(client, message)

@spec error(t(), String.t()) :: Dagger.Error.t()

Create a new error.

file(client, name, contents, optional_args \\ [])

@spec file(t(), String.t(), String.t(), [{:permissions, integer() | nil}]) ::
  Dagger.File.t()

Creates a file with the specified contents.

function(client, name, return_type)

@spec function(t(), String.t(), Dagger.TypeDef.t()) :: Dagger.Function.t()

Creates a function.

generated_code(client, code)

@spec generated_code(t(), Dagger.Directory.t()) :: Dagger.GeneratedCode.t()

Create a code generation result, given a directory containing the generated code.

git(client, url, optional_args \\ [])

@spec git(t(), String.t(),
  keep_git_dir: boolean() | nil,
  ssh_known_hosts: String.t() | nil,
  ssh_auth_socket: Dagger.Socket.t() | nil,
  http_auth_username: String.t() | nil,
  http_auth_token: Dagger.Secret.t() | nil,
  http_auth_header: Dagger.Secret.t() | nil,
  experimental_service_host: Dagger.Service.t() | nil
) :: Dagger.GitRepository.t()

Queries a Git repository.

host(client)

@spec host(t()) :: Dagger.Host.t()

Queries the host environment.

http(client, url, optional_args \\ [])

@spec http(t(), String.t(),
  name: String.t() | nil,
  permissions: integer() | nil,
  checksum: String.t() | nil,
  auth_header: Dagger.Secret.t() | nil,
  experimental_service_host: Dagger.Service.t() | nil
) :: Dagger.File.t()

Returns a file containing an http remote url content.

id(client)

@spec id(t()) :: {:ok, String.t()} | {:error, term()}

A unique identifier for this Query.

json(client)

@spec json(t()) :: Dagger.JSONValue.t()

Initialize a JSON value

llm(client, optional_args \\ [])

@spec llm(t(), model: String.t() | nil, provider: String.t() | nil) :: Dagger.LLM.t()

Initialize a new LLM conversation.

Experimental

"LLM support is not yet stabilized"

module(client)

@spec module(t()) :: Dagger.Module.t()

Create a new module.

module_source(client, ref_string, optional_args \\ [])

@spec module_source(t(), String.t(),
  ref_pin: String.t() | nil,
  disable_find_up: boolean() | nil,
  allow_not_exists: boolean() | nil,
  require_kind: Dagger.ModuleSourceKind.t() | nil
) :: Dagger.ModuleSource.t()

Create a new module source instance from a source ref string

node(client, id)

@spec node(t(), String.t()) :: {:ok, Dagger.Node.t() | nil} | {:error, term()}

Load any object by its ID.

schema(client, json)

@spec schema(t(), Dagger.JSON.t()) :: Dagger.Schema.t()

Load a GraphQL introspection schema for merging.

secret(client, uri, optional_args \\ [])

@spec secret(t(), String.t(), [{:cache_key, String.t() | nil}]) :: Dagger.Secret.t()

Creates a new secret.

set_secret(client, name, plaintext)

@spec set_secret(t(), String.t(), String.t()) :: Dagger.Secret.t()

Sets a secret given a user defined name to its plaintext and returns the secret.

The plaintext value is limited to a size of 128000 bytes.

source_map(client, filename, line, column)

@spec source_map(t(), String.t(), integer(), integer()) :: Dagger.SourceMap.t()

Creates source map metadata.

sshfs_volume(client, endpoint, private_key, optional_args \\ [])

@spec sshfs_volume(t(), String.t(), Dagger.Secret.t(),
  known_hosts: Dagger.Secret.t() | nil,
  cache_key: String.t() | nil,
  insecure_skip_host_key_check: boolean() | nil,
  experimental_service_host: Dagger.Service.t() | nil
) :: Dagger.Volume.t()

Constructs an SSHFS volume.

type_def(client)

@spec type_def(t()) :: Dagger.TypeDef.t()

Create a new TypeDef.

version(client)

@spec version(t()) :: {:ok, String.t()} | {:error, term()}

Get the current Dagger Engine version.