View Source Smokestack.Builder behaviour (smokestack v0.6.1-rc.0)

A generic behaviour for "building things".

Summary

Callbacks

Given a Factory entity and some options build something.

Provide a schema for validating options.

Functions

Given a builder and a factory, validate it's options and call 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()} | {:error, any()}

Provide a schema for validating options.

Functions

Link to this function

build(builder, factory, options)

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

Given a builder and a factory, validate it's options and call the builder.

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

Generate documentation for the available options.