yumemi/gen/reader

★ の読み取り。types.gleam / entity/.gleam / service/.gleam から model を起こす。 ここに現れる名前は全部 ★ から来る ── アプリ固有の綴りは1つも持たない。

Types

pub type Error {
  NoTypesModule
  NoKeyFunction(module: String)
  NoEntityType(module: String)
  Unsupported(where: String, detail: String)
  Vocabulary(where: String, detail: String)
  Internal(where: String, detail: String)
}

Constructors

  • NoTypesModule
  • NoKeyFunction(module: String)
  • NoEntityType(module: String)
  • Unsupported(where: String, detail: String)
  • Vocabulary(where: String, detail: String)
  • Internal(where: String, detail: String)

Values

pub fn arrows(entities: List(model.Entity)) -> List(model.Arrow)

矢印。関係 Property 1つにつき1本。逆向きは作らない(20:681)。

pub fn collections(
  units: List(source.Unit),
) -> Result(List(model.Collection), Error)

Entity でないトップレベル module の pub const collection: String。 entity/ と service/ の下は ER / Service の読み取りが所有するため、 ここでは拾わない。

pub fn entities(
  units: List(source.Unit),
) -> Result(List(model.Entity), Error)
pub fn entry_declarations(
  units: List(source.Unit),
) -> Result(List(model.Entry), Error)

入口は無い古い fixture も reader の他の束を検査できるように、entry.gleam が無ければ 空で返す。entry.gleam がある場合は entries を全て読み、route 束はそこからだけ導く。

pub fn entry_notes(app: model.App) -> List(stop.Note)

入口と Service の結びを検査する。faces の不足は Service ごとに名指しするため、 reader の単一 Result ではなく全件の Note として返す。

pub fn missing_key_notes(
  units: List(source.Unit),
) -> List(stop.Note)
pub fn read(units: List(source.Unit)) -> Result(model.App, Error)
pub fn services(
  units: List(source.Unit),
) -> Result(List(model.Service), Error)
pub fn value_types(
  units: List(source.Unit),
) -> Result(List(model.ValueType), Error)
✨ Search Document