Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextKey ¶
type ContextKey int
ContextKey is a key used in http request contexts.
const ( // ContextKeySession is the persistent session. ContextKeySession ContextKey = iota // ContextKeyLocalizer is the language localizer. ContextKeyLocalizer // ContextKeyLanguage is the language. ContextKeyLanguage // ContextKeyAccount is the logged in user's account. ContextKeyAccount // ContextKeyOauthNonce is the oauth nonce. ContextKeyOauthNonce )
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter is a ResponseWriter that keeps track of status and body size.
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
NewResponseWriter creates a new ResponseWriter.
func (*ResponseWriter) BodyLength ¶
func (r *ResponseWriter) BodyLength() int
BodyLength returns the response body length.
func (*ResponseWriter) Status ¶
func (r *ResponseWriter) Status() int
Status returns the status code of the response.
func (*ResponseWriter) Write ¶
func (r *ResponseWriter) Write(b []byte) (int, error)
Write to the response writer, also updating body length.
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(status int)
WriteHeader sets the status of the response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a http 2 web server.
func (*Server) HandleFunc ¶
HandleFunc attaches a function to a path.
func (*Server) MiddlewareMetrics ¶
MiddlewareMetrics sends http request metrics.
func (*Server) PathPrefix ¶
PathPrefix attaches a new route url path prefix.
type SessionKey ¶
type SessionKey int
SessionKey is a key used for storing data in a web session.
const ( // SessionKeyAccountID contains the id of the currently logged-in user. SessionKeyAccountID SessionKey = iota // SessionKeyLoginRedirect contains the url to be redirected too after logging in. SessionKeyLoginRedirect // SessionKeyReturnURI contains the url to be redirected too after logging in. SessionKeyReturnURI // SessionKeyOAuthNonce contains the nonce sent to the oauth server. SessionKeyOAuthNonce )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.