Code Monkey home page Code Monkey logo

userie's Introduction

Architecture

image

Set up env

Install and run Elastic search

  1. Install and start Docker Desktop
  2. Run
    docker network create elastic
    docker pull docker.elastic.co/elasticsearch/elasticsearch:7.13.2
    docker run --name es01-test --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.13.2
    
  3. To verify it is running successfully
    curl -X GET http://localhost:9200
    

Install and run Kibana

  1. In a new terminal session, run
    docker pull docker.elastic.co/kibana/kibana:7.13.2
    docker run --name kib01-test --net elastic -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://es01-test:9200" docker.elastic.co/kibana/kibana:7.13.2
    
  2. To access Kibana, go to http://localhost:5601/app/dev_tools#/console

Add mapping in Kibana

  1. Create index
    PUT /usersg0
    
  2. Add mapping
    PUT /usersg0/_mapping
    {
      "properties": {
        "name": {
          "type": "text"
        },
        "dob": {
          "type": "long"
        },
        "address": {
          "type": "text"
        },
        "description": {
          "type": "text"
        },
        "ctime": {
          "type": "long"
        }
      }
    }
    

Install and start tracer (logging)

  1. Run
    docker pull jaegertracing/all-in-one
    docker run -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:latest
    
  2. Go to http://localhost:16686/ to see traces

Start server

There are 2 options to start the server

  1. Build and run
    go build main.go
    nohup ./UserSearch &
    
  2. Run locally
    go run main.go
    

Testing

  1. Testing api
    cd api
    go test Test -v
    
  2. Testing dao
    cd dao
    go test Test -v
    

userie's People

Contributors

metildachee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.