Categorygithub.com/geekbim/Go-Elasticsearch
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

  1. Golang (v1.16.4 or above)
  2. Elasticsearch

Installation

  1. git clone [email protected]:geekbim/Go-Elasticsearch.git
  2. sync go modules -> go mod tidy
  3. download required modules -> go mod download
  4. 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