auth

package
v0.0.0-...-0979b83 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(env *config.Env, dbgen *dbgen.Queries) *Service

func (*Service) ClearSessionCookie

func (s *Service) ClearSessionCookie(c echo.Context)

func (*Service) DeleteAllUserSessions

func (s *Service) DeleteAllUserSessions(
	ctx context.Context, userID uuid.UUID,
) error

func (*Service) DeleteOldSessions

func (s *Service) DeleteOldSessions()

func (*Service) DeleteSession

func (s *Service) DeleteSession(
	ctx context.Context, sessionID uuid.UUID,
) error

func (*Service) GetUserByToken

func (s *Service) GetUserByToken(
	ctx context.Context, token string,
) (bool, dbgen.AuthServiceGetUserByTokenRow, error)

func (*Service) GetUserFromSessionCookie

func (s *Service) GetUserFromSessionCookie(c echo.Context) (
	bool, dbgen.AuthServiceGetUserByTokenRow, error,
)

func (*Service) GetUserSessions

func (s *Service) GetUserSessions(
	ctx context.Context, userID uuid.UUID,
) ([]dbgen.Session, error)

func (*Service) Login

func (s *Service) Login(
	ctx context.Context, email, password, ip, userAgent string,
) (dbgen.AuthServiceLoginCreateSessionRow, error)

func (*Service) SetSessionCookie

func (s *Service) SetSessionCookie(c echo.Context, token string)

Jump to

Keyboard shortcuts

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