Giter VIP home page Giter VIP logo

restate-sdk-go's Introduction

Go Reference Go

Restate Go SDK

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.

Features implemented

  • 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

Basic usage

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)

How to use the example

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

Versions

This library follows Semantic Versioning.

The compatibility with Restate is described in the following table:

Restate Server\sdk-go 0.9
1.0

Contributing

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!

restate-sdk-go's People

Contributors

jackkleeman avatar muhamadazmy avatar slinkydeveloper avatar dependabot[bot] avatar

Stargazers

Albert avatar عين avatar  avatar whoiskatrin avatar Giselle van Dongen avatar Mohammed Mahjoub avatar Till Rohrmann avatar Jan Ehrhardt avatar Khalil Omer avatar Alex Kwiatkowski avatar  avatar Pavel Tcholakov avatar Igal Shilman avatar Christophe de Carvalho avatar Piotr Godek avatar  avatar

Watchers

Till Rohrmann avatar  avatar  avatar  avatar  avatar

restate-sdk-go's Issues

Remove Router terminology

We should get rid of the Router terminology, as we agreed that this is misleading. If a noun is needed anyway, Definition is usually fine.

Enable all tests in test-suite

In order to do so, we need to implement all the services required for it to run: https://github.com/restatedev/sdk-test-suite/tree/v1.4/src/main/kotlin/dev/restate/sdktesting/contracts

You can look at the sample implementations here: https://github.com/restatedev/sdk-java/tree/main/test-services/src/main/kotlin/dev/restate/sdk/testservices

You can check what tests use what services here (in the deployer definition of each test): https://github.com/restatedev/sdk-test-suite/tree/main/src/main/kotlin/dev/restate/sdktesting/tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.