View Source Dagger.Function (dagger v0.14.0)

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.

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.

Returns the function with the provided argument

Returns the function with the given doc string.

Returns the function with the given source map.

Types

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

Functions

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

Arguments accepted by the function, if any.

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

A doc string for the function, if any.

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

A unique identifier for this Function.

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

The name of the function.

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

The type returned by the function.

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

The location of this function declaration.

Link to this function

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

View Source
@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
) :: t()

Returns the function with the provided argument

Link to this function

with_description(function, description)

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

Returns the function with the given doc string.

Link to this function

with_source_map(function, source_map)

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

Returns the function with the given source map.