Documentation
¶
Index ¶
- func ContentEncoding[R DispatchEncoder](withProviders ...ContentEncoder) dispatch.Middleware[R]
- func Errors[R dispatch.RequestAdapter, E ~int]() errorHandler[R, E]
- func Logger[R DispatchLogger](format string, logger io.Writer) dispatch.Middleware[R]
- func SessionMW[S Session, R SessionAdapter[S]](store SessionStore[S], log io.Writer) dispatch.Middleware[R]
- type ContentEncoder
- type DefaultSessionStore
- type DispatchEncoder
- type DispatchLogger
- type EncodingData
- type ErrorHandler
- type LoggerData
- type Session
- type SessionAdapter
- type SessionStore
- type WriteFlusher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentEncoding ¶
func ContentEncoding[R DispatchEncoder](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 DispatchLogger](format string, logger io.Writer) dispatch.Middleware[R]
func SessionMW ¶
func SessionMW[S Session, R SessionAdapter[S]](store SessionStore[S], log io.Writer) dispatch.Middleware[R]
Types ¶
type ContentEncoder ¶
type DefaultSessionStore ¶
type DefaultSessionStore[S Session] struct { CookieName string sync.Map // contains filtered or unexported fields }
func NewDefaultSessionStore ¶
func NewDefaultSessionStore[S Session](cookieName string) *DefaultSessionStore[S]
func (*DefaultSessionStore[S]) Load ¶
func (store *DefaultSessionStore[S]) Load(r *http.Request) 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 DispatchEncoder ¶
type DispatchEncoder interface {
dispatch.RequestAdapter
Encoder() *EncodingData
}
type DispatchLogger ¶
type DispatchLogger interface {
dispatch.RequestAdapter
Log() *LoggerData
}
type EncodingData ¶
type EncodingData struct {
// contains filtered or unexported fields
}
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 LoggerData ¶
type LoggerData struct {
// contains filtered or unexported fields
}
type SessionAdapter ¶
type SessionAdapter[S Session] interface { dispatch.RequestAdapter GetSession() S SetSession(S) }
type SessionStore ¶
type WriteFlusher ¶
Click to show internal directories.
Click to hide internal directories.