Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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
```