Documentation ¶
Index ¶
- func CatcherMiddleware(debugFlag int, name string, url_log string, version string, poste string) func(next http.Handler) http.Handler
- func DirectCatcherMiddleware(debugFlag int, name string, url_log string, version string, poste string) func(next http.Handler) http.Handler
- func FmtOptions(slice interface{}, sel interface{}) template.HTML
- func FmtOptionsGroup(slice interface{}, sel interface{}) template.HTML
- func HandleStaticFS(path string, fs fs.FS, maxAge int) func(w http.ResponseWriter, r *http.Request)
- func HandleStaticFSOrigin(path string, fs fs.FS, maxAge int, origin string) func(w http.ResponseWriter, r *http.Request)
- func Log(r *http.Request)
- func LogMiddleware(next http.Handler) http.Handler
- func RequestCatcherLog(r *http.Request) *log.Logger
- func RequestTx(r *http.Request) *sqlx.Tx
- func SessionMiddleware(auth string, key string, age int) func(next http.Handler) http.Handler
- func SessionNameMiddleware(name string, auth string, key string, age int) func(next http.Handler) http.Handler
- func StaticDiskMiddleware(path string, maxAge int) func(next http.Handler) http.Handler
- func StaticDiskMiddlewareOrigin(path string, maxAge int, origin string) func(next http.Handler) http.Handler
- func StaticFsMiddleware(path string, fs fs.FS, maxAge int) func(next http.Handler) http.Handler
- func StaticFsMiddlewareOrigin(path string, fs fs.FS, maxAge int, origin string) func(next http.Handler) http.Handler
- func TxMiddleware(db *sqlx.DB) func(next http.Handler) http.Handler
- type Catcher
- type DayWriter
- type ErrRedirect
- type JustFiles
- type LogSender
- type OptionAttrer
- type OptionGroupInt
- type OptionGroupString
- type OptionInt
- type OptionString
- type Session
- type SessionStore
- func (f *SessionStore) AddFlash(flag string, msg string)
- func (f *SessionStore) AddFlashf(flag string, msg string, a ...interface{})
- func (f *SessionStore) Alert(msg string)
- func (f *SessionStore) Alertf(msg string, a ...interface{})
- func (f *SessionStore) Alerts() []string
- func (f *SessionStore) Flashes(flag string) []string
- func (f *SessionStore) GetDate(key string) (time.Time, error)
- func (f *SessionStore) GetForm(key string) (url.Values, error)
- func (f *SessionStore) GetInt(key string) (int, error)
- func (f *SessionStore) GetString(key string) string
- func (f *SessionStore) Info(msg string)
- func (f *SessionStore) Infof(msg string, a ...interface{})
- func (f *SessionStore) Infos() []string
- func (f *SessionStore) PutDate(key string, value time.Time)
- func (f *SessionStore) PutForm(key string, u url.Values)
- func (f *SessionStore) PutInt(key string, value int)
- func (f *SessionStore) PutString(key string, value string)
- func (f *SessionStore) Warning(msg string)
- func (f *SessionStore) Warningf(msg string, a ...interface{})
- func (f *SessionStore) Warnings() []string
- type TX
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatcherMiddleware ¶
func DirectCatcherMiddleware ¶ added in v0.18.0
func DirectCatcherMiddleware(debugFlag int, name string, url_log string, version string, poste string) func(next http.Handler) http.Handler
NOT TESTED DirectCatcherMiddleware sans httptest.NewRecord, envoi direct vers http.ResponseWriter possible http: superfluous response.WriteHeader à ignorer
func FmtOptions ¶
func FmtOptionsGroup ¶
func HandleStaticFS ¶ added in v0.19.0
with embed mux.HandleFunc("/static/", webo.HandleStaticFs("/static/", static.StaticFS, 3600*24)) with disk mux.HandleFunc("/static/", webo.HandleStaticFs("/static/", os.DirFS("static"), 3600*24)) with gorilla r.PathPrefix("/static/").HandlerFunc(HandleStaticFS("/static/", static.StaticFiles, 3600*24))
func HandleStaticFSOrigin ¶ added in v0.19.0
func LogMiddleware ¶
HTTP middleware setting a value on the request context
func RequestCatcherLog ¶
renvoi le log lui-même créé par catcher et positionné dans context
func SessionMiddleware ¶
deprecate : use SessionNameMiddleware
func SessionNameMiddleware ¶
func SessionNameMiddleware(name string, auth string, key string, age int) func(next http.Handler) http.Handler
session with possibility to set the name
func StaticDiskMiddleware ¶
with gorilla mux.Router (gorilla must know that /static exists) add a static middleware from disk with : Cache-Control max-age=maxAge
func StaticDiskMiddlewareOrigin ¶
func StaticDiskMiddlewareOrigin(path string, maxAge int, origin string) func(next http.Handler) http.Handler
with gorilla mux.Router (gorilla must know that /static exists) add a static middleware from disk with : Cache-Control max-age=maxAge Access-Control-Allow-Origin origin
func StaticFsMiddleware ¶
with gorilla mux.Router (gorilla must know that /static exists) add a static middleware from fs.FS with : Cache-Control maxAge
func StaticFsMiddlewareOrigin ¶
func StaticFsMiddlewareOrigin(path string, fs fs.FS, maxAge int, origin string) func(next http.Handler) http.Handler
with gorilla mux.Router (gorilla must know that /static exists) add a static middleware from fs.FS with : Cache-Control max-age=maxAge Access-Control-Allow-Origin origin
Types ¶
type DayWriter ¶
func GetDayWriter ¶
func GetDayWriter() *DayWriter
type ErrRedirect ¶
type ErrRedirect struct {
URL string
}
func Redirect ¶
func Redirect(url string, args ...any) ErrRedirect
func (ErrRedirect) Error ¶
func (e ErrRedirect) Error() string
type JustFiles ¶
type JustFiles struct {
FS http.FileSystem
}
http.FileSystem without showing index of directories just serve explicit files
type LogSender ¶
func NewLogSender ¶
type OptionAttrer ¶
type OptionGroupInt ¶
type OptionGroupString ¶
type OptionString ¶
type SessionStore ¶
func RequestSession ¶
func RequestSession(r *http.Request) *SessionStore
func (*SessionStore) AddFlash ¶
func (f *SessionStore) AddFlash(flag string, msg string)
func (*SessionStore) AddFlashf ¶
func (f *SessionStore) AddFlashf(flag string, msg string, a ...interface{})
func (*SessionStore) Alert ¶
func (f *SessionStore) Alert(msg string)
func (*SessionStore) Alertf ¶
func (f *SessionStore) Alertf(msg string, a ...interface{})
func (*SessionStore) Alerts ¶
func (f *SessionStore) Alerts() []string
func (*SessionStore) Flashes ¶
func (f *SessionStore) Flashes(flag string) []string
func (*SessionStore) GetString ¶
func (f *SessionStore) GetString(key string) string
func (*SessionStore) Info ¶
func (f *SessionStore) Info(msg string)
func (*SessionStore) Infof ¶
func (f *SessionStore) Infof(msg string, a ...interface{})
func (*SessionStore) Infos ¶
func (f *SessionStore) Infos() []string
func (*SessionStore) PutInt ¶
func (f *SessionStore) PutInt(key string, value int)
func (*SessionStore) PutString ¶
func (f *SessionStore) PutString(key string, value string)
func (*SessionStore) Warning ¶
func (f *SessionStore) Warning(msg string)
func (*SessionStore) Warningf ¶
func (f *SessionStore) Warningf(msg string, a ...interface{})
func (*SessionStore) Warnings ¶
func (f *SessionStore) Warnings() []string