module
0.0.0-20230101101223-d988c5a63e88
Repository: https://github.com/geekbim/go-elasticsearch.git
Documentation: pkg.go.dev
# README
Go Elasticsearch
Projects Structure
<root>
├── Makefile
├── cmd
│ └── elastic
│ └── main.go
├── docker
│ ├── docker-compose.yaml
│ └── tmp
│ └── elasticsearch
└── internal
├── pkg
│ ├── domain
│ │ └── error.go
│ └── storage
│ ├── elasticsearch
│ │ ├── elasticsearch.go
│ │ └── post_storage.go
│ └── post_storer.go
└── post
├── handler.go
├── request.go
├── response.go
└── service.go
Prerequisites
- Golang (v1.16.4 or above)
- Elasticsearch
Installation
- git clone [email protected]:geekbim/Go-Elasticsearch.git
- sync go modules ->
go mod tidy
- download required modules ->
go mod download
- testing
curl --request POST 'http://localhost:3000/api/v1/posts' \
--data-raw '{
"title": "test title",
"text": "test text",
"tags": ["tag"]
}'
curl --request PATCH 'http://localhost:3000/api/v1/posts/{id}' \
--data-raw '{
"title": "test title x",
"text": "test text x",
"tags": ["tag x"]
}'
curl --request DELETE 'http://localhost:3000/api/v1/posts/{id}'
curl --request GET 'http://localhost:3000/api/v1/posts/{id}'
# Packages
No description provided by the author