Dagger.Module (dagger v0.19.4)

View Source

A Dagger module.

Summary

Functions

The dependencies of the module.

The doc string of the module, if any

Enumerations served by this module.

The generated files and directories made on top of the module source's context directory.

A unique identifier for this Module.

Interfaces served by this module.

The introspection schema JSON file for this module.

The name of the module

Objects served by this module.

The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.

The SDK config used by this module.

Serve a module's API in the current session.

The source for the module.

Forces evaluation of the module, including any loading into the engine and associated validation.

User-defined default values, loaded from local .env files.

Retrieves the module with the given description

This module plus the given Enum type and associated values

This module plus the given Interface type and associated functions

This module plus the given Object type and associated functions.

Types

t()

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

Functions

dependencies(module)

@spec dependencies(t()) :: {:ok, [t()]} | {:error, term()}

The dependencies of the module.

description(module)

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

The doc string of the module, if any

enums(module)

@spec enums(t()) :: {:ok, [Dagger.TypeDef.t()]} | {:error, term()}

Enumerations served by this module.

generated_context_directory(module)

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

The generated files and directories made on top of the module source's context directory.

id(module)

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

A unique identifier for this Module.

interfaces(module)

@spec interfaces(t()) :: {:ok, [Dagger.TypeDef.t()]} | {:error, term()}

Interfaces served by this module.

introspection_schema_json(module)

@spec introspection_schema_json(t()) :: Dagger.File.t()

The introspection schema JSON file for this module.

This file represents the schema visible to the module's source code, including all core types and those from the dependencies.

Note: this is in the context of a module, so some core types may be hidden.

name(module)

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

The name of the module

objects(module)

@spec objects(t()) :: {:ok, [Dagger.TypeDef.t()]} | {:error, term()}

Objects served by this module.

runtime(module)

@spec runtime(t()) :: Dagger.Container.t()

The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.

sdk(module)

@spec sdk(t()) :: Dagger.SDKConfig.t() | nil

The SDK config used by this module.

serve(module, optional_args \\ [])

@spec serve(t(), [{:include_dependencies, boolean() | nil}]) :: :ok | {:error, term()}

Serve a module's API in the current session.

Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.

source(module)

@spec source(t()) :: Dagger.ModuleSource.t() | nil

The source for the module.

sync(module)

@spec sync(t()) :: {:ok, t()} | {:error, term()}

Forces evaluation of the module, including any loading into the engine and associated validation.

user_defaults(module)

@spec user_defaults(t()) :: Dagger.EnvFile.t()

User-defined default values, loaded from local .env files.

with_description(module, description)

@spec with_description(t(), String.t()) :: t()

Retrieves the module with the given description

with_enum(module, enum)

@spec with_enum(t(), Dagger.TypeDef.t()) :: t()

This module plus the given Enum type and associated values

with_interface(module, iface)

@spec with_interface(t(), Dagger.TypeDef.t()) :: t()

This module plus the given Interface type and associated functions

with_object(module, object)

@spec with_object(t(), Dagger.TypeDef.t()) :: t()

This module plus the given Object type and associated functions.