Restate is a system for easily building resilient applications using distributed durable async/await. This repository contains the Restate SDK for writing services in Golang. This SDK has not yet seen a stable release and APIs are subject to change. Feedback is welcome via issues and in Discord.
- Log replay (resume of execution on failure)
- State (set/get/clear/clear-all/keys)
- Remote service call over restate runtime
- Delayed execution of remote services
- Sleep
- Run
- Awakeable
- Shared object handlers
- Workflows
Please check example for a fully working example based on the [TypeScript ticket reservation example] (https://github.com/restatedev/examples/tree/main/patterns-use-cases/ticket-reservation/ticket-reservation-typescript)
Download and run restate v1.x
restate-server
In another terminal run the example
cd restate-sdk-go/example
go run .
In a third terminal register:
restate deployments register --force -y http://localhost:9080
And do the following steps
- Add tickets to basket
curl -v localhost:8080/UserSession/azmy/AddTicket \
-H 'content-type: application/json' \
-d '"ticket-1"'
# true
curl -v localhost:8080/UserSession/azmy/AddTicket \
-H 'content-type: application/json' \
-d '"ticket-2"'
# true
Trying adding the same tickets again should return false
since they are already reserved. If you didn't check out the tickets in 15min (if you are impatient change the delay in code to make it shorter)
- Check out
curl localhost:8080/UserSession/azmy/Checkout
# true
This library follows Semantic Versioning.
The compatibility with Restate is described in the following table:
Restate Server\sdk-go | 0.9 |
---|---|
1.0 | ✅ |
We’re excited if you join the Restate community and start contributing! Whether it is feature requests, bug reports, ideas & feedback or PRs, we appreciate any and all contributions. We know that your time is precious and, therefore, deeply value any effort to contribute!