View Source Dagger.Function (dagger v0.9.11)

Function represents a resolver provided by a Module.

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

Link to this section 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.

Returns the function with the provided argument

Returns the function with the given doc string.

Link to this section Types

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

Link to this section Functions

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

Arguments accepted by the function, if any.

@spec description(t()) :: {:ok, Dagger.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, Dagger.String.t()} | {:error, term()}

The name of the function.

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

The type returned by the function.

Link to this function

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

View Source
@spec with_arg(t(), Dagger.String.t(), Dagger.TypeDef.t(), keyword()) :: t()

Returns the function with the provided argument

required-arguments

Required Arguments

  • name - The name of the argument
  • type_def - The type of the argument

optional-arguments

Optional Arguments

  • description - A doc string for the argument, if any
  • default_value - A default value to use for this argument if not explicitly set by the caller, if any
Link to this function

with_description(function, description)

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

Returns the function with the given doc string.

required-arguments

Required Arguments

  • description - The doc string to set.