Documentation
¶
Index ¶
- Constants
- Variables
- type APIImage
- type APIUser
- type AutowpResourceAccess
- type Claims
- type CreateUserOptions
- type DBUser
- type GetUsersOptions
- type Repository
- func (s *Repository) AfterUserCreated(ctx context.Context, userID int64) error
- func (s *Repository) DecVotes(ctx context.Context, userID int64) error
- func (s *Repository) DeleteUser(ctx context.Context, userID int64) (bool, error)
- func (s *Repository) EnsureUserImported(ctx context.Context, claims Claims) (int64, string, error)
- func (s *Repository) ExportUsersToKeycloak(ctx context.Context) error
- func (s *Repository) GetVotesLeft(ctx context.Context, userID int64) (int, error)
- func (s *Repository) IncForumMessages(ctx context.Context, userID int64) error
- func (s *Repository) IncForumTopics(ctx context.Context, userID int64) error
- func (s *Repository) NextMessageTime(ctx context.Context, userID int64) (time.Time, error)
- func (s *Repository) PasswordMatch(ctx context.Context, userID int64, password string) (bool, error)
- func (s *Repository) RefreshUserConflicts(ctx context.Context, userID int64) error
- func (s *Repository) RegisterVisit(ctx context.Context, userID int64) error
- func (s *Repository) RestoreVotes(ctx context.Context) error
- func (s *Repository) SetDisableUserCommentsNotifications(ctx context.Context, userID int64, toUserID int64, disabled bool) error
- func (s *Repository) SetupPrivateRouter(r *gin.Engine)
- func (s *Repository) TouchLastMessage(ctx context.Context, userID int64) error
- func (s *Repository) UpdateSpecsVolumes(ctx context.Context) error
- func (s *Repository) UpdateUserVoteLimit(ctx context.Context, userID int64) error
- func (s *Repository) UpdateVotesLimits(ctx context.Context) (int, error)
- func (s *Repository) User(ctx context.Context, options GetUsersOptions) (*DBUser, error)
- func (s *Repository) UserAvgVote(ctx context.Context, userID int64) (float64, error)
- func (s *Repository) UserIDByIdentity(ctx context.Context, identity string) (int64, error)
- func (s *Repository) UserPreferences(ctx context.Context, userID int64, toUserID int64) (*UserPreferences, error)
- func (s *Repository) Users(ctx context.Context, options GetUsersOptions) ([]DBUser, *util.Pages, error)
- type ResourceAccess
- type UserExtractor
- type UserPreferences
Constants ¶
View Source
const ( Decimal = 10 BitSize64 = 64 )
View Source
const KeycloakExternalAccountID = "keycloak"
Variables ¶
View Source
var ErrUserNotFound = errors.New("user not found")
Functions ¶
This section is empty.
Types ¶
type APIImage ¶
func ImageToAPIImage ¶
type APIUser ¶
type APIUser struct {
ID int64 `json:"id"`
Name string `json:"name"`
Deleted bool `json:"deleted"`
LongAway bool `json:"long_away"`
Green bool `json:"green"`
Route []string `json:"route"`
Identity string `json:"identity"`
Avatar *APIImage `json:"avatar,omitempty"`
Gravatar string `json:"gravatar,omitempty"`
LastOnline *time.Time `json:"last_online,omitempty"`
SpecsWeight float64 `json:"specs_weight,omitempty"`
}
APIUser APIUser.
type AutowpResourceAccess ¶
type AutowpResourceAccess struct {
Roles []string `json:"roles,omitempty"`
}
type Claims ¶
type Claims struct {
jwx.Claims
Audience interface{} `json:"aud,omitempty"`
Locale string `json:"locale,omitempty"`
ResourceAccess ResourceAccess `json:"resource_access,omitempty"`
}
type CreateUserOptions ¶
type CreateUserOptions struct {
UserName string `json:"user_name"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Timezone string `json:"timezone"`
Language string `json:"language"`
Password string `json:"password"`
PasswordConfirm string `json:"password_confirm"`
Captcha string `json:"captcha"`
}
CreateUserOptions CreateUserOptions.
type DBUser ¶
type DBUser struct {
ID int64
Name string
Deleted bool
Identity *string
LastOnline *time.Time
Role string
EMail *string
Img *int
SpecsWeight float64
}
DBUser DBUser.
type GetUsersOptions ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository Main Object.
func NewRepository ¶
func NewRepository( autowpDB *goqu.Database, db *goqu.Database, usersSalt string, languages map[string]config.LanguageConfig, keyCloak *gocloak.GoCloak, keyCloakConfig config.KeycloakConfig, messageInterval int64, ) *Repository
NewRepository constructor.
func (*Repository) AfterUserCreated ¶
func (s *Repository) AfterUserCreated(ctx context.Context, userID int64) error
func (*Repository) DecVotes ¶
func (s *Repository) DecVotes(ctx context.Context, userID int64) error
func (*Repository) DeleteUser ¶
func (*Repository) EnsureUserImported ¶
func (*Repository) ExportUsersToKeycloak ¶
func (s *Repository) ExportUsersToKeycloak(ctx context.Context) error
func (*Repository) GetVotesLeft ¶
func (*Repository) IncForumMessages ¶ added in v1.18.0
func (s *Repository) IncForumMessages(ctx context.Context, userID int64) error
func (*Repository) IncForumTopics ¶ added in v1.23.0
func (s *Repository) IncForumTopics(ctx context.Context, userID int64) error
func (*Repository) NextMessageTime ¶ added in v1.19.0
func (*Repository) PasswordMatch ¶
func (*Repository) RefreshUserConflicts ¶
func (s *Repository) RefreshUserConflicts(ctx context.Context, userID int64) error
func (*Repository) RegisterVisit ¶ added in v1.32.0
func (s *Repository) RegisterVisit(ctx context.Context, userID int64) error
func (*Repository) RestoreVotes ¶
func (s *Repository) RestoreVotes(ctx context.Context) error
func (*Repository) SetDisableUserCommentsNotifications ¶ added in v1.1.0
func (*Repository) SetupPrivateRouter ¶ added in v1.1.0
func (s *Repository) SetupPrivateRouter(r *gin.Engine)
func (*Repository) TouchLastMessage ¶ added in v1.18.0
func (s *Repository) TouchLastMessage(ctx context.Context, userID int64) error
func (*Repository) UpdateSpecsVolumes ¶
func (s *Repository) UpdateSpecsVolumes(ctx context.Context) error
func (*Repository) UpdateUserVoteLimit ¶
func (s *Repository) UpdateUserVoteLimit(ctx context.Context, userID int64) error
func (*Repository) UpdateVotesLimits ¶
func (s *Repository) UpdateVotesLimits(ctx context.Context) (int, error)
func (*Repository) User ¶
func (s *Repository) User(ctx context.Context, options GetUsersOptions) (*DBUser, error)
func (*Repository) UserAvgVote ¶
func (*Repository) UserIDByIdentity ¶ added in v1.41.0
func (*Repository) UserPreferences ¶ added in v1.1.0
func (s *Repository) UserPreferences(ctx context.Context, userID int64, toUserID int64) (*UserPreferences, error)
func (*Repository) Users ¶
func (s *Repository) Users(ctx context.Context, options GetUsersOptions) ([]DBUser, *util.Pages, error)
type ResourceAccess ¶
type ResourceAccess struct {
Autowp AutowpResourceAccess `json:"autowp,omitempty"`
}
type UserExtractor ¶
type UserExtractor struct {
// contains filtered or unexported fields
}
func NewUserExtractor ¶
func NewUserExtractor(enforcer *casbin.Enforcer, imageStorage *storage.Storage) *UserExtractor
type UserPreferences ¶ added in v1.1.0
type UserPreferences struct {
DisableCommentsNotifications bool `db:"disable_comments_notifications" json:"disable_comments_notifications"`
}
UserPreferences object.
Click to show internal directories.
Click to hide internal directories.