33 lines
591 B
Go
33 lines
591 B
Go
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) {
|
|
|
|
} |