service

package
v0.0.0-...-81d4deb Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBUsersToModel

func DBUsersToModel(users []database.User) []models.User

Types

type Service

type Service struct {
	DB           *database.Queries
	WebAuthn     *webauthn.WebAuthn
	RelyingParty rp.RelyingParty
}

func NewService

func NewService(ctx context.Context, db *database.Queries) (*Service, error)

func (*Service) DevLoginForm

func (s *Service) DevLoginForm() templ.Component

func (*Service) FinishInvite

func (s *Service) FinishInvite(w http.ResponseWriter, r *http.Request, kthid string) (bool, httputil.ToResponse)

func (*Service) GetLoggedInKTHID

func (s *Service) GetLoggedInKTHID(r *http.Request) (string, error)

func (*Service) GetLoggedInUser

func (s *Service) GetLoggedInUser(r *http.Request) (*models.User, error)

func (*Service) GetUser

func (s *Service) GetUser(ctx context.Context, kthid string) (*models.User, error)

func (*Service) ListPasskeysForUser

func (s *Service) ListPasskeysForUser(ctx context.Context, kthid string) ([]models.Passkey, error)

func (*Service) LoginUser

func (s *Service) LoginUser(ctx context.Context, kthid string) httputil.ToResponse

func (*Service) Logout

func (*Service) RedirectToLogin

func (s *Service) RedirectToLogin(w http.ResponseWriter, r *http.Request, nextURL string)

func (*Service) UserSetNameChangeRequest

func (s *Service) UserSetNameChangeRequest(ctx context.Context, kthid string, firstName string, familyName string) (models.User, error)

func (*Service) UserSetYear

func (s *Service) UserSetYear(ctx context.Context, kthid string, yearTag string) (models.User, error)

Jump to

Keyboard shortcuts

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