Maru v0.10.0 Maru.Builder.DSLs

General DSLs for parsing router.

Summary

Macros

Define plugs which execute before routes match

Define description do current endpoint

Mount another router to current router

Define params block of current endpoint

Save shared param to module attribute

Define pipeline block of current endpoint

Push a Plug struct to current scope

Push a Plug struct with options and guards to current scope

Push a overridable Plug struct to current scope

Push a overridable Plug struct with options and guards to current scope

Define path prefix of current router

Define version of current router

version: “v1”, do … end: Version of routes within block

Macros

before(list)

Define plugs which execute before routes match.

desc(desc)

Define description do current endpoint.

helpers(arg1)
mount(arg)

Mount another router to current router.

params(list)

Define params block of current endpoint.

params(name, list)

Save shared param to module attribute.

pipeline(block)

Define pipeline block of current endpoint.

plug(plug)

Push a Plug struct to current scope.

plug(plug, opts)

Push a Plug struct with options and guards to current scope.

plug_overridable(name, plug)

Push a overridable Plug struct to current scope.

plug_overridable(name, plug, opts)

Push a overridable Plug struct with options and guards to current scope.

prefix(path)

Define path prefix of current router.

version(v)

Define version of current router.

version(v, opts)

version: “v1”, do … end: Version of routes within block.

version: “v2”, extend: “v1”, at: V1 Define version and extended router of current router.