Documentation
¶
Index ¶
- type Users
- func (u *Users) Create(user *t.User) error
- func (u *Users) Delete(uid t.Uid, hard bool) error
- func (u *Users) Get(uid t.Uid) (*t.User, error)
- func (u *Users) GetAll(ids ...t.Uid) ([]t.User, error)
- func (u *Users) GetByCred(method, value string) (t.Uid, error)
- func (u *Users) GetUnvalidated(lastUpdatedBefore time.Time, limit int) ([]t.Uid, error)
- func (u *Users) UnreadCount(ids ...types.Uid) (map[t.Uid]int, error)
- func (u *Users) Update(uid types.Uid, update map[string]any) error
- func (u *Users) UpdateTags(uid types.Uid, add, remove, reset []string) ([]string, error)
- type UsersArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) Create ¶
UserCreate creates a new user. Returns error and true if error
is due to duplicate user name, false for any other error
func (*Users) Delete ¶
UserDelete deletes specified user: wipes completely (hard-delete) or marks as deleted. TODO: report when the user is not found.
func (*Users) Get ¶
Get fetches a single user by user id. If user is not found it returns (nil, nil)
func (*Users) GetUnvalidated ¶
GetUnvalidated returns a list of uids which have never logged in, have no
validated credentials and haven't been updated since lastUpdatedBefore.
func (*Users) UnreadCount ¶
UnreadCount returns the total number of unread messages in all topics with
the R permission. If read fails, the counts are still returned with the original
user IDs but with the unread count undefined and non-nil error.
type UsersArgs ¶
type UsersArgs struct { DB *pgxpool.Pool Utils *utils.Utils Cfg *config.StorePostgresConfig UGen *types.UidGenerator }