dagger/dsl/dag

Types

pub type Opts {
  Opts(
    platform: option.Option(String),
    privileged: option.Option(Bool),
    writable: option.Option(Bool),
    permissions: option.Option(Int),
    ssh_known_hosts: option.Option(String),
    ssh_auth_socket: option.Option(types.Socket),
    http_auth_username: option.Option(String),
    http_auth_token: option.Option(types.Secret),
    http_auth_header: option.Option(types.Secret),
    experimental_service_host: option.Option(types.Service),
    name: option.Option(String),
    auth_header: option.Option(types.Secret),
    model: option.Option(String),
    max_a_p_i_calls: option.Option(Int),
    ref_pin: option.Option(String),
    disable_find_up: option.Option(Bool),
    allow_not_exists: option.Option(Bool),
    require_kind: option.Option(types.ModuleSourceKind),
    cache_key: option.Option(String),
  )
}

Constructors

Values

pub fn address(value value: String) -> types.Address

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

pub fn allow_not_exists(opts: Opts, val: Bool) -> Opts
pub fn auth_header(opts: Opts, val: types.Secret) -> Opts
pub fn cache_key(opts: Opts, val: String) -> Opts
pub fn cache_volume(key key: String) -> types.CacheVolume

Constructs a cache volume for a given cache key.

pub fn cloud() -> types.Cloud

Dagger Cloud configuration and state

pub fn container(
  with with_fn: fn(Opts) -> Opts,
) -> types.Container

Creates a scratch container, with no image or metadata. To pull an image, follow up with the “from” function.

pub fn current_env() -> types.Env

Returns the current environment When called from a function invoked via an LLM tool call, this will be the LLM’s current environment, including any modifications made through calling tools. Env values returned by functions become the new environment for subsequent calls, and Changeset values returned by functions are applied to the environment’s workspace. When called from a module function outside of an LLM, this returns an Env with the current module installed, and with the current module’s source directory as its workspace.

pub fn current_function_call() -> types.FunctionCall

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.

pub fn current_module() -> types.CurrentModule

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

pub fn current_type_defs(
  select select: fn(types.TypeDef) -> List(types.Field),
  client client: types.Client,
  then handler: fn(Result(List(types.TypeDef), types.QueryError)) -> a,
) -> a

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

pub fn default_platform(
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

The default platform of the engine.

pub fn directory() -> types.Directory

Creates an empty directory.

pub fn disable_find_up(opts: Opts, val: Bool) -> Opts
pub fn engine() -> types.Engine

The Dagger engine container configuration and state

pub fn env(with with_fn: fn(Opts) -> Opts) -> types.Env

Initializes a new environment

pub fn env_file() -> types.EnvFile

Initialize an environment file

pub fn error(message message: String) -> types.Error

Create a new error.

pub fn experimental_service_host(
  opts: Opts,
  val: types.Service,
) -> Opts
pub fn file(
  name name: String,
  contents contents: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.File

Creates a file with the specified contents.

pub fn function(
  name name: String,
  return_type return_type: types.TypeDef,
) -> types.Function

Creates a function.

pub fn generated_code(
  code code: types.Directory,
) -> types.GeneratedCode

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

pub fn git(
  url url: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.GitRepository

Queries a Git repository.

pub fn host() -> types.Host

Queries the host environment.

pub fn http(
  url url: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.File

Returns a file containing an http remote url content.

pub fn http_auth_header(opts: Opts, val: types.Secret) -> Opts
pub fn http_auth_token(opts: Opts, val: types.Secret) -> Opts
pub fn http_auth_username(opts: Opts, val: String) -> Opts
pub fn json() -> types.JSONValue

Initialize a JSON value

pub fn llm(with with_fn: fn(Opts) -> Opts) -> types.LLM

Initialize a Large Language Model (LLM)

pub fn load_address_from_i_d(
  id id: types.Address,
) -> types.Address

Load a Address from its ID.

pub fn load_binding_from_i_d(
  id id: types.Binding,
) -> types.Binding

Load a Binding from its ID.

pub fn load_cache_volume_from_i_d(
  id id: types.CacheVolume,
) -> types.CacheVolume

Load a CacheVolume from its ID.

pub fn load_changeset_from_i_d(
  id id: types.Changeset,
) -> types.Changeset

Load a Changeset from its ID.

pub fn load_check_from_i_d(id id: types.Check) -> types.Check

Load a Check from its ID.

pub fn load_check_group_from_i_d(
  id id: types.CheckGroup,
) -> types.CheckGroup

Load a CheckGroup from its ID.

pub fn load_cloud_from_i_d(id id: types.Cloud) -> types.Cloud

Load a Cloud from its ID.

pub fn load_container_from_i_d(
  id id: types.Container,
) -> types.Container

Load a Container from its ID.

pub fn load_current_module_from_i_d(
  id id: types.CurrentModule,
) -> types.CurrentModule

Load a CurrentModule from its ID.

pub fn load_directory_from_i_d(
  id id: types.Directory,
) -> types.Directory

Load a Directory from its ID.

pub fn load_engine_cache_entry_from_i_d(
  id id: types.EngineCacheEntry,
) -> types.EngineCacheEntry

Load a EngineCacheEntry from its ID.

pub fn load_engine_cache_entry_set_from_i_d(
  id id: types.EngineCacheEntrySet,
) -> types.EngineCacheEntrySet

Load a EngineCacheEntrySet from its ID.

pub fn load_engine_cache_from_i_d(
  id id: types.EngineCache,
) -> types.EngineCache

Load a EngineCache from its ID.

pub fn load_engine_from_i_d(id id: types.Engine) -> types.Engine

Load a Engine from its ID.

pub fn load_enum_type_def_from_i_d(
  id id: types.EnumTypeDef,
) -> types.EnumTypeDef

Load a EnumTypeDef from its ID.

pub fn load_enum_value_type_def_from_i_d(
  id id: types.EnumValueTypeDef,
) -> types.EnumValueTypeDef

Load a EnumValueTypeDef from its ID.

pub fn load_env_file_from_i_d(
  id id: types.EnvFile,
) -> types.EnvFile

Load a EnvFile from its ID.

pub fn load_env_from_i_d(id id: types.Env) -> types.Env

Load a Env from its ID.

pub fn load_env_variable_from_i_d(
  id id: types.EnvVariable,
) -> types.EnvVariable

Load a EnvVariable from its ID.

pub fn load_error_from_i_d(id id: types.Error) -> types.Error

Load a Error from its ID.

pub fn load_error_value_from_i_d(
  id id: types.ErrorValue,
) -> types.ErrorValue

Load a ErrorValue from its ID.

pub fn load_field_type_def_from_i_d(
  id id: types.FieldTypeDef,
) -> types.FieldTypeDef

Load a FieldTypeDef from its ID.

pub fn load_file_from_i_d(id id: types.File) -> types.File

Load a File from its ID.

pub fn load_function_arg_from_i_d(
  id id: types.FunctionArg,
) -> types.FunctionArg

Load a FunctionArg from its ID.

pub fn load_function_call_arg_value_from_i_d(
  id id: types.FunctionCallArgValue,
) -> types.FunctionCallArgValue

Load a FunctionCallArgValue from its ID.

pub fn load_function_call_from_i_d(
  id id: types.FunctionCall,
) -> types.FunctionCall

Load a FunctionCall from its ID.

pub fn load_function_from_i_d(
  id id: types.Function,
) -> types.Function

Load a Function from its ID.

pub fn load_generated_code_from_i_d(
  id id: types.GeneratedCode,
) -> types.GeneratedCode

Load a GeneratedCode from its ID.

pub fn load_generator_from_i_d(
  id id: types.Generator,
) -> types.Generator

Load a Generator from its ID.

pub fn load_generator_group_from_i_d(
  id id: types.GeneratorGroup,
) -> types.GeneratorGroup

Load a GeneratorGroup from its ID.

pub fn load_git_ref_from_i_d(id id: types.GitRef) -> types.GitRef

Load a GitRef from its ID.

pub fn load_git_repository_from_i_d(
  id id: types.GitRepository,
) -> types.GitRepository

Load a GitRepository from its ID.

pub fn load_host_from_i_d(id id: types.Host) -> types.Host

Load a Host from its ID.

pub fn load_input_type_def_from_i_d(
  id id: types.InputTypeDef,
) -> types.InputTypeDef

Load a InputTypeDef from its ID.

pub fn load_interface_type_def_from_i_d(
  id id: types.InterfaceTypeDef,
) -> types.InterfaceTypeDef

Load a InterfaceTypeDef from its ID.

pub fn load_j_s_o_n_value_from_i_d(
  id id: types.JSONValue,
) -> types.JSONValue

Load a JSONValue from its ID.

pub fn load_l_l_m_from_i_d(id id: types.LLM) -> types.LLM

Load a LLM from its ID.

pub fn load_l_l_m_token_usage_from_i_d(
  id id: types.LLMTokenUsage,
) -> types.LLMTokenUsage

Load a LLMTokenUsage from its ID.

pub fn load_label_from_i_d(id id: types.Label) -> types.Label

Load a Label from its ID.

pub fn load_list_type_def_from_i_d(
  id id: types.ListTypeDef,
) -> types.ListTypeDef

Load a ListTypeDef from its ID.

pub fn load_module_config_client_from_i_d(
  id id: types.ModuleConfigClient,
) -> types.ModuleConfigClient

Load a ModuleConfigClient from its ID.

pub fn load_module_from_i_d(id id: types.Module) -> types.Module

Load a Module from its ID.

pub fn load_module_source_from_i_d(
  id id: types.ModuleSource,
) -> types.ModuleSource

Load a ModuleSource from its ID.

pub fn load_object_type_def_from_i_d(
  id id: types.ObjectTypeDef,
) -> types.ObjectTypeDef

Load a ObjectTypeDef from its ID.

pub fn load_port_from_i_d(id id: types.Port) -> types.Port

Load a Port from its ID.

pub fn load_s_d_k_config_from_i_d(
  id id: types.SDKConfig,
) -> types.SDKConfig

Load a SDKConfig from its ID.

pub fn load_scalar_type_def_from_i_d(
  id id: types.ScalarTypeDef,
) -> types.ScalarTypeDef

Load a ScalarTypeDef from its ID.

pub fn load_search_result_from_i_d(
  id id: types.SearchResult,
) -> types.SearchResult

Load a SearchResult from its ID.

pub fn load_search_submatch_from_i_d(
  id id: types.SearchSubmatch,
) -> types.SearchSubmatch

Load a SearchSubmatch from its ID.

pub fn load_secret_from_i_d(id id: types.Secret) -> types.Secret

Load a Secret from its ID.

pub fn load_service_from_i_d(
  id id: types.Service,
) -> types.Service

Load a Service from its ID.

pub fn load_socket_from_i_d(id id: types.Socket) -> types.Socket

Load a Socket from its ID.

pub fn load_source_map_from_i_d(
  id id: types.SourceMap,
) -> types.SourceMap

Load a SourceMap from its ID.

pub fn load_stat_from_i_d(id id: types.Stat) -> types.Stat

Load a Stat from its ID.

pub fn load_terminal_from_i_d(
  id id: types.Terminal,
) -> types.Terminal

Load a Terminal from its ID.

pub fn load_type_def_from_i_d(
  id id: types.TypeDef,
) -> types.TypeDef

Load a TypeDef from its ID.

pub fn max_a_p_i_calls(opts: Opts, val: Int) -> Opts
pub fn model(opts: Opts, val: String) -> Opts
pub fn module() -> types.Module

Create a new module.

pub fn module_source(
  ref_string ref_string: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.ModuleSource

Create a new module source instance from a source ref string

pub fn name(opts: Opts, val: String) -> Opts
pub fn none(opts: Opts) -> Opts
pub fn permissions(opts: Opts, val: Int) -> Opts
pub fn platform(opts: Opts, val: String) -> Opts
pub fn privileged(opts: Opts, val: Bool) -> Opts
pub fn ref_pin(opts: Opts, val: String) -> Opts
pub fn require_kind(
  opts: Opts,
  val: types.ModuleSourceKind,
) -> Opts
pub fn secret(
  uri uri: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.Secret

Creates a new secret.

pub fn set_secret(
  name name: String,
  plaintext plaintext: String,
) -> types.Secret

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.

pub fn source_map(
  filename filename: String,
  line line: Int,
  column column: Int,
) -> types.SourceMap

Creates source map metadata.

pub fn ssh_auth_socket(opts: Opts, val: types.Socket) -> Opts
pub fn ssh_known_hosts(opts: Opts, val: String) -> Opts
pub fn type_def() -> types.TypeDef

Create a new TypeDef.

pub fn version(
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Get the current Dagger Engine version.

pub fn writable(opts: Opts, val: Bool) -> Opts
Search Document