mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
9f85b74fc9
Former-commit-id: da4f38eb9034daa49446df3ee529423b98f9b331
36 lines
1.5 KiB
Go
36 lines
1.5 KiB
Go
// +build go1.9
|
|
|
|
package iris
|
|
|
|
import (
|
|
"github.com/kataras/iris/context"
|
|
)
|
|
|
|
type (
|
|
// Context is the midle-man server's "object" for the clients.
|
|
//
|
|
// A New context is being acquired from a sync.Pool on each connection.
|
|
// The Context is the most important thing on the iris's http flow.
|
|
//
|
|
// Developers send responses to the client's request through a Context.
|
|
// Developers get request information from the client's request by a Context.
|
|
Context = context.Context
|
|
// A Handler responds to an HTTP request.
|
|
// It writes reply headers and data to the Context.ResponseWriter() and then return.
|
|
// Returning signals that the request is finished;
|
|
// it is not valid to use the Context after or concurrently with the completion of the Handler call.
|
|
//
|
|
// Depending on the HTTP client software, HTTP protocol version,
|
|
// and any intermediaries between the client and the iris server,
|
|
// it may not be possible to read from the Context.Request().Body after writing to the context.ResponseWriter().
|
|
// Cautious handlers should read the Context.Request().Body first, and then reply.
|
|
//
|
|
// Except for reading the body, handlers should not modify the provided Context.
|
|
//
|
|
// If Handler panics, the server (the caller of Handler) assumes that the effect of the panic was isolated to the active request.
|
|
// It recovers the panic, logs a stack trace to the server error log, and hangs up the connection.
|
|
Handler = context.Handler
|
|
// A Map is a shortcut of the map[string]interface{}.
|
|
Map = context.Map
|
|
)
|