Update to build in meta-repo
This commit is contained in:
parent
7c9765fd23
commit
4b3c8cfa98
|
@ -0,0 +1,5 @@
|
||||||
|
include_rules
|
||||||
|
modules += json_socket_translator.nim
|
||||||
|
modules += json_translator.nim
|
||||||
|
modules += msg.nim
|
||||||
|
: foreach $(modules) | $(SYNDICATE_PROTOCOL) ./<schema> |> !nim_bin |>
|
|
@ -37,7 +37,7 @@ bootDataspace("main") do (ds: Ref; turn: var Turn):
|
||||||
pathPrefixMaxLen = 0
|
pathPrefixMaxLen = 0
|
||||||
requestIdSource = 0
|
requestIdSource = 0
|
||||||
|
|
||||||
during(turn, ds, ?Handler[Ref]) do (methods: Methods; path: seq[string]; entity: Ref):
|
during(turn, ds, ?Handler) do (methods: Methods; path: seq[string]; entity: Ref):
|
||||||
handlers[path] = (entity, methods.toHttpCore)
|
handlers[path] = (entity, methods.toHttpCore)
|
||||||
pathPrefixMaxLen = max(pathPrefixMaxLen, path.len)
|
pathPrefixMaxLen = max(pathPrefixMaxLen, path.len)
|
||||||
do:
|
do:
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
import std/[asyncdispatch, os]
|
import std/[asyncdispatch, os]
|
||||||
from std/sequtils import map
|
|
||||||
import preserves, syndicate, syndicate/capabilities
|
import preserves, syndicate, syndicate/capabilities
|
||||||
|
|
||||||
proc unixSocketPath: string =
|
proc unixSocketPath: string =
|
||||||
|
@ -12,7 +11,7 @@ proc unixSocketPath: string =
|
||||||
|
|
||||||
proc mintCap: SturdyRef =
|
proc mintCap: SturdyRef =
|
||||||
var key: array[16, byte]
|
var key: array[16, byte]
|
||||||
mint(key, "syndicate")
|
mint(key, toPreserve("syndicate", Ref))
|
||||||
|
|
||||||
bootDataspace("main") do (root: Ref; turn: var Turn):
|
bootDataspace("main") do (root: Ref; turn: var Turn):
|
||||||
let label = getAppFilename().extractFilename
|
let label = getAppFilename().extractFilename
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
include_rules
|
include_rules
|
||||||
: foreach ../../*.prs |> !preserves_schema_nim |> %B.nim
|
: foreach ../../*.prs |> !preserves_schema_nim |> %B.nim | ../<schema>
|
||||||
|
|
|
@ -1,44 +1,38 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
std/typetraits, preserves, std/tables, std/sets
|
std/typetraits, preserves, std/tables
|
||||||
|
|
||||||
type
|
type
|
||||||
Path* = seq[string]
|
Path* = seq[string]
|
||||||
Headers* = TableRef[string, seq[string]]
|
Headers* = Table[string, seq[string]]
|
||||||
Response* {.preservesRecord: "http".} = object
|
Response* {.preservesRecord: "http".} = object
|
||||||
`handle`*: int
|
`handle`*: BiggestInt
|
||||||
`code`*: int
|
`code`*: BiggestInt
|
||||||
`headers`*: Headers
|
`headers`*: Headers
|
||||||
`body`*: string
|
`body`*: string
|
||||||
|
|
||||||
Listener* {.preservesRecord: "listen".} = object
|
Listener* {.preservesRecord: "listen".} = object
|
||||||
`port`*: int
|
`port`*: BiggestInt
|
||||||
|
|
||||||
Handler*[E] {.preservesRecord: "handler".} = ref object
|
Handler* {.preservesRecord: "handler".} = object
|
||||||
`methods`*: Methods
|
`methods`*: Methods
|
||||||
`path`*: Path
|
`path`*: Path
|
||||||
`entity`*: Preserve[E]
|
`entity`* {.preservesEmbedded.}: Preserve[void]
|
||||||
|
|
||||||
`Method`* {.preservesOr, pure.} = enum
|
`Method`* {.preservesOr, pure.} = enum
|
||||||
`GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `CONNECT`, `OPTIONS`, `TRACE`,
|
`GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `CONNECT`, `OPTIONS`, `TRACE`,
|
||||||
`PATCH`
|
`PATCH`
|
||||||
Request* {.preservesRecord: "http".} = object
|
Request* {.preservesRecord: "http".} = object
|
||||||
`handle`*: int
|
`handle`*: BiggestInt
|
||||||
`method`*: Method
|
`method`*: Method
|
||||||
`headers`*: Headers
|
`headers`*: Headers
|
||||||
`path`*: Path
|
`path`*: Path
|
||||||
`body`*: string
|
`body`*: string
|
||||||
|
|
||||||
Methods* = HashSet[Method]
|
Methods* = set[Method]
|
||||||
proc `$`*[E](x: Handler[E]): string =
|
proc `$`*(x: Path | Headers | Response | Listener | Handler | Request | Methods): string =
|
||||||
`$`(toPreserve(x, E))
|
|
||||||
|
|
||||||
proc encode*[E](x: Handler[E]): seq[byte] =
|
|
||||||
encode(toPreserve(x, E))
|
|
||||||
|
|
||||||
proc `$`*(x: Path | Headers | Response | Listener | Request | Methods): string =
|
|
||||||
`$`(toPreserve(x))
|
`$`(toPreserve(x))
|
||||||
|
|
||||||
proc encode*(x: Path | Headers | Response | Listener | Request | Methods): seq[
|
proc encode*(x: Path | Headers | Response | Listener | Handler | Request |
|
||||||
byte] =
|
Methods): seq[byte] =
|
||||||
encode(toPreserve(x))
|
encode(toPreserve(x))
|
||||||
|
|
|
@ -3,16 +3,16 @@ import
|
||||||
std/typetraits, preserves
|
std/typetraits, preserves
|
||||||
|
|
||||||
type
|
type
|
||||||
Notify*[E] {.preservesRecord: "notify".} = ref object
|
Notify* {.preservesRecord: "notify".} = object
|
||||||
`summary`*: string
|
`summary`*: string
|
||||||
`body`*: Preserve[E]
|
`body`*: Preserve[void]
|
||||||
`timeout`*: int
|
`timeout`*: BiggestInt
|
||||||
`urgency`*: Urgency
|
`urgency`*: Urgency
|
||||||
|
|
||||||
`Urgency`* {.preservesOr, pure.} = enum
|
`Urgency`* {.preservesOr, pure.} = enum
|
||||||
`Low`, `Normal`, `Critical`
|
`Low`, `Normal`, `Critical`
|
||||||
proc `$`*[E](x: Notify[E]): string =
|
proc `$`*(x: Notify): string =
|
||||||
`$`(toPreserve(x, E))
|
`$`(toPreserve(x))
|
||||||
|
|
||||||
proc encode*[E](x: Notify[E]): seq[byte] =
|
proc encode*(x: Notify): seq[byte] =
|
||||||
encode(toPreserve(x, E))
|
encode(toPreserve(x))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "99999999"
|
version = "20230301"
|
||||||
author = "Emery Hemingway"
|
author = "Emery Hemingway"
|
||||||
description = "Utilites for Syndicated Actors and Synit"
|
description = "Utilites for Syndicated Actors and Synit"
|
||||||
license = "unlicense"
|
license = "unlicense"
|
||||||
|
|
Loading…
Reference in New Issue