users

package
v0.0.0-...-c5fdaab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginEvent

type LoginEvent struct {
	User     *User
	Duration time.Duration
}

type LogoutEvent

type LogoutEvent struct {
	User *User
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(identityStore auth.IdentityStore) *Manager

func (*Manager) Get

func (m *Manager) Get(r *http.Request, w http.ResponseWriter) (user *User, err error)

func (*Manager) Login

func (m *Manager) Login(r *http.Request, w http.ResponseWriter, user *User, duration time.Duration) (err error)

func (*Manager) Logout

func (m *Manager) Logout(user *User, r *http.Request, w http.ResponseWriter) (err error)

func (*Manager) Middleware

func (m *Manager) Middleware(authenticator auth.Authenticator) clevergo.MiddlewareFunc

func (*Manager) RegisterOnAfterLogin

func (m *Manager) RegisterOnAfterLogin(f func(*LoginEvent))

func (*Manager) RegisterOnAfterLogout

func (m *Manager) RegisterOnAfterLogout(f func(*LogoutEvent))

func (*Manager) RegisterOnBeforeLogin

func (m *Manager) RegisterOnBeforeLogin(f func(*LoginEvent) error)

func (*Manager) RegisterOnBeforeLogout

func (m *Manager) RegisterOnBeforeLogout(f func(*LogoutEvent) error)

func (*Manager) SetSessionManager

func (m *Manager) SetSessionManager(manager *scs.SessionManager)

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) GetIdentity

func (u *User) GetIdentity() auth.Identity

func (*User) IsGuest

func (u *User) IsGuest() bool

func (*User) Login

func (u *User) Login(r *http.Request, w http.ResponseWriter, identity auth.Identity, duration time.Duration) error

func (*User) Logout

func (u *User) Logout(r *http.Request, w http.ResponseWriter) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL