Go to file
Emery Hemingway bac6984d7c Use the gatekeeper protocol for configuration 2024-06-02 00:03:46 +03:00
src Use the gatekeeper protocol for configuration 2024-06-02 00:03:46 +03:00
.envrc Pass arguments over stdio 2023-11-17 09:49:05 +02:00
.gitignore Pass arguments over stdio 2023-11-17 09:49:05 +02:00
README.md Use the gatekeeper protocol for configuration 2024-06-02 00:03:46 +03:00
Tupfile Replace Nimble with CycloneDX 2024-06-01 13:00:33 +03:00
Tuprules.tup Syndicate API update 2024-04-08 12:25:14 +01:00
sbom.json Replace Nimble with CycloneDX 2024-06-01 13:00:33 +03:00
schema.prs Use the gatekeeper protocol for configuration 2024-06-02 00:03:46 +03:00
shell.nix Pass arguments over stdio 2023-11-17 09:49:05 +02:00
tonaltime.nimble Replace Nimble with CycloneDX 2024-06-01 13:00:33 +03:00

README.md

Tonaltime

A Syndicated clock actor.

Publishes the current Tonal time with 8_00_0 aligned to solar noon local to the given coordinates.

  • <tonaltime @raw int @hex string>

Four solar assertions are published in traditational local time.

  • <midnight <rfc3339 @hh:mm:ss string>>
  • <sunrise <rfc3339 @hh:mm:ss string>>
  • <noon <rfc3339 @hh:mm:ss string>>
  • <sunset <rfc3339 @hh:mm:ss string>>

The actor implements the gatekeeper protocol. Use a step in the form <tonaltime { lat: 00.000 lon: 00.000 }> to resove to a dataspace where the clock and solar assertions are made.

Example

Configuration

# syndicate-server configuration

# Listen on a Unix socket.
<require-service <relay-listener <unix "/run/user/1000/syndicate"> $gatekeeper>>

# Create a dataspace for resolving services.
let ?servicespace = dataspace

# Bind that dataspace with a sturdyref.
<bind <ref { oid: services key: #x"" }> $servicespace #f>

# Observe resolve requests.
$servicespace ? <resolve <tonaltime ?detail> ?obs> [
  # Start the daemon.
  $config <require-service <daemon tonaltime>>

  # Forward the request onto the daemon.
  $config ? <service-object <daemon tonaltime> ?cap> [
    $cap <resolve <tonaltime $detail> $obs>
  ]
]

# Specify how the daemon is started.
<daemon tonaltime {
  argv: "tonaltime"
  protocol: application/syndicate
  clearEnv: #t
}>

Access

To access the service configured above use the route <route [<unix "/run/user/1000/syndicate">] <ref {oid: services sig: #x"279857dc7ab625a174a797934cea4f2d"}> <tonaltime { lon: 15.0 lat: 55.1 }>>