lusess

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrLoginFailed = lerr.Str("Login failed")
)

Variables

View Source
var (
	StoreName = "User"
	ValueName = "User"
)

Functions

This section is empty.

Types

type Login

type Login struct {
	Username, Password string
}

type Session

type Session struct {
	*sessions.Session
	Store *Store
	W     http.ResponseWriter
	R     *http.Request
}

func (*Session) Login

func (s *Session) Login(l *Login) (*lusers.User, error)

func (*Session) Logout

func (s *Session) Logout()

func (*Session) Save

func (s *Session) Save() error

func (*Session) SetUser

func (s *Session) SetUser(u *lusers.User)

func (*Session) User

func (s *Session) User() *lusers.User

type Store

type Store struct {
	sessions.Store
	*lusers.UserStore
	Decoder interface {
		Decode(interface{}, map[string][]string) error
	}
	FieldName string
}

func (*Store) InitilizeField

func (s *Store) InitilizeField(ft linject.FuncType, t reflect.Type) linject.FieldInjector

func (*Store) Inject

func (s *Store) Inject(w http.ResponseWriter, r *http.Request) (v any, fn func([]reflect.Value), err error)

func (*Store) Login

func (s *Store) Login(w http.ResponseWriter, r *http.Request) (*Session, error)

func (*Store) Midware

func (s *Store) Midware() linject.Field

func (*Store) Session

func (s *Store) Session(w http.ResponseWriter, r *http.Request) (*Session, error)

func (*Store) User

func (s *Store) User(r *http.Request) (*lusers.User, error)

Jump to

Keyboard shortcuts

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