Versions in this module Expand all Collapse all v1 v1.85.0 Jun 13, 2026 Changes in this version + const DefaultListLimit + const DefaultObserveTTL + const MaxListLimit + const MaxNameLen + const SourceAdmin + const SourceAuth + var ErrAlreadyExists = errors.New("user already exists") + var ErrNotFound = errors.New("user not found") + func NameFromClaims(claims map[string]any, fullName string) (first, last string) + func NormalizeEmail(email string) (string, error) + func SanitizeName(name string) string + func SplitFullName(full string) (first, last string) + func ValidateName(name string) error + type Directory struct + func NewDirectory(store Store) *Directory + func (d *Directory) Observe(email, firstName, lastName string) + type Filter struct + Limit int + Offset int + Query string + type PostgresStore struct + func NewPostgresStore(db *sql.DB) *PostgresStore + func (s *PostgresStore) Delete(ctx context.Context, email string) error + func (s *PostgresStore) Get(ctx context.Context, email string) (*User, error) + func (s *PostgresStore) Insert(ctx context.Context, u User) error + func (s *PostgresStore) List(ctx context.Context, filter Filter) ([]User, int, error) + func (s *PostgresStore) Observe(ctx context.Context, email, firstName, lastName string) error + func (s *PostgresStore) Update(ctx context.Context, email string, u Update) error + type Store interface + Delete func(ctx context.Context, email string) error + Get func(ctx context.Context, email string) (*User, error) + Insert func(ctx context.Context, u User) error + List func(ctx context.Context, filter Filter) ([]User, int, error) + Observe func(ctx context.Context, email, firstName, lastName string) error + Update func(ctx context.Context, email string, u Update) error + type Update struct + FirstName *string + LastName *string + type User struct + AddedBy string + Confirmed bool + CreatedAt time.Time + Email string + FirstName string + LastName string + LastSeenAt *time.Time + Source string + UpdatedAt time.Time