Documentation ¶
Index ¶
Constants ¶
const CommonAPIDataDateFormat = "Mon Jan 02 15:04:05 UTC 2006"
CommonAPIDataDataFormat is a common Date format for the API
Variables ¶
This section is empty.
Functions ¶
func DateStr ¶
DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
func GetCommonAPIData ¶
GetCommonAPIData calculates and returns API data common to most endpoints
func ParametersStr ¶
ParametersStr takes the URL query parameters, and returns a string as used by the Traffic Monitor 1.0 endpoints "pp" key.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a re-runnable HTTP server. Server.Run() may be called repeatedly, and each time the previous running server will be stopped, and the server will be restarted with the new port address and data request channel.
func (*Server) Run ¶
func (s *Server) Run(endpoints map[string]http.HandlerFunc, addr string, readTimeout time.Duration, writeTimeout time.Duration, staticFileDir string, tls bool, certFile string, keyFile string) error
Run runs a new HTTP service at the given addr, making data requests to the given c. Run may be called repeatedly, and each time, will shut down any existing service first. Run is NOT threadsafe, and MUST NOT be called concurrently by multiple goroutines.