Skip to content

Instantly share code, notes, and snippets.

View robertotambunan's full-sized avatar
🏠
Working from home

Roberto Tambunan robertotambunan

🏠
Working from home
View GitHub Profile
import (
"html/template"
"log"
"net/http"
"os"
)
type AllData struct {
Nations []AttributeNationData
}
result := make([]AttributeNationData, 0)
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
log.Println("NewDecoder", err)
}
dataURLNation:= "https://api.kawalcorona.com/"
req, err := http.NewRequest("GET", dataURLNation, nil)
if err != nil {
log.Println("NewRequest: ", err)
return
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
log.Println("Do: ", err)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Corona-Indonesia: Corona Data Today</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
type Member struct {
Name string `json:"name"`
URL string `json:"url"`
}
members = []Member{}
keyword := "r"
indexName : "member"
typeName := "_doc"
client, err := elastic.NewClient(elastic.SetURL("http://localhost:9200"))
if err != nil {
log.Panic(err)
}