Documentation
¶
Index ¶
- Variables
- type Store
- func (s *Store) ForwardTenantSlug(ctx context.Context, slug string) (string, error)
- func (s *Store) ForwardUserUsername(ctx context.Context, username string) (string, error)
- func (s *Store) GetByID(ctx context.Context, id uuid.UUID) (*User, error)
- func (s *Store) GetEmailsByIDs(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]string, error)
- func (s *Store) GetIDByUsername(ctx context.Context, username string) (uuid.UUID, error)
- func (s *Store) GetUsernamesByIDs(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]string, error)
- func (s *Store) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]struct{ ... }, error)
- func (s *Store) UpdateEmail(ctx context.Context, id uuid.UUID, email string) error
- func (s *Store) UpdateUsername(ctx context.Context, id uuid.UUID, username string) error
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSlugNotFound = errors.New("slug_not_found")
ErrSlugNotFound is returned when neither the tenants/users table nor the rename history contains the requested slug.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides minimal identity lookups/mutations against the profiles schema.
func (*Store) ForwardTenantSlug ¶ added in v0.12.4
ForwardTenantSlug resolves any slug — current OR historical — to the current slug of the owning tenant. Returns ErrSlugNotFound when no row matches.
Lookup order:
- Direct match on tenants.slug (the typical "no rename" case).
- Match on tenant_renames.from_slug, joined to live tenants row, most-recent-rename wins (handles rename-back + post-hard-delete reuse).
func (*Store) ForwardUserUsername ¶ added in v0.7.0
ForwardUserUsername is the user-namespace equivalent of ForwardTenantSlug.
func (*Store) GetEmailsByIDs ¶
GetEmailsByIDs returns user_id -> email.
func (*Store) GetIDByUsername ¶
func (*Store) GetUsernamesByIDs ¶
func (s *Store) GetUsernamesByIDs(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]string, error)
GetUsernamesByIDs returns user_id -> username (empty if NULL).
func (*Store) GetUsersByIDs ¶
func (s *Store) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]struct{ Username, Email string }, error)
GetUsersByIDs returns username+email pairs for given IDs.
func (*Store) UpdateEmail ¶
Click to show internal directories.
Click to hide internal directories.