Documentation ¶
Index ¶
- Constants
- func GetCookie(r *http.Request, key string, defaultVal string) string
- func GetPost(r *http.Request, key string, defaultVal string) string
- func GetQuery(r *http.Request, key string, defaultVal string) string
- func HttpHandlerWrapper(method interface{}) func(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Inject(objs ...interface{})
- func VerifyLdapConfig(conf *LdapConf) (err error)
- type GlobalConfig
- type HttpServer
- type Ldap
- type LdapConf
- type LdapResult
- type Provider
- type ProviderFunc
- type ServerConf
Constants ¶
View Source
const (
HTTP_CONTEXT_KEY_REQUEST = 0x01
)
Variables ¶
This section is empty.
Functions ¶
func HttpHandlerWrapper ¶
func HttpHandlerWrapper(method interface{}) func(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func VerifyLdapConfig ¶
Types ¶
type GlobalConfig ¶
type GlobalConfig struct { LdapConf LdapConf `yaml:"ldap"` ServerConf ServerConf `yaml:"http"` }
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(host string) *HttpServer
func (*HttpServer) ANY ¶
func (s *HttpServer) ANY(path string, handle httprouter.Handle)
func (*HttpServer) GET ¶
func (s *HttpServer) GET(path string, handle httprouter.Handle)
func (*HttpServer) POST ¶
func (s *HttpServer) POST(path string, handle httprouter.Handle)
func (*HttpServer) RunHttpServer ¶
func (s *HttpServer) RunHttpServer()
type Ldap ¶
type Ldap struct {
// contains filtered or unexported fields
}
func (*Ldap) Auth ¶
func (m *Ldap) Auth(username string, password string) (info *LdapResult, err error)
func (*Ldap) ListUsers ¶
func (m *Ldap) ListUsers() (list []LdapResult, err error)
func (*Ldap) SetLdapConf ¶
type LdapResult ¶
type ProviderFunc ¶
ProviderFunc type
func (ProviderFunc) Provide ¶
func (f ProviderFunc) Provide() []*inject.Object
Provide 执行 ProviderFunc 方法
type ServerConf ¶
type ServerConf struct {
Listen string `yaml:"listen"`
}
Click to show internal directories.
Click to hide internal directories.