Documentation ¶
Index ¶
- Constants
- Variables
- func SetUserToContext(r *http.Request, user *User)
- type SafeUser
- type Server
- func (s *Server) Auth(next http.HandlerFunc) http.HandlerFunc
- func (s *Server) AuthorizeHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CallbackHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) Decrypt(encrypted string, body interface{}) error
- func (s *Server) DeleteHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) DumpLoop()
- func (s *Server) Encrypt(body interface{}) (string, error)
- func (s *Server) Init() error
- func (s *Server) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) MeHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) RestoreUserList() error
- func (s *Server) SaveUserList() error
- func (s *Server) Start() error
- func (s *Server) Stop() error
- func (s *Server) UpdateLoop()
- type User
Constants ¶
View Source
const UserCtxKey = "ctxUser"
Variables ¶
View Source
var ( ErrEmptyResumeList = errors.New("Empty resume list") UsersBucket = []byte("usersv1") UsersKey = []byte("list") MailLoginRegExp = regexp.MustCompile(`^([^@]*)`) )
View Source
var Endpoint = oauth2.Endpoint{
AuthURL: "https://hh.ru/oauth/authorize",
TokenURL: "https://hh.ru/oauth/token",
}
Endpoint is HH's OAuth 2.0 endpoint.
Functions ¶
func SetUserToContext ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Auth ¶
func (s *Server) Auth(next http.HandlerFunc) http.HandlerFunc
func (*Server) AuthorizeHandler ¶
func (s *Server) AuthorizeHandler(w http.ResponseWriter, r *http.Request)
func (*Server) CallbackHandler ¶
func (s *Server) CallbackHandler(w http.ResponseWriter, r *http.Request)
func (*Server) DeleteHandler ¶
func (s *Server) DeleteHandler(w http.ResponseWriter, r *http.Request)
func (*Server) LogoutHandler ¶
func (s *Server) LogoutHandler(w http.ResponseWriter, r *http.Request)
func (*Server) RestoreUserList ¶
func (*Server) SaveUserList ¶
func (*Server) UpdateLoop ¶
func (s *Server) UpdateLoop()
Click to show internal directories.
Click to hide internal directories.