View Source Smokestack.Builder behaviour (smokestack v0.9.1)

A generic behaviour for "building things".

Summary

Callbacks

Given a Factory entity and some options build something.

Provide a schema for validating options.

Functions

Find the appropriate factory, validate options and run the builder.

Generate documentation for the available options.

Types

@type error() :: any()
@type result() :: any()
@type t() :: module()

Callbacks

@callback build(Smokestack.Dsl.Factory.t(), Keyword.t()) ::
  {:ok, result()} | {:error, error()}

Given a Factory entity and some options build something.

@callback option_schema(nil | Smokestack.Dsl.Factory.t()) ::
  {:ok, Spark.Options.schema(), String.t()} | {:error, any()}

Provide a schema for validating options.

Functions

Link to this function

build(factory_module, resource, builder, options)

View Source
@spec build(Smokestack.t(), Ash.Resource.t(), t(), Keyword.t()) ::
  {:ok, result()} | {:error, error()}

Find the appropriate factory, validate options and run the builder.

@spec docs(t(), nil | Smokestack.Dsl.Factory.t()) :: String.t()

Generate documentation for the available options.