Documentation
¶
Index ¶
- func AddUserSession(r *http.Request, user *models.User)
- func GetAuthenticatedUser(r *http.Request) (*models.User, error)
- func NegotiateContent(accepts []string, offers []string) string
- func NewSessionManager() *scs.SessionManager
- func SigninUser(r *http.Request, username string, password string) (*models.User, error)
- func SignupUser(ctx context.Context, username string, name string, password string) (*models.User, error)
- type AuthenticatedHandler
- type EnsureAuth
- type InvalidCredentials
- type InvalidUsername
- type NoCredentialsError
- type NoUserError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NegotiateContent ¶
NegotiateContent returns the best content to offer from a set of possible values, based on the preferences represented by the accept values.
func NewSessionManager ¶
func NewSessionManager() *scs.SessionManager
func SigninUser ¶
Types ¶
type AuthenticatedHandler ¶
type EnsureAuth ¶
type EnsureAuth struct {
// contains filtered or unexported fields
}
func NewEnsureAuth ¶
func NewEnsureAuth(handlerToWrap AuthenticatedHandler) *EnsureAuth
func (*EnsureAuth) ServeHTTP ¶
func (ea *EnsureAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)
type InvalidCredentials ¶
type InvalidCredentials struct{}
func (InvalidCredentials) Error ¶
func (e InvalidCredentials) Error() string
type InvalidUsername ¶
type InvalidUsername struct{}
func (InvalidUsername) Error ¶
func (e InvalidUsername) Error() string
type NoCredentialsError ¶
type NoCredentialsError struct{}
func (NoCredentialsError) Error ¶
func (e NoCredentialsError) Error() string
type NoUserError ¶
type NoUserError struct{}
func (NoUserError) Error ¶
func (e NoUserError) Error() string
Click to show internal directories.
Click to hide internal directories.