Documentation ¶
Index ¶
- type Credential
- type GormCredentialRepo
- type GormRepository
- func (repo *GormRepository[IdType, GormType, ModelType]) DeleteById(ctx context.Context, id IdType) error
- func (repo *GormRepository[IdType, GormType, ModelType]) FindAll(ctx context.Context) ([]ModelType, error)
- func (repo *GormRepository[IdType, GormType, ModelType]) FindById(ctx context.Context, id IdType) (ModelType, error)
- func (repo *GormRepository[IdType, GormType, ModelType]) Save(ctx context.Context, entity ModelType) error
- func (repo *GormRepository[IdType, GormType, ModelType]) Update(ctx context.Context, entity ModelType) error
- type GormUserRepo
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type GormCredentialRepo ¶
type GormCredentialRepo struct { GormRepository[string, *Credential, *domain.Credential] }
func NewGormCredentialRepo ¶
func NewGormCredentialRepo(db *gorm.DB) *GormCredentialRepo
func (*GormCredentialRepo) FindByCredentialId ¶
func (r *GormCredentialRepo) FindByCredentialId(ctx context.Context, credentialId []byte) (*domain.Credential, error)
func (*GormCredentialRepo) FindByUserID ¶
func (r *GormCredentialRepo) FindByUserID(ctx context.Context, userID uuid.UUID) ([]*domain.Credential, error)
type GormRepository ¶
type GormRepository[IdType comparable, GormType interface{}, ModelType interface{}] struct { // contains filtered or unexported fields }
func NewGormRepository ¶
func NewGormRepository[IdType comparable, GormType interface{}, ModelType interface{}](db *gorm.DB, toGormModel func(entity ModelType) GormType, toModel func(entity GormType) ModelType) *GormRepository[IdType, GormType, ModelType]
func (*GormRepository[IdType, GormType, ModelType]) DeleteById ¶
func (repo *GormRepository[IdType, GormType, ModelType]) DeleteById(ctx context.Context, id IdType) error
func (*GormRepository[IdType, GormType, ModelType]) FindAll ¶
func (repo *GormRepository[IdType, GormType, ModelType]) FindAll(ctx context.Context) ([]ModelType, error)
func (*GormRepository[IdType, GormType, ModelType]) FindById ¶
func (repo *GormRepository[IdType, GormType, ModelType]) FindById(ctx context.Context, id IdType) (ModelType, error)
type GormUserRepo ¶
type GormUserRepo struct { GormRepository[string, *User, *domain.User] }
func NewGormUserRepo ¶
func NewGormUserRepo(db *gorm.DB) *GormUserRepo
func (*GormUserRepo) ExistsUserId ¶
func (*GormUserRepo) FindByUserId ¶
Click to show internal directories.
Click to hide internal directories.