eventstore

module
v0.0.0-...-74cc791 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2023 License: MIT

README

Event Store on PostgreSQL

The implementation of event sourced system that uses PostgreSQL as an event store. This repository should use as a template.

How to start

Start infras

./scripts/dev.sh up

Run migration(need to manual create database first)

./scripts/dev.sh migrate

Start service

./scripts/dev.sh start

Other commands

./scripts/dev.sh help

Testing

Place order

curl --location --request POST 'http://localhost:4012/order/place' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customer_id": 123123,
    "price": 10.2
}'

Cancel order

curl --location --request POST 'http://localhost:4012/order/cancel' \
--header 'Content-Type: application/json' \
--data '{
    "order_id": "fe55e443-2426-437a-9656-f2daf01fa2f1"
}'

Get order

curl --location --request GET 'http://localhost:4012/order/fe55e443-2426-437a-9656-f2daf01fa2f1' \
--header 'Content-Type: application/json'

Directories

Path Synopsis
app
cmd
domain
pkg
ev

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL