package
0.0.0-20240604151634-ee5cee47de87
Repository: https://github.com/gocopper/pkg.git
Documentation: pkg.go.dev

# Packages

Package cauthtest provides utilities to test cauth.

# Functions

GetCurrentSession returns the session in the HTTP request context.
GetCurrentUser returns the user in the HTTP request context.
HasVerifiedSession checks if the context has a valid session.
LoadConfig loads the config for cauth module.
NewQueries instantiates and returns Queries.
NewRouter instantiates and returns a new Router.
No description provided by the author
NewSvc instantiates and returns a new Svc.
NewVerifySessionMiddleware instantiates and creates a new VerifySessionMiddleware.

# Variables

ErrInvalidCredentials is returned when a credential check fails.
ErrNotFound is returned when a model does not exist in the repository.
ErrUserAlreadyExists is returned when a user already exists during the signup process.
go:embed migrations.sqlite.sql.
WireModule can be used as part of google/wire setup.

# Structs

Config configures the cauth module.
LoginParams hold the params needed to login a user.
NewRouterParams holds the dependencies to create a new Router.
Queries holds the SQL queries used by cauth.
Router handles incoming HTTP requests related the cauth package.
Session represents a single logged-in session that a user is able create after providing valid login credentials.
SessionResult is usually used when a new session is created.
SetSessionIfAnyMiddleware works the same way as VerifySessionMiddleware, but does not return an error if no session is found.
SignupParams hold the params needed to signup a new user.
Svc provides methods to manage users and sessions.
User represents a user who has created an account.
VerifyEmailParams hold the params needed to verify an email.
VerifySessionMiddleware is a middleware that checks for a valid session uuid and token in: 1.