sessions

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Querier

type Querier interface {
	CountActiveAuthSessions(ctx context.Context) (int64, error)
	CountActiveAuthSessionsByUserID(ctx context.Context, arg db.CountActiveAuthSessionsByUserIDParams) (int64, error)
	GetAuthSessionByID(ctx context.Context, arg db.GetAuthSessionByIDParams) (db.AuthSession, error)
	GetUserByID(ctx context.Context, arg db.GetUserByIDParams) (db.User, error)
	ListActiveAuthSessionsByUserPage(ctx context.Context, arg db.ListActiveAuthSessionsByUserPageParams) ([]db.AuthSession, error)
	ListActiveAuthSessionsPage(ctx context.Context, arg db.ListActiveAuthSessionsPageParams) ([]db.AuthSession, error)
	ListAuthSessionsByUserID(ctx context.Context, arg db.ListAuthSessionsByUserIDParams) ([]db.AuthSession, error)
	RevokeAllActiveAuthSessions(ctx context.Context, arg db.RevokeAllActiveAuthSessionsParams) (int64, error)
	RevokeAuthSession(ctx context.Context, arg db.RevokeAuthSessionParams) (db.AuthSession, error)
	RevokeOtherAuthSessionsForUser(ctx context.Context, arg db.RevokeOtherAuthSessionsForUserParams) (int64, error)
}

type Service

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

func NewService

func NewService(queries Querier) *Service

func (*Service) ListAdminSessionsPage

func (s *Service) ListAdminSessionsPage(ctx context.Context, currentSessionID string, limit, offset int32) (*api.AuthSessionPage, error)

func (*Service) ListProfileSessionsPage

func (s *Service) ListProfileSessionsPage(ctx context.Context, user db.User, currentSessionID string, limit, offset int32) (*api.AuthSessionPage, error)

func (*Service) RevokeAdminSession

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

func (*Service) RevokeAllAdminSessions

func (s *Service) RevokeAllAdminSessions(ctx context.Context) error

func (*Service) RevokeOtherProfileSessions

func (s *Service) RevokeOtherProfileSessions(ctx context.Context, user db.User, currentSessionID string) error

func (*Service) RevokeProfileSession

func (s *Service) RevokeProfileSession(ctx context.Context, user db.User, sessionID uuid.UUID) error

func (*Service) ValidateSession

func (s *Service) ValidateSession(ctx context.Context, sessionID string) (bool, error)

Jump to

Keyboard shortcuts

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