Documentation ¶
Index ¶
- Variables
- func GetDb(ctx context.Context, provider gorm.DbProvider) *g.DB
- func NewEnforcerProvider(logger log.Logger, dbProvider gorm.DbProvider) (*casbin.EnforcerProvider, error)
- func NewRefreshTokenRepo(data *Data) biz.RefreshTokenRepo
- func NewRoleRepo(data *Data, eventbus *eventbus.EventBus) biz.RoleRepo
- func NewUserAddrRepo(data *Data, eventbus *eventbus.EventBus) biz.UserAddressRepo
- func NewUserRepo(data *Data) biz.UserRepo
- func NewUserSettingRepo(data *Data, eventbus *eventbus.EventBus) biz.UserSettingRepo
- func NewUserTenantRepo(data *Data) biz.UserTenantRepo
- func NewUserTokenRepo(data *Data) biz.UserTokenRepo
- type Data
- type Migrate
- type RefreshTokenRepo
- type Repo
- type RoleRepo
- type UserAddrRepo
- type UserRepo
- func (u *UserRepo) AddLogin(ctx context.Context, user *biz.User, userLogin *biz.UserLogin) error
- func (u *UserRepo) AddToRole(ctx context.Context, user *biz.User, role *biz.Role) error
- func (u *UserRepo) Count(ctx context.Context, query *v1.UserFilter) (total int64, filtered int64, err error)
- func (u *UserRepo) Create(ctx context.Context, user *biz.User) error
- func (u *UserRepo) Delete(ctx context.Context, user *biz.User) error
- func (u *UserRepo) FindByEmail(ctx context.Context, email string) (*biz.User, error)
- func (u *UserRepo) FindByID(ctx context.Context, id string) (*biz.User, error)
- func (u *UserRepo) FindByLogin(ctx context.Context, loginProvider string, providerKey string) (*biz.User, error)
- func (u *UserRepo) FindByName(ctx context.Context, name string) (*biz.User, error)
- func (u *UserRepo) FindByPhone(ctx context.Context, phone string) (*biz.User, error)
- func (u *UserRepo) GetDb(ctx context.Context) *gorm.DB
- func (u *UserRepo) GetRoles(ctx context.Context, user *biz.User) ([]biz.Role, error)
- func (u *UserRepo) GetToken(ctx context.Context, user *biz.User, loginProvider string, name string) (token *string, err error)
- func (u *UserRepo) List(ctx context.Context, query *v1.ListUsersRequest) ([]*biz.User, error)
- func (u *UserRepo) ListLogin(ctx context.Context, user *biz.User) (userLogins []*biz.UserLogin, err error)
- func (u *UserRepo) RemoveFromRole(ctx context.Context, user *biz.User, role *biz.Role) error
- func (u *UserRepo) RemoveLogin(ctx context.Context, user *biz.User, loginProvider string, providerKey string) error
- func (u *UserRepo) RemoveToken(ctx context.Context, user *biz.User, loginProvider string, name string) (err error)
- func (u *UserRepo) SetToken(ctx context.Context, user *biz.User, loginProvider string, name string, ...) (err error)
- func (u *UserRepo) Update(ctx context.Context, user *biz.User, p *fieldmaskpb.FieldMask) error
- func (u *UserRepo) UpdateRoles(ctx context.Context, user *biz.User, roles []biz.Role) error
- type UserSettingRepo
- func (r *UserSettingRepo) BuildFilterScope(q *v1.GetSettingsRequest) func(db *gorm.DB) *gorm.DB
- func (r *UserSettingRepo) FindByUser(ctx context.Context, userId string, query *v1.GetSettingsRequest) ([]*biz.UserSetting, error)
- func (r *UserSettingRepo) GetDb(ctx context.Context) *gorm.DB
- func (r *UserSettingRepo) UpdateByUser(ctx context.Context, userId string, updateBatch []biz.UpdateUserSetting) error
- type UserTenantRepo
- func (u *UserTenantRepo) Get(ctx context.Context, userId string, tenantId string) (*biz.UserTenant, error)
- func (u *UserTenantRepo) IsIn(ctx context.Context, userId string, tenantId string) (bool, error)
- func (u *UserTenantRepo) JoinTenant(ctx context.Context, userId string, tenantId string, ...) (*biz.UserTenant, error)
- func (u *UserTenantRepo) RemoveFromTenant(ctx context.Context, userId string, tenantId string) error
- func (u *UserTenantRepo) Update(ctx context.Context, userTenant *biz.UserTenant) error
- type UserTokenRepo
- func (u *UserTokenRepo) Create(ctx context.Context, userId, loginProvider, name, value string) (*biz.UserToken, error)
- func (u *UserTokenRepo) DeleteByUserIdAndLoginProvider(ctx context.Context, userId, loginProvider string) error
- func (u *UserTokenRepo) DeleteByUserIdAndLoginProviderAndName(ctx context.Context, userId, loginProvider, name string) error
- func (u *UserTokenRepo) FindByUserIdAndLoginProvider(ctx context.Context, userId, loginProvider string) ([]*biz.UserToken, error)
- func (u *UserTokenRepo) FindByUserIdAndLoginProviderAndName(ctx context.Context, userId, loginProvider, name string) (*biz.UserToken, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewData, NewEnforcerProvider, NewUserRepo, NewRefreshTokenRepo, NewRoleRepo, NewUserTenantRepo, NewMigrate, NewUserTokenRepo, NewUserSettingRepo, NewUserAddrRepo, )
ProviderSet is data providers.
Functions ¶
func NewEnforcerProvider ¶
func NewEnforcerProvider(logger log.Logger, dbProvider gorm.DbProvider) (*casbin.EnforcerProvider, error)
func NewRefreshTokenRepo ¶
func NewRefreshTokenRepo(data *Data) biz.RefreshTokenRepo
func NewRoleRepo ¶
func NewUserAddrRepo ¶
func NewUserAddrRepo(data *Data, eventbus *eventbus.EventBus) biz.UserAddressRepo
func NewUserRepo ¶
func NewUserSettingRepo ¶
func NewUserSettingRepo(data *Data, eventbus *eventbus.EventBus) biz.UserSettingRepo
func NewUserTenantRepo ¶
func NewUserTenantRepo(data *Data) biz.UserTenantRepo
func NewUserTokenRepo ¶
func NewUserTokenRepo(data *Data) biz.UserTokenRepo
Types ¶
type RefreshTokenRepo ¶
type RefreshTokenRepo struct {
Repo
}
func (*RefreshTokenRepo) Create ¶
func (r *RefreshTokenRepo) Create(ctx context.Context, t *biz.RefreshToken) (err error)
func (*RefreshTokenRepo) Find ¶
func (r *RefreshTokenRepo) Find(ctx context.Context, token string, validOnly bool) (*biz.RefreshToken, error)
type Repo ¶
type Repo struct {
DbProvider gorm.DbProvider
}
type RoleRepo ¶
func (*RoleRepo) BuildFilterScope ¶
BuildFilterScope filter
func (*RoleRepo) DefaultSorting ¶
DefaultSorting get default sorting
func (*RoleRepo) FindByName ¶
type UserAddrRepo ¶
type UserAddrRepo struct { *kitgorm.Repo[biz.UserAddress, string, interface{}] }
func (*UserAddrRepo) FindByUser ¶
func (u *UserAddrRepo) FindByUser(ctx context.Context, userId string) ([]*biz.UserAddress, error)
func (*UserAddrRepo) SetPrefer ¶
func (u *UserAddrRepo) SetPrefer(ctx context.Context, addr *biz.UserAddress) error
type UserRepo ¶
type UserRepo struct {
Repo
}
func (*UserRepo) FindByEmail ¶
func (*UserRepo) FindByLogin ¶
func (*UserRepo) FindByName ¶
func (*UserRepo) FindByPhone ¶
func (*UserRepo) RemoveFromRole ¶
func (*UserRepo) RemoveLogin ¶
func (*UserRepo) RemoveToken ¶
type UserSettingRepo ¶
type UserSettingRepo struct { *kitgorm.Repo[biz.UserSetting, string, v1.GetSettingsRequest] }
func (*UserSettingRepo) BuildFilterScope ¶
func (r *UserSettingRepo) BuildFilterScope(q *v1.GetSettingsRequest) func(db *gorm.DB) *gorm.DB
BuildFilterScope filter
func (*UserSettingRepo) FindByUser ¶
func (r *UserSettingRepo) FindByUser(ctx context.Context, userId string, query *v1.GetSettingsRequest) ([]*biz.UserSetting, error)
func (*UserSettingRepo) UpdateByUser ¶
func (r *UserSettingRepo) UpdateByUser(ctx context.Context, userId string, updateBatch []biz.UpdateUserSetting) error
type UserTenantRepo ¶
type UserTenantRepo struct {
Repo
}
func (*UserTenantRepo) Get ¶
func (u *UserTenantRepo) Get(ctx context.Context, userId string, tenantId string) (*biz.UserTenant, error)
func (*UserTenantRepo) JoinTenant ¶
func (u *UserTenantRepo) JoinTenant(ctx context.Context, userId string, tenantId string, status biz.UserTenantStatus) (*biz.UserTenant, error)
func (*UserTenantRepo) RemoveFromTenant ¶
func (*UserTenantRepo) Update ¶
func (u *UserTenantRepo) Update(ctx context.Context, userTenant *biz.UserTenant) error
type UserTokenRepo ¶
type UserTokenRepo struct {
Repo
}
func (*UserTokenRepo) DeleteByUserIdAndLoginProvider ¶
func (u *UserTokenRepo) DeleteByUserIdAndLoginProvider(ctx context.Context, userId, loginProvider string) error
func (*UserTokenRepo) DeleteByUserIdAndLoginProviderAndName ¶
func (u *UserTokenRepo) DeleteByUserIdAndLoginProviderAndName(ctx context.Context, userId, loginProvider, name string) error
func (*UserTokenRepo) FindByUserIdAndLoginProvider ¶
func (*UserTokenRepo) FindByUserIdAndLoginProviderAndName ¶
Click to show internal directories.
Click to hide internal directories.