package main

import (
	"net/http"
	"time"
)

type TimeHandler struct{}

func (th TimeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte(time.Now().Format(time.RFC3339)))
}

func main() {
	server := http.Server{
		Addr:         ":10100",
		ReadTimeout:  30 * time.Second,
		WriteTimeout: 90 * time.Second,
		IdleTimeout:  120 * time.Second,
		Handler:      TimeHandler{},
	}
	err := server.ListenAndServe()
	if err != nil {
		if err != http.ErrServerClosed {
			panic(err)
		}
	}
}
