Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RESTServer ¶
RESTServer represents a Gort REST API service.
func BuildRESTServer ¶
func BuildRESTServer(addr string) *RESTServer
BuildRESTServer builds a RESTServer.
func (*RESTServer) ListenAndServe ¶
func (s *RESTServer) ListenAndServe() error
ListenAndServe starts the Gort web service.
func (*RESTServer) Requests ¶
func (s *RESTServer) Requests() <-chan RequestEvent
Requests retrieves the channel to which user request events are sent.
type RequestEvent ¶
type RequestEvent struct { Addr string UserID string Timestamp time.Time Request string Status int Size int64 }
RequestEvent represents a request of a service endpoint.
func (RequestEvent) String ¶
func (e RequestEvent) String() string
type StatusCaptureWriter ¶
type StatusCaptureWriter struct { http.ResponseWriter // contains filtered or unexported fields }
StatusCaptureWriter is a wrapper around a http.ResponseWriter that is used by middleware to capture a response status and byte length for logging purposes.
func (StatusCaptureWriter) Header ¶
func (w StatusCaptureWriter) Header() http.Header
Header returns the header map that will be sent by http.WriteHeader.
func (StatusCaptureWriter) Write ¶
func (w StatusCaptureWriter) Write(bytes []byte) (int, error)
Write writes the data to the connection as part of an HTTP reply.
func (StatusCaptureWriter) WriteHeader ¶
func (w StatusCaptureWriter) WriteHeader(statusCode int)
WriteHeader sends an HTTP response header with the provided status code.
Click to show internal directories.
Click to hide internal directories.