auth

package
v0.0.0-...-23be098 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionManager

type SessionManager struct {
	Rdb  *redis.Client
	Conn *sqlx.DB
}

func NewSessionManager

func NewSessionManager(rdb *redis.Client, conn *sqlx.DB) *SessionManager

func (*SessionManager) GenerateSession

func (s *SessionManager) GenerateSession(data UserSession) (string, error)

func (*SessionManager) GetSession

func (s *SessionManager) GetSession(session string) (*UserSession, error)

func (*SessionManager) SignIn

func (s *SessionManager) SignIn(email, password string) (string, error)

func (*SessionManager) SignOut

func (s *SessionManager) SignOut(sessionId string) error

type User

type User struct {
	Id        int
	FirstName string
	LastName  string
	Email     string
	Password  string
}

type UserSession

type UserSession struct {
	Id        int
	FirstName string
	LastName  string
	Email     string
}

Jump to

Keyboard shortcuts

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