Help us shape the future of Go! Take the 2026 Go Developer Survey

emailcase

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package emailcase keeps account addresses lower-cased: the email of a User and of an Invitation, so one address is one row whatever case it was typed in, the unique index on users.email holds case-insensitively, and an Invitation matches the User it names.

Hook lower-cases the email of every create and update of those two, so no write path can forget it. It runs on every client (db.NewEntClient, db.NewEntClientOnTx and the event bus's transaction client; a client from Tx inherits it). The CHECK constraints <table>_email_lower (ent/schema LowerEmailCheck) refuse a write that went around it, so a missed path fails loudly instead of making a second account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hook

func Hook(next ent.Mutator) ent.Mutator

Hook lower-cases the email field of a User or Invitation mutation that sets it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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