AshBoundary.Info (ash_boundary v0.1.0)

Copy Markdown View Source

Introspection for domains extended with AshBoundary.

Each function accepts a compiled domain module or the in-progress Spark.Dsl.t/0 map a transformer receives.

Summary

Types

A deps entry, in one of the two forms the DSL accepts.

A domain module, or the DSL state of one still being compiled.

Functions

The check declared in the boundary section, exactly as written.

The exports declared in the boundary section, exactly as written.

The module named by a single deps entry.

The modules named by deps/1, with any {module, type} pairs unwrapped.

The deps declared in the boundary section, exactly as written.

The dirty_xrefs declared in the boundary section, exactly as written.

The modules this domain exports: the domain module, each resource with at least one domain-level define, and the modules named by declared_exports/1.

The domain module, from the module itself or from its DSL state.

Every resource the domain references, exported and internal.

The type declared in the boundary section, exactly as written.

Types

dep()

@type dep() :: module() | {module(), :compile | :runtime}

A deps entry, in one of the two forms the DSL accepts.

domain()

@type domain() :: Spark.Dsl.t() | Ash.Domain.t()

A domain module, or the DSL state of one still being compiled.

Functions

check(domain)

@spec check(domain()) :: keyword() | nil

The check declared in the boundary section, exactly as written.

Returns nil for a domain with no check option, so it is left out of the declaration passed to boundary rather than replacing boundary's own default.

declared_exports(domain)

@spec declared_exports(domain()) :: [module()]

The exports declared in the boundary section, exactly as written.

Returns [] for a domain with no boundary section.

dep_module(module)

@spec dep_module(dep()) :: module()

The module named by a single deps entry.

Examples

iex> AshBoundary.Info.dep_module(MyApp.Accounts)
MyApp.Accounts

iex> AshBoundary.Info.dep_module({MyApp.Accounts, :compile})
MyApp.Accounts

dep_modules(domain)

@spec dep_modules(domain()) :: [module()]

The modules named by deps/1, with any {module, type} pairs unwrapped.

deps(domain)

@spec deps(domain()) :: [dep()]

The deps declared in the boundary section, exactly as written.

Returns [] for a domain with no boundary section.

dirty_xrefs(domain)

@spec dirty_xrefs(domain()) :: [module()]

The dirty_xrefs declared in the boundary section, exactly as written.

Returns [] for a domain with no boundary section.

exports(domain)

@spec exports(domain()) :: [module()]

The modules this domain exports: the domain module, each resource with at least one domain-level define, and the modules named by declared_exports/1.

The domain module leads the list. boundary exports a boundary's root module implicitly, so AshBoundary.Declaration drops it when it installs the declaration. See AshBoundary.Declaration.relative_exports/2.

module(domain)

@spec module(domain()) :: module()

The domain module, from the module itself or from its DSL state.

resources(domain)

@spec resources(domain()) :: [module()]

Every resource the domain references, exported and internal.

type(domain)

@spec type(domain()) :: :strict | :relaxed | nil

The type declared in the boundary section, exactly as written.

Returns nil for a domain with no type option, so it is left out of the declaration passed to boundary rather than replacing boundary's own default.