+
Skip to content

coolkp/GO_dock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Backend Elastic Client

Setup

  • Requirements

    • Elasticsearchdb
    • Imports listed in import section
import (
 "context"
"log"
// "encoding/json"
"fmt"
"net/http"
"math"
"reflect"
"strconv"
"time"
elastic "gopkg.in/olivere/elastic.v5"
"github.com/speps/go-hashids"
 "github.com/gin-gonic/gin"
 "github.com/gin-contrib/cors"

)

go get github.com/speps/go-hashids
github.com/gin-gonic/gin
github.com/gin-contrib/cors

Build & Run

elasticsearch
go build main.go
./main

Endpoints

  • Create (Generate short url in DB)
  • Get short url (Get)
  • ** Get original Url**
    • URL a href> localhost:8000/redirect/:hash
    • Data Contract
      • Method - GET
      • Response type JSON {url:""}

About

dockerize

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载