Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keisku/containized-firestore
Sample golang app with container firestore.
https://github.com/keisku/containized-firestore
Last synced: 28 days ago
JSON representation
Sample golang app with container firestore.
- Host: GitHub
- URL: https://github.com/keisku/containized-firestore
- Owner: keisku
- License: mit
- Created: 2020-11-27T13:16:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-07T04:33:40.000Z (almost 4 years ago)
- Last Synced: 2023-07-11T01:22:53.935Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# containized-firestore
Sample golang app with container firestore.
## How to start
```
$ make build
$ make up
$ make logs
```## How to end
```
$ make down
```## How to dump
```
$ make dump-----------------------------------
accounts
-----------------------------------
[0] 3c346b57-21bf-4514-b5df-857ef23ca030: map[account_id:test001 mail:[email protected]]
[1] 42e677c7-9d46-4ef4-a9a4-040c38c27d36: map[account_id:test002 mail:[email protected]]
[2] fdc3edf5-bb49-4de1-abc6-1b36dd34a3e5: map[account_id:test003 mail:[email protected]]
```## API Endpoints
### `GET /account`
Request
```
curl --location --request GET 'http://localhost:5000/account/'
```Response
```
[{"user_id":"3c346b57-21bf-4514-b5df-857ef23ca030","account_id":"test001","mail":"[email protected]"},{"user_id":"42e677c7-9d46-4ef4-a9a4-040c38c27d36","account_id":"test002","mail":"[email protected]"},{"user_id":"830eed95-25b4-4342-9c3b-fbf8a054f607","account_id":"kskumgk63","mail":"[email protected]"},{"user_id":"fdc3edf5-bb49-4de1-abc6-1b36dd34a3e5","account_id":"test003","mail":"[email protected]"}]
```### `GET /account/{id}`
Request
```
curl --location --request GET 'http://localhost:5000/account/830eed95-25b4-4342-9c3b-fbf8a054f607'
```Response
```
{"user_id":"830eed95-25b4-4342-9c3b-fbf8a054f607","account_id":"kskumgk63","mail":"[email protected]"}
```### `POST /account`
Request
```
curl --location --request POST 'http://localhost:5000/account' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "kskumgk63",
"mail": "[email protected]"
}'
```Response
```
{"user_id":"830eed95-25b4-4342-9c3b-fbf8a054f607","account_id":"kskumgk63","mail":"[email protected]"}
```### `POST /account/{id}`
Request
```
curl --location --request POST 'http://localhost:5000/account/830eed95-25b4-4342-9c3b-fbf8a054f607' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "update",
"mail": "[email protected]"
}'
```Response
```
204 No Content
```### `DELETE /account/{id}`
Request
```
curl --location --request DELETE 'http://localhost:5000/account/830eed95-25b4-4342-9c3b-fbf8a054f607'
```Response
```
204 No Content
```