userstore

package
v0.0.0-...-a8f05fa Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmailAlreadyExists = errors.New("email already exists")
View Source
var ErrUsernameAlreadyExists = errors.New("username already exists")

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider = shareduser.AuthProvider

type Store

type Store interface {
	Create(ctx context.Context, displayName, username, hashedPassword, role string) (*User, error)
	CreateWithEmail(ctx context.Context, displayName, username, hashedPassword, role, email string) (*User, error)
	GetByID(ctx context.Context, id string) (*User, error)
	GetByIDAdmin(ctx context.Context, id string) (*User, error)
	GetByEmail(ctx context.Context, email string) (*User, error)
	GetByUsername(ctx context.Context, username string) (*model.User, error)
	GetByIDWithPassword(ctx context.Context, id string) (*model.User, error)
	UpdateLastLogin(ctx context.Context, id string) error
	UpdatePassword(ctx context.Context, id string, hashedPassword string) error
	UpdateDisplayName(ctx context.Context, id string, displayName string) error
	UpdateUsername(ctx context.Context, id string, username string) error
	RequestEmailChange(ctx context.Context, id string, email string) (*User, error)
	ClearPendingEmailChange(ctx context.Context, id string) error
	ConfirmEmailChange(ctx context.Context, id string, email string) (*User, error)
	ListAuthProviders(ctx context.Context, id string) ([]*AuthProvider, error)
	UnlinkAuthProvider(ctx context.Context, id string, provider string) error
	SetActive(ctx context.Context, id string, active bool) error
	SetEmailVerified(ctx context.Context, id string, verified bool) error
	List(ctx context.Context, offset, limit int, search string) ([]*User, int, error)
	UpsertOAuth(ctx context.Context, provider, providerID, email, displayName, avatarURL string) (*User, error)
	UpdateRole(ctx context.Context, id string, role string) error
}

func New

func New(db *bun.DB, logger *zap.Logger) Store

type User

type User = shareduser.User

Jump to

Keyboard shortcuts

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