Versions in this module Expand all Collapse all v0 v0.0.4 Jul 9, 2022 Changes in this version + var ProviderSet = wire.NewSet(NewData, NewEnforcerProvider, NewUserRepo, NewRefreshTokenRepo, NewRoleRepo, ...) + 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 struct + DbProvider gorm.DbProvider + func NewData(c *conf2.Data, dbProvider gorm.DbProvider, logger log.Logger) (*Data, func(), error) + type Migrate struct + func NewMigrate(data *Data) *Migrate + func (m *Migrate) Seed(ctx context.Context, sCtx *seed.Context) error + type RefreshTokenRepo struct + func (r *RefreshTokenRepo) Create(ctx context.Context, t *biz.RefreshToken) (err error) + func (r *RefreshTokenRepo) Find(ctx context.Context, token string, validOnly bool) (*biz.RefreshToken, error) + func (r *RefreshTokenRepo) Revoke(ctx context.Context, token string, used bool) (err error) + type Repo struct + DbProvider gorm.DbProvider + func (r *Repo) GetDb(ctx context.Context) *g.DB + type RoleRepo struct + func (r *RoleRepo) BuildFilterScope(q *v12.ListRolesRequest) func(db *gorm.DB) *gorm.DB + func (r *RoleRepo) DefaultSorting() []string + func (r *RoleRepo) FindByName(ctx context.Context, name string) (*biz.Role, error) + func (r *RoleRepo) GetDb(ctx context.Context) *gorm.DB + type UserAddrRepo struct + func (u *UserAddrRepo) FindByUser(ctx context.Context, userId string) ([]*biz.UserAddress, error) + func (u *UserAddrRepo) GetDb(ctx context.Context) *gorm.DB + func (u *UserAddrRepo) SetPrefer(ctx context.Context, addr *biz.UserAddress) error + type UserRepo struct + 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 struct + 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 struct + 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 struct + 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)