handle

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VALUES = []byte("wiki_values")
View Source
var WIKI = []byte("wiki_pages")

Functions

func Err

func Err(t ITemplate, o IExtend) func(w http.ResponseWriter, err error) bool

func Forbidden added in v0.0.14

func Forbidden(w http.ResponseWriter, _ *http.Request)

func ForbiddenScan added in v0.0.14

func ForbiddenScan(sub *mux.Router, paths []string)

func Home

func Home(T ITemplate, o *cms.Options) func(http.ResponseWriter, *http.Request)

func HomeSearch

func HomeSearch(S *store.Store, T ITemplate, o *cms.Options) func(http.ResponseWriter, *http.Request)

func Invite added in v0.1.1

func Invite(s *store.Store, T ITemplate, o *cms.Options) func(http.ResponseWriter, *http.Request)

func InvitePOST added in v0.1.1

func InvitePOST(s *store.Store, T ITemplate, o *cms.Options) func(http.ResponseWriter, *http.Request)

func Logger

func Logger(h http.HandlerFunc) http.HandlerFunc

func LoggingMiddleware added in v0.0.6

func LoggingMiddleware(next http.Handler) http.Handler

func LoggingMiddlewareDB added in v0.0.7

func LoggingMiddlewareDB(s *store.Store, o *cms.Options) func(next http.Handler) http.Handler

func Login added in v0.1.1

func Login(s *store.Store, T ITemplate, o *cms.Options) func(http.ResponseWriter, *http.Request)

func NewSkipper added in v0.0.7

func NewSkipper(data interface{}) (s skip)

func Page

func Page(T ITemplate, o cms.Options) func(w http.ResponseWriter, r *http.Request)

func ReadUserIP

func ReadUserIP(r *http.Request) string

func WellKnown added in v0.0.9

func WellKnown(r *mux.Router)

WELL-KNOWN

func WikiPage

func WikiPage(t ITemplate, s *store.Store, o *cms.Options) func(w http.ResponseWriter, r *http.Request)

Types

type BasicAuthFunc

type BasicAuthFunc func(h http.HandlerFunc, roles ...string) http.HandlerFunc

func BasicAuth

func BasicAuth(t ITemplate, s IStore, o *cms.Options) BasicAuthFunc

type IExtend

type IExtend interface {
	Extend(m cms.Options) cms.Options
}

type IStore

type IStore interface {
	GetUser(user string) (IUser, error)
}

type ITemplate

type ITemplate interface {
	ExecuteTemplate(wr io.Writer, name string, data interface{}) error
}

type IUser

type IUser interface {
	GenToken(pass string) []byte
	PassEQ(token []byte) bool
	IsAllow(roles []string) bool
	GetRoles() []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL