linkinfo/main.go

33 lines
591 B
Go
Raw Normal View History

2019-10-03 23:44:38 +00:00
package main
import (
"net/http"
"time"
)
var (
client *http.Client
)
type LinkInfo struct {
Title string `json:"title"`
Description string `json:"description"`
ContentType string `json:"type"`
ContentLength int64 `json:"contentLength"`
Duration string `json:"duration,omitempty"`
Redirects []string `json:"redirects,omitempty"`
}
func main() {
client = &http.Client{
Timeout: 10 * time.Second,
}
mux := http.NewServeMux()
mux.HandleFunc("/info", handleInfoRequest)
http.ListenAndServe(":8080", mux)
}
func handleInfoRequest(w http.ResponseWriter, r *http.Request) {
}