This is the elixir version of aws clock bound client, to communicate with this service.
Make sure the service is running correctly.
By adding ex_clock_bound_client
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_clock_bound_client, "~> 0.0.1"}
]
end
All configurations are runtime configuration, and have default values.
import Config
config :ex_clock_bound_client,
clock_bound_socket_path: "/run/clockboundd/clockboundd.sock",
client_socket_path: Path.expand("./client.sock"),
recv_timeout: 100, # socket recv timeout
frequency_error: 1 # Setting clock frequency to 1ppm to match chrony
There are 5 APIs in this library, and additional deviation/0
are added compared to the official client.
ExCloudBoundClient.now/0
ExCloudBoundClient.timing/1
ExCloudBoundClient.deviation/0
ExCloudBoundClient.before?/1
ExCloudBoundClient.after?/1
See t:ExClockBoundClient
for details.
This application is just implement a happy path, all exceptions need to be considered.