Documentation ¶
Index ¶
- func ApplySingleActionDB(ctx context.Context, tx pgx.Tx, userDBID int64, applierDBID pgtype.Int8, ...) error
- type DBStore
- func (s *DBStore) AddBlock(ctx context.Context, targetUser, blocker uint) error
- func (s *DBStore) AddFollower(ctx context.Context, targetUser, follower uint) error
- func (s *DBStore) ApplyActions(ctx context.Context, actions []*ms.ModAction) error
- func (s *DBStore) CachedCount(ctx context.Context) int
- func (s *DBStore) Count(ctx context.Context) (int64, error)
- func (s *DBStore) Disconnect()
- func (s *DBStore) Get(ctx context.Context, username string) (*entity.User, error)
- func (s *DBStore) GetAPIKey(ctx context.Context, uuid string) (string, error)
- func (s *DBStore) GetActionHistory(ctx context.Context, userUUID string) ([]*ms.ModAction, error)
- func (s *DBStore) GetActions(ctx context.Context, userUUID string) (map[string]*ms.ModAction, error)
- func (s *DBStore) GetBlockedBy(ctx context.Context, uid uint) ([]*entity.User, error)
- func (s *DBStore) GetBlocks(ctx context.Context, uid uint) ([]*entity.User, error)
- func (s *DBStore) GetBot(ctx context.Context, botType macondopb.BotRequest_BotCode) (*entity.User, error)
- func (s *DBStore) GetBriefProfiles(ctx context.Context, uuids []string) (map[string]*pb.BriefProfile, error)
- func (s *DBStore) GetByAPIKey(ctx context.Context, apikey string) (*entity.User, error)
- func (s *DBStore) GetByEmail(ctx context.Context, email string) (*entity.User, error)
- func (s *DBStore) GetByUUID(ctx context.Context, uuid string) (*entity.User, error)
- func (s *DBStore) GetFollowedBy(ctx context.Context, uid uint) ([]*entity.User, error)
- func (s *DBStore) GetFollows(ctx context.Context, uid uint) ([]*entity.User, error)
- func (s *DBStore) GetFullBlocks(ctx context.Context, uid uint) ([]*entity.User, error)
- func (s *DBStore) GetModList(ctx context.Context) (*pb.GetModListResponse, error)
- func (s *DBStore) ListAllIDs(ctx context.Context) ([]string, error)
- func (s *DBStore) New(ctx context.Context, u *entity.User) error
- func (s *DBStore) RemoveActions(ctx context.Context, actions []*ms.ModAction) error
- func (s *DBStore) RemoveBlock(ctx context.Context, targetUser, blocker uint) error
- func (s *DBStore) RemoveFollower(ctx context.Context, targetUser, follower uint) error
- func (s *DBStore) ResetAPIKey(ctx context.Context, uuid string) (string, error)
- func (s *DBStore) ResetPersonalInfo(ctx context.Context, uuid string) error
- func (s *DBStore) ResetProfile(ctx context.Context, uid string) error
- func (s *DBStore) ResetRatings(ctx context.Context, uuid string) error
- func (s *DBStore) ResetStats(ctx context.Context, uuid string) error
- func (s *DBStore) ResetStatsAndRatings(ctx context.Context, uuid string) error
- func (s *DBStore) SetAvatarUrl(ctx context.Context, uuid string, avatarUrl string) error
- func (s *DBStore) SetNotoriety(ctx context.Context, uuid string, notoriety int) error
- func (s *DBStore) SetPassword(ctx context.Context, uuid string, hashpass string) error
- func (s *DBStore) SetPermissions(ctx context.Context, req *cpb.PermissionsRequest) error
- func (s *DBStore) SetPersonalInfo(ctx context.Context, uuid string, email string, firstName string, ...) error
- func (s *DBStore) SetRatings(ctx context.Context, p0uuid string, p1uuid string, variant entity.VariantKey, ...) error
- func (s *DBStore) SetStats(ctx context.Context, p0uuid string, p1uuid string, variant entity.VariantKey, ...) error
- func (s *DBStore) Username(ctx context.Context, uuid string) (string, error)
- func (s *DBStore) UsersByPrefix(ctx context.Context, prefix string) ([]*pb.BasicUser, error)
- type DBUniqueValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
DBStore is a postgres-backed store for users.
func (*DBStore) AddFollower ¶
AddFollower creates a follower -> target follow.
func (*DBStore) ApplyActions ¶
func (*DBStore) Disconnect ¶
func (s *DBStore) Disconnect()
func (*DBStore) GetActionHistory ¶
func (*DBStore) GetActions ¶
func (*DBStore) GetBlockedBy ¶
GetBlockedBy gets all the users that are blocking the passed-in user DB ID.
func (*DBStore) GetBriefProfiles ¶
func (*DBStore) GetByAPIKey ¶
GetByAPIKey gets a user by api key. It does not try to fetch the profile. We only call this for API functions where we care about access levels, etc.
func (*DBStore) GetByEmail ¶
GetByEmail gets the user by email. It does not try to get the profile. We don't get the profile here because GetByEmail is only used for things like password resets and there is no need.
func (*DBStore) GetFollowedBy ¶
GetFollowedBy gets all the users that are following the passed-in user DB ID.
func (*DBStore) GetFollows ¶
GetFollows gets all the users that the passed-in user DB ID is following.
func (*DBStore) GetFullBlocks ¶
GetFullBlocks gets users uid is blocking AND users blocking uid
func (*DBStore) GetModList ¶
func (*DBStore) ListAllIDs ¶
List all user IDs.
func (*DBStore) RemoveActions ¶
func (*DBStore) RemoveBlock ¶
func (*DBStore) RemoveFollower ¶
RemoveFollower removes a follower -> target follow.
func (*DBStore) ResetAPIKey ¶
func (*DBStore) ResetPersonalInfo ¶
func (*DBStore) ResetProfile ¶
func (*DBStore) ResetRatings ¶
func (*DBStore) ResetStatsAndRatings ¶
func (*DBStore) SetAvatarUrl ¶
SetAvatarUrl sets the avatar_url (profile field) for the user.
func (*DBStore) SetNotoriety ¶
func (*DBStore) SetPassword ¶
SetPassword sets the password for the user. The password is already hashed.
func (*DBStore) SetPermissions ¶
func (*DBStore) SetPersonalInfo ¶
func (*DBStore) SetRatings ¶
func (s *DBStore) SetRatings(ctx context.Context, p0uuid string, p1uuid string, variant entity.VariantKey, p0Rating *entity.SingleRating, p1Rating *entity.SingleRating) error
SetRatings set the specific ratings for the given variant in a transaction.
type DBUniqueValues ¶
type DBUniqueValues struct {
// contains filtered or unexported fields
}