Documentation
¶
Index ¶
- func ContentEncoding[R dispatch.RequestAdapter](withProviders ...ContentEncoder) dispatch.Middleware[R]
- func Errors[R dispatch.RequestAdapter, E ~int]() errorHandler[R, E]
- func Logger[R dispatch.RequestAdapter](format string, logger io.Writer) dispatch.Middleware[R]
- func SessionMW[S Session, R SessionAdapter[S]](store SessionStore[S], init func() S, log io.Writer) dispatch.Middleware[R]
- type ContentEncoder
- type DefaultSessionStore
- type ErrorHandler
- type Session
- type SessionAdapter
- type SessionStore
- type WriteFlusher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentEncoding ¶
func ContentEncoding[R dispatch.RequestAdapter](withProviders ...ContentEncoder) dispatch.Middleware[R]
func Errors ¶
func Errors[R dispatch.RequestAdapter, E ~int]() errorHandler[R, E]
Factory function to create an error handler middleware
func Logger ¶
func Logger[R dispatch.RequestAdapter](format string, logger io.Writer) dispatch.Middleware[R]
func SessionMW ¶
func SessionMW[S Session, R SessionAdapter[S]](store SessionStore[S], init func() S, log io.Writer) dispatch.Middleware[R]
Types ¶
type DefaultSessionStore ¶
func (*DefaultSessionStore[S]) GetSession ¶
func (store *DefaultSessionStore[S]) GetSession(r *http.Request, init func() S) S
func (*DefaultSessionStore[S]) StoreSession ¶
func (store *DefaultSessionStore[S]) StoreSession(s S) error
func (*DefaultSessionStore[S]) WriteCookie ¶
func (store *DefaultSessionStore[S]) WriteCookie(w http.ResponseWriter, s S)
type ErrorHandler ¶
type ErrorHandler[R dispatch.RequestAdapter] interface { Self() func(ctn *dispatch.ContentTypeNegotiator, logger io.Writer) dispatch.Middleware[R] // contains filtered or unexported methods }
type SessionAdapter ¶
type SessionAdapter[S Session] interface { dispatch.RequestAdapter LoadSession(S) }
type SessionStore ¶
type WriteFlusher ¶
Click to show internal directories.
Click to hide internal directories.