Documentation
¶
Index ¶
- Constants
- Variables
- func AddDebugLoggerHandler(fnDebug logfn.LogFunc) http.Handler
- func AddError(ctx context.Context, err error)
- func AddFilesToRootTPL(filenames ...string) http.HandlerFunc
- func AddGlobToRootTPL(pattern string) http.HandlerFunc
- func AddLoggerHandler(fnInfo, fnErr, fnWarn logfn.LogFunc) http.Handler
- func CreatePersistentCookie(fnGetCookie func(context.Context) (*cookiejar.Jar, error)) http.HandlerFunc
- func CurrentSession(ctx context.Context) (o *sessions.Session, exists bool)
- func EnsureHTTPS(w http.ResponseWriter, r *http.Request)
- func ErrLoggerHandler(fn logfn.LogFunc) http.Handler
- func GenRandSecrets(count int) [][]byte
- func GetCookie(ctx context.Context) *cookiejar.Jar
- func GetErrorInfo(ctx context.Context) interface{}
- func GetPageDataKVConfig(c Store, page interface{}) (m map[string]string)
- func GetPageTypeCache(c Store) (m map[string]map[string]string)
- func GetRenderer(ctx context.Context) *_Renderer
- func GetRootTPL(ctx context.Context) *template.Template
- func GetSession(ctx context.Context) *sessions.Session
- func HttpSequence(finally http.HandlerFunc, h ...http.HandlerFunc) http.HandlerFunc
- func IfHasErrorRedirect(theURL string, moreinfo interface{}) http.HandlerFunc
- func IfSuccessRedirect(theURL string) http.HandlerFunc
- func InfoLoggerHandler(fn logfn.LogFunc) http.Handler
- func LogDebug(ctx context.Context, fmt string, params ...interface{})
- func LogErr(ctx context.Context, fmt string, params ...interface{})
- func LogInfo(ctx context.Context, fmt string, params ...interface{})
- func LogWarn(ctx context.Context, fmt string, params ...interface{})
- func MarshalKeys(keys [][]byte) ([]byte, error)
- func MergeMapStrIf(dst, src map[string]interface{})
- func MergePageData(c Store, data map[string]interface{}, page interface{})
- func MergePageFuncs(c Store, funcs map[string]interface{}, page interface{})
- func MergePagesData(c Store, datamap map[string]interface{}, pages ...interface{})
- func MergePagesFuncs(c Store, funcmap map[string]interface{}, pages ...interface{})
- func Method(method string, nexth http.Handler) http.Handler
- func MidSeq(handlerToWrap http.Handler, fs ...*MidInfo) http.Handler
- func MidSeqFunc(handlerToWrap http.HandlerFunc, fs ...*MidInfo) http.Handler
- func NewRenderer(c context.Context, t *template.Template) *_Renderer
- func NoCache(h http.Handler) http.Handler
- func OnErrorGotoReferrer(h http.HandlerFunc, moreinfo interface{}) http.HandlerFunc
- func OnErrorRedirect(h http.HandlerFunc, theURL string, moreinfo interface{}) http.HandlerFunc
- func RedirectHandler(urlstr string, code int) http.Handler
- func SavePersistentCookie(fnSaveCookie func(c context.Context, jar http.CookieJar) error) http.HandlerFunc
- func SetRootTemplate(ctx context.Context, tpl *template.Template) http.HandlerFunc
- func UnmarshalKeys(bb []byte) (keys [][]byte, err error)
- func UseDbiCache(namespace string, dbiKey interface{}) http.HandlerFunc
- func UseRenderer(glob string, filenames ...string) http.HandlerFunc
- func WithDebugLogger(ctx context.Context, fn logfn.LogFunc) context.Context
- func WithErrLogger(ctx context.Context, fn logfn.LogFunc) context.Context
- func WithInfoLogger(ctx context.Context, fn logfn.LogFunc) context.Context
- func WithWarnLogger(ctx context.Context, fn logfn.LogFunc) context.Context
- type BufPool
- type DbiCache
- type HasHTML
- type MidInfo
- type SessionStore
- type Store
Constants ¶
View Source
const ( ErrorKey _errorKey = iota ErrorInfo )
View Source
const (
BufPoolkey _bufpooltype = iota
)
View Source
const (
PageTypeCache _pageTypeCacheKey = iota
)
View Source
const (
PersistentCookieKey _persistentCookieKey = iota
)
View Source
const (
RendererKey _rendererKey = iota
)
View Source
const SessionName _sessionName = 0
View Source
const TPLFieldConfig = "TPLConfig"
View Source
const TPLName = "webtpl"
View Source
const TPLRootKey _templateType = 0
Variables ¶
View Source
var BufPoolSize = 16
View Source
var DefaultMidSeq func(fn interface{}, params []interface{}) http.Handler
View Source
var ErrNoRootTPL = fmt.Errorf("no root template found.")
Functions ¶
func AddFilesToRootTPL ¶
func AddFilesToRootTPL(filenames ...string) http.HandlerFunc
func AddGlobToRootTPL ¶
func AddGlobToRootTPL(pattern string) http.HandlerFunc
func CreatePersistentCookie ¶
func EnsureHTTPS ¶
func EnsureHTTPS(w http.ResponseWriter, r *http.Request)
func GenRandSecrets ¶
func GetErrorInfo ¶
func GetPageDataKVConfig ¶
example of page[0] struct
type SomePage struct { TPLConfig string `webtpl:"name=mytemplate.tpl"` }
func GetRenderer ¶
func HttpSequence ¶
func HttpSequence(finally http.HandlerFunc, h ...http.HandlerFunc) http.HandlerFunc
func IfHasErrorRedirect ¶
func IfHasErrorRedirect(theURL string, moreinfo interface{}) http.HandlerFunc
func IfSuccessRedirect ¶
func IfSuccessRedirect(theURL string) http.HandlerFunc
func MarshalKeys ¶
func MergeMapStrIf ¶
func MergeMapStrIf(dst, src map[string]interface{})
func MergePageData ¶
func MergePageFuncs ¶
func MergePagesData ¶
func MergePagesFuncs ¶
func MidSeqFunc ¶
func MidSeqFunc(handlerToWrap http.HandlerFunc, fs ...*MidInfo) http.Handler
func OnErrorGotoReferrer ¶
func OnErrorGotoReferrer(h http.HandlerFunc, moreinfo interface{}) http.HandlerFunc
func OnErrorRedirect ¶
func OnErrorRedirect(h http.HandlerFunc, theURL string, moreinfo interface{}) http.HandlerFunc
func SavePersistentCookie ¶
func SetRootTemplate ¶
func UnmarshalKeys ¶
func UseDbiCache ¶
func UseDbiCache(namespace string, dbiKey interface{}) http.HandlerFunc
func UseRenderer ¶
func UseRenderer(glob string, filenames ...string) http.HandlerFunc
Types ¶
type BufPool ¶
func GetBufPool ¶
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
func NewCookieSession ¶
func NewCookieSession(opts *sessions.Options, keys ...[]byte) *SessionStore
func NewFilesystemSession ¶
func NewFilesystemSession(fpath string, opts *sessions.Options, keys ...[]byte) *SessionStore
func (*SessionStore) AddSessionHandler ¶
func (this *SessionStore) AddSessionHandler(name string) http.HandlerFunc
func (*SessionStore) Domain ¶
func (this *SessionStore) Domain(s string)
func (*SessionStore) HttpOnly ¶
func (this *SessionStore) HttpOnly(b bool)
func (*SessionStore) MaxAge ¶
func (this *SessionStore) MaxAge(n int)
func (*SessionStore) Path ¶
func (this *SessionStore) Path(s string)
func (*SessionStore) Secure ¶
func (this *SessionStore) Secure(b bool)
Click to show internal directories.
Click to hide internal directories.