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

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

error()

@type error() :: any()

result()

@type result() :: any()

t()

@type t() :: module()

Callbacks

build(t, t)

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

Given a Factory entity and some options build something.

option_schema(arg1)

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

Provide a schema for validating options.

Functions

build(factory_module, resource, builder, options)

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

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

docs(builder, factory)

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

Generate documentation for the available options.