Dagger.Function (dagger v0.20.7)

Copy Markdown View Source

Function represents a resolver provided by a Module.

A function always evaluates against a parent object and is given a set of named arguments.

Summary

Functions

Arguments accepted by the function, if any.

The reason this function is deprecated, if any.

A doc string for the function, if any.

A unique identifier for this Function.

The name of the function.

The type returned by the function.

The location of this function declaration.

If this function is provided by a module, the name of the module. Unset otherwise.

Returns the function with the provided argument

Returns the function updated to use the provided cache policy.

Returns the function with a flag indicating it's a check.

Returns the function with the provided deprecation reason.

Returns the function with the given doc string.

Returns the function with a flag indicating it's a generator.

Returns the function with the given source map.

Returns the function with a flag indicating it returns a service for dagger up.

Types

t()

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

Functions

args(function)

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

Arguments accepted by the function, if any.

deprecated(function)

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

The reason this function is deprecated, if any.

description(function)

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

A doc string for the function, if any.

id(function)

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

A unique identifier for this Function.

name(function)

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

The name of the function.

return_type(function)

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

The type returned by the function.

source_map(function)

@spec source_map(t()) :: Dagger.SourceMap.t() | nil

The location of this function declaration.

source_module_name(function)

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

If this function is provided by a module, the name of the module. Unset otherwise.

with_arg(function, name, type_def, optional_args \\ [])

@spec with_arg(t(), String.t(), Dagger.TypeDef.t(),
  description: String.t() | nil,
  default_value: Dagger.JSON.t() | nil,
  default_path: String.t() | nil,
  ignore: [String.t()],
  source_map: Dagger.SourceMapID.t() | nil,
  deprecated: String.t() | nil,
  default_address: String.t() | nil
) :: t()

Returns the function with the provided argument

with_cache_policy(function, policy, optional_args \\ [])

@spec with_cache_policy(t(), Dagger.FunctionCachePolicy.t(), [
  {:time_to_live, String.t() | nil}
]) :: t()

Returns the function updated to use the provided cache policy.

with_check(function)

@spec with_check(t()) :: t()

Returns the function with a flag indicating it's a check.

with_deprecated(function, optional_args \\ [])

@spec with_deprecated(t(), [{:reason, String.t() | nil}]) :: t()

Returns the function with the provided deprecation reason.

with_description(function, description)

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

Returns the function with the given doc string.

with_generator(function)

@spec with_generator(t()) :: t()

Returns the function with a flag indicating it's a generator.

with_source_map(function, source_map)

@spec with_source_map(t(), Dagger.SourceMap.t()) :: t()

Returns the function with the given source map.

with_up(function)

@spec with_up(t()) :: t()

Returns the function with a flag indicating it returns a service for dagger up.