Documentation ¶
Overview ¶
Package session provides contextual information about a single HTTP/S connection and its associated requests and responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides information and storage for a single request/response pair. Contexts are linked to shared session that is used for multiple requests on a single connection.
func FromContext ¶
FromContext builds a new context from an existing context. The new context shares the same session as the passed context, but does not inherit any of its request specific values. If ctx is nil, a new context and session are created.
func (*Context) GetSession ¶
GetSession returns the session for the context.
func (*Context) Set ¶
Set takes a key and associates it with val in the context. The value is persisted for the duration of the request and is removed on the following request.
func (*Context) SkipRoundTrip ¶
func (ctx *Context) SkipRoundTrip()
SkipRoundTrip skips the round trip for the current request.
func (*Context) SkippingRoundTrip ¶
SkippingRoundTrip returns whether the current round trip will be skipped.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session provides information and storage about a connection.
func (*Session) IsSecure ¶
IsSecure returns whether the current session is from a secure connection, such as when receiving requests from a TLS connection that has been MITM'd.