glitr/service

Types

pub type RouteService(base_type, upsert_type) {
  RouteService(
    root_path: List(String),
    base_converter: option.Option(glitr.JsonConverter(base_type)),
    upsert_converter: option.Option(
      glitr.JsonConverter(upsert_type),
    ),
  )
}

Constructors

  • RouteService(
      root_path: List(String),
      base_converter: option.Option(glitr.JsonConverter(base_type)),
      upsert_converter: option.Option(
        glitr.JsonConverter(upsert_type),
      ),
    )

Functions

pub fn create_route(
  service: RouteService(a, b),
) -> Result(Route(Nil, Nil, b, a), GlitrError)
pub fn delete_route(
  service: RouteService(a, b),
) -> Result(Route(String, Nil, Nil, String), GlitrError)
pub fn get_all_route(
  service: RouteService(a, b),
) -> Result(Route(Nil, Nil, Nil, List(a)), GlitrError)
pub fn get_route(
  service: RouteService(a, b),
) -> Result(Route(String, Nil, Nil, a), GlitrError)
pub fn new() -> RouteService(a, b)
pub fn update_route(
  service: RouteService(a, b),
) -> Result(Route(String, Nil, b, a), GlitrError)
pub fn with_base_converter(
  service: RouteService(a, b),
  base_converter: JsonConverter(a),
) -> RouteService(a, b)
pub fn with_root_path(
  service: RouteService(a, b),
  root_path: List(String),
) -> RouteService(a, b)
pub fn with_upsert_converter(
  service: RouteService(a, b),
  upsert_converter: JsonConverter(b),
) -> RouteService(a, b)
Search Document