Documentation ¶
Index ¶
- Constants
- Variables
- type AuthLoginConfig
- type AuthLoginHttpRes
- type AuthLoginLdapService
- type AuthLoginManager
- type AuthLoginResponse
- type AuthLoginService
- type AuthLoinHttpService
- type DocIndex
- func (di *DocIndex) Flush()
- func (di *DocIndex) ForceDelDocIdIndex(docId string)
- func (di *DocIndex) ForceUpdateDocIndexByDocId(docId string) error
- func (di *DocIndex) IsUpdateDocIndex() bool
- func (di *DocIndex) UpdateAllDocIndex(batchNum int)
- func (di *DocIndex) UpdateDocIndex(doc map[string]string)
- func (di *DocIndex) UpdateDocsIndex(docs []map[string]string)
Constants ¶
View Source
const ( AuthLoginProtocolHttp = "http" AuthLoginProtocolHttps = "https" AuthLoginProtocolLdap = "ldap" AuthLoginProtocolLdaps = "ldaps" )
View Source
const ( LdapDefaultAccountPattern = "(&(objectClass=User)(uid=%s))" LdapDefaultAttributeGivenName = "cn" )
Variables ¶
View Source
var AuthLogin = NewAuthLoginManager()
View Source
var DocIndexService = NewDocIndexService()
View Source
var (
LdapUserSearchNotFoundErr = errors.New("用户不存在或密码错误")
)
Functions ¶
This section is empty.
Types ¶
type AuthLoginConfig ¶
type AuthLoginConfig struct { BaseDn string `json:"basedn"` BindUsername string `json:"bind_username"` BindPassword string `json:"bind_password"` AccountPattern string `json:"account_pattern"` GivenNameKey string `json:"given_name_key"` EmailKey string `json:"email_key"` MobileKey string `json:"mobile_key"` PhoneKey string `json:"phone_key"` DepartmentKey string `json:"department_key"` PositionKey string `json:"position_key"` LocationKey string `json:"location_key"` ImKey string `json:"im_key"` }
type AuthLoginHttpRes ¶
type AuthLoginHttpRes struct { Message string `json:"message"` Data *AuthLoginResponse `json:"data"` }
type AuthLoginLdapService ¶
type AuthLoginLdapService struct {
// contains filtered or unexported fields
}
AuthLoginLdapService ldap auth login
func (*AuthLoginLdapService) AuthLogin ¶
func (al *AuthLoginLdapService) AuthLogin(username string, password string) (*AuthLoginResponse, error)
AuthLogin ldap auth
func (*AuthLoginLdapService) GetAttributes ¶
func (al *AuthLoginLdapService) GetAttributes() []string
GetAttributes get config attribute name
func (*AuthLoginLdapService) GetServiceName ¶
func (al *AuthLoginLdapService) GetServiceName() string
GetServiceName ldap
type AuthLoginManager ¶
type AuthLoginManager struct {
AuthLoginServices map[string]AuthLoginService
}
AuthLoginManager auth login manager
func NewAuthLoginManager ¶
func NewAuthLoginManager() *AuthLoginManager
NewAuthLoginManager new a auth login manager
func (*AuthLoginManager) AuthLogin ¶
func (am *AuthLoginManager) AuthLogin(username, password string) (*AuthLoginResponse, error)
AuthLogin start auth login
func (*AuthLoginManager) RegisterService ¶
func (am *AuthLoginManager) RegisterService(serviceName string, authLoginService AuthLoginService)
RegisterService register a auth login service
func (*AuthLoginManager) UrlIsSupport ¶
func (am *AuthLoginManager) UrlIsSupport(serviceName string) bool
type AuthLoginResponse ¶
type AuthLoginResponse struct { GivenName string `json:"given_name"` Email string `json:"email"` Mobile string `json:"mobile"` Phone string `json:"phone"` Department string `json:"department"` Position string `json:"position"` Location string `json:"location"` Im string `json:"im"` }
AuthLoginResponse auth login response result
type AuthLoginService ¶
type AuthLoginService interface { // Init init login config InitConf(url string, conf string) error // GetServiceName get auth login service name GetServiceName() string // AuthLogin auth login request AuthLogin(username string, password string) (*AuthLoginResponse, error) }
AuthLoginService auth login service
func NewAuthLoginHttpService ¶
func NewAuthLoginHttpService() AuthLoginService
NewAuthLoginHttpService
func NewAuthLoginLdapService ¶
func NewAuthLoginLdapService() AuthLoginService
NewAuthLoginLdapService
type AuthLoinHttpService ¶
type AuthLoinHttpService struct {
// contains filtered or unexported fields
}
AuthLoinHttpService http auth login
func (*AuthLoinHttpService) AuthLogin ¶
func (ah *AuthLoinHttpService) AuthLogin(username string, password string) (*AuthLoginResponse, error)
AuthLogin send http request
func (*AuthLoinHttpService) GetServiceName ¶
func (ah *AuthLoinHttpService) GetServiceName() string
GetServiceName http
type DocIndex ¶
type DocIndex struct { }
func NewDocIndexService ¶
func NewDocIndexService() *DocIndex
func (*DocIndex) ForceDelDocIdIndex ¶
ForceDelDocIdIndex 强制删除索引
func (*DocIndex) ForceUpdateDocIndexByDocId ¶
UpdateDocIndex 更新单个文件的索引
func (*DocIndex) IsUpdateDocIndex ¶
func (*DocIndex) UpdateAllDocIndex ¶
UpdateAllDocIndex 更新所有的文档
func (*DocIndex) UpdateDocIndex ¶
UpdateDocIndex 更新单个文件的索引
func (*DocIndex) UpdateDocsIndex ¶
UpdateDocsIndex 批量更新多个文件的索引
Click to show internal directories.
Click to hide internal directories.