mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-06-20 16:29:31 +00:00
47 lines
2.1 KiB
Plaintext
47 lines
2.1 KiB
Plaintext
; CDDL schema for `my_timer` — auto-generated from ../timer.nim
|
|
; Wire format: CBOR (RFC 8949). Errors return raw UTF-8 (not CBOR) and
|
|
; are intentionally absent from this schema.
|
|
|
|
; ─── User-declared FFI types ──────────────────────────────────────
|
|
TimerConfig = { name: tstr }
|
|
EchoRequest = { message: tstr, delayMs: int }
|
|
EchoResponse = { echoed: tstr, timerName: tstr }
|
|
ComplexRequest = { messages: [* EchoRequest], tags: [* tstr], note: tstr / nil, retries: int / nil }
|
|
ComplexResponse = { summary: tstr, itemCount: int, hasNote: bool }
|
|
EchoEvent = { message: tstr, echoCount: int }
|
|
JobSpec = { name: tstr, payload: [* tstr], priority: int }
|
|
RetryPolicy = { maxAttempts: int, backoffMs: int, retryOn: [* tstr] }
|
|
ScheduleConfig = { startAtMs: int, intervalMs: int, jitter: int / nil }
|
|
ScheduleResult = { jobId: tstr, willRunCount: int, firstRunAtMs: int, effectiveBackoffMs: int }
|
|
|
|
; ─── Request envelopes (one CBOR blob per request) ────────────────
|
|
MyTimerCreateCtorReq = { config: TimerConfig }
|
|
MyTimerEchoReq = { req: EchoRequest }
|
|
MyTimerVersionReq = { }
|
|
MyTimerComplexReq = { req: ComplexRequest }
|
|
MyTimerScheduleReq = { job: JobSpec, retry: RetryPolicy, schedule: ScheduleConfig }
|
|
|
|
; ─── Procs ─────────────────────────────────────────────────────────
|
|
; my_timer_create (ctor)
|
|
my_timer_create-request = MyTimerCreateCtorReq
|
|
my_timer_create-response = tstr
|
|
|
|
; my_timer_echo (ffi)
|
|
my_timer_echo-request = MyTimerEchoReq
|
|
my_timer_echo-response = EchoResponse
|
|
|
|
; my_timer_version (ffi)
|
|
my_timer_version-request = MyTimerVersionReq
|
|
my_timer_version-response = tstr
|
|
|
|
; my_timer_complex (ffi)
|
|
my_timer_complex-request = MyTimerComplexReq
|
|
my_timer_complex-response = ComplexResponse
|
|
|
|
; my_timer_schedule (ffi)
|
|
my_timer_schedule-request = MyTimerScheduleReq
|
|
my_timer_schedule-response = ScheduleResult
|
|
|
|
; my_timer_destroy (dtor)
|
|
my_timer_destroy-response = nil
|