Documentation ¶
Index ¶
- func File2WebOut(w http.ResponseWriter, outfile string) error
- func GetFloat64ByName(name string, errorval float64, w http.ResponseWriter, r *http.Request) float64
- func GetIntByName(name string, errorval int, w http.ResponseWriter, r *http.Request) int
- func GetPage(w http.ResponseWriter, r *http.Request) int
- func GetStringByName(name string, errorval string, w http.ResponseWriter, r *http.Request) string
- func PageMid(listLen, pagesize int, urlStr string, w http.ResponseWriter, r *http.Request)
- func ServeJSON2HTTP(obj interface{}, w http.ResponseWriter) error
- func SetFresh(w http.ResponseWriter, r *http.Request) error
- func Use(h http.HandlerFunc, middleware ...func(http.HandlerFunc) http.HandlerFunc) http.HandlerFunc
- func WebFormBegin(title string, w http.ResponseWriter, r *http.Request)
- func WebFormEnd(w http.ResponseWriter, r *http.Request)
- func WebLog(logFilename string, size int64, w http.ResponseWriter, r *http.Request) error
- type AuthData
- func (ad *AuthData) AddAction(action string) error
- func (ad *AuthData) AddAllActionName(name string) error
- func (ad *AuthData) CheckAction(action, name string) error
- func (ad *AuthData) CheckLogin(name, password string) error
- func (ad *AuthData) GetBasicAuthRealmString() string
- func (ad *AuthData) ReLoadActionName(data [][2]string) error
- func (ad *AuthData) ReLoadUserData(data [][2]string) error
- func (ad AuthData) String() string
- type AuthMux
- type BasicAuth
- type IAuthMuxHandle
- type NoAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func File2WebOut ¶
func File2WebOut(w http.ResponseWriter, outfile string) error
func GetFloat64ByName ¶
func GetIntByName ¶
func GetStringByName ¶
func ServeJSON2HTTP ¶
func ServeJSON2HTTP(obj interface{}, w http.ResponseWriter) error
func Use ¶
func Use( h http.HandlerFunc, middleware ...func(http.HandlerFunc) http.HandlerFunc) http.HandlerFunc
func WebFormBegin ¶
func WebFormBegin(title string, w http.ResponseWriter, r *http.Request)
func WebFormEnd ¶
func WebFormEnd(w http.ResponseWriter, r *http.Request)
Types ¶
type AuthData ¶
type AuthData struct { Realm string Name2Password map[string]string ActionNameMap map[[2]string]bool ActionMap map[string]bool }
func NewAuthData ¶
func (*AuthData) AddAllActionName ¶
func (*AuthData) CheckAction ¶
func (*AuthData) CheckLogin ¶
func (*AuthData) GetBasicAuthRealmString ¶
func (*AuthData) ReLoadActionName ¶
action name list
func (*AuthData) ReLoadUserData ¶
name password list
type AuthMux ¶
type AuthMux struct { *http.ServeMux AuthAction []string NoAuthAction []string // contains filtered or unexported fields }
func NewAuthMux ¶
func (*AuthMux) Auth ¶
func (am *AuthMux) Auth(pattern string, handler http.HandlerFunc) http.HandlerFunc
func (*AuthMux) HandleFuncAuth ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
func (*BasicAuth) Auth ¶
func (ba *BasicAuth) Auth(h http.HandlerFunc) http.HandlerFunc
Leverages nemo's answer in http://stackoverflow.com/a/21937924/556573
type IAuthMuxHandle ¶
type IAuthMuxHandle interface { HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) HandleFuncAuth(pattern string, handler func(http.ResponseWriter, *http.Request)) }
type IMuxHandle interface { HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package webprofile add profile to web
|
Package webprofile add profile to web |
Click to show internal directories.
Click to hide internal directories.