Documentation
¶
Index ¶
- type EntgoRepository
- func (r *EntgoRepository) AddOrUpdateResponse(ctx context.Context, takeID uuid.UUID, itm *domain.Item) (*domain.Response, error)
- func (r *EntgoRepository) CreateOrUpdateNorm(ctx context.Context, nrm *domain.Norm) (*domain.Norm, error)
- func (r *EntgoRepository) CreateOrUpdateResult(ctx context.Context, res *domain.Result) (*domain.Result, error)
- func (r *EntgoRepository) CreateOrUpdateSample(ctx context.Context, smp *domain.Sample) (*domain.Sample, error)
- func (r *EntgoRepository) CreateOrUpdateTagFromArgs(ctx context.Context, args *domain.CreateTagArgs) error
- func (r *EntgoRepository) CreateOrUpdateTestFromArgs(ctx context.Context, args *domain.CreateTestArgs) error
- func (r *EntgoRepository) CreateOrUpdateUserSession(ctx context.Context, s *domain.UserSession) (*domain.UserSession, error)
- func (r *EntgoRepository) CreateTake(ctx context.Context, tk *domain.Take) (*domain.Take, error)
- func (r *EntgoRepository) CreateUser(ctx context.Context, u *domain.User) (*domain.User, error)
- func (r *EntgoRepository) FinishedTakeCount(ctx context.Context) (int, error)
- func (r *EntgoRepository) GetDataForDurationCalculation(ctx context.Context) ([]*domain.Test, error)
- func (r *EntgoRepository) GetDataForMarkCalculation(ctx context.Context) ([]*domain.Test, error)
- func (r *EntgoRepository) GetDataForNormCalculation(ctx context.Context, crit domain.SampleCriteria) ([]*domain.NormCalculationData, error)
- func (r *EntgoRepository) GetSamples(ctx context.Context) ([]*domain.Sample, error)
- func (r *EntgoRepository) GetScaleNorms(ctx context.Context, scaleID uuid.UUID, sampleIDs []uuid.UUID) ([]*domain.Norm, error)
- func (r *EntgoRepository) GetTagIDsByCodes(ctx context.Context, codes ...string) ([]uuid.UUID, error)
- func (r *EntgoRepository) GetTagsByCodes(ctx context.Context, locale string, codes ...string) ([]*domain.Tag, error)
- func (r *EntgoRepository) GetTake(ctx context.Context, takeID uuid.UUID) (*domain.Take, error)
- func (r *EntgoRepository) GetTakeData(ctx context.Context, tk *domain.Take, locale string) (*domain.Test, error)
- func (r *EntgoRepository) GetTestByCode(ctx context.Context, code string, locale string) (*domain.Test, error)
- func (r *EntgoRepository) GetTests(ctx context.Context, args *domain.QueryTestsArgs) ([]*domain.Test, error)
- func (r *EntgoRepository) GetUserByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r *EntgoRepository) GetUserByID(ctx context.Context, id uuid.UUID) (*domain.User, error)
- func (r *EntgoRepository) GetUserBySession(ctx context.Context, s *domain.UserSession) (*domain.User, error)
- func (r *EntgoRepository) GetUserCount(ctx context.Context) (int, error)
- func (r *EntgoRepository) IfEmailRegistered(ctx context.Context, email string) (bool, error)
- func (r *EntgoRepository) IfSessionRegistered(ctx context.Context, s *domain.UserSession) (bool, error)
- func (r *EntgoRepository) ResponseCount(ctx context.Context) (int, error)
- func (r *EntgoRepository) TestCount(ctx context.Context) (int, error)
- func (r *EntgoRepository) UpdateTake(ctx context.Context, tk *domain.Take) (*domain.Take, error)
- func (r *EntgoRepository) UpdateTakeMark(ctx context.Context, takeID uuid.UUID, mark int) error
- func (r *EntgoRepository) UpdateTestDuration(ctx context.Context, testID uuid.UUID, duration time.Duration) error
- func (r *EntgoRepository) UpdateTestMark(ctx context.Context, testID uuid.UUID, mark float64) error
- func (r *EntgoRepository) UpdateUser(ctx context.Context, u *domain.User) (*domain.User, error)
- func (r *EntgoRepository) UpdateUserSessionLastActivityBySID(ctx context.Context, sid string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntgoRepository ¶
type EntgoRepository struct {
// contains filtered or unexported fields
}
func NewEntgoRepository ¶
func NewEntgoRepository( client *ent.Client, logger *logger.Logger, ) *EntgoRepository
func (*EntgoRepository) AddOrUpdateResponse ¶
func (*EntgoRepository) CreateOrUpdateNorm ¶
func (*EntgoRepository) CreateOrUpdateResult ¶
func (*EntgoRepository) CreateOrUpdateSample ¶
func (*EntgoRepository) CreateOrUpdateTagFromArgs ¶
func (r *EntgoRepository) CreateOrUpdateTagFromArgs(ctx context.Context, args *domain.CreateTagArgs) error
func (*EntgoRepository) CreateOrUpdateTestFromArgs ¶
func (r *EntgoRepository) CreateOrUpdateTestFromArgs(ctx context.Context, args *domain.CreateTestArgs) error
TODO: function too long, refactor please
func (*EntgoRepository) CreateOrUpdateUserSession ¶
func (r *EntgoRepository) CreateOrUpdateUserSession(ctx context.Context, s *domain.UserSession) (*domain.UserSession, error)
CreateOrUpdateUserSession must be used only with authentication like oauth because it updated ip and user agent and in other uses may be vulnerable to session steal
func (*EntgoRepository) CreateTake ¶
func (*EntgoRepository) CreateUser ¶
func (*EntgoRepository) FinishedTakeCount ¶
func (r *EntgoRepository) FinishedTakeCount(ctx context.Context) (int, error)
func (*EntgoRepository) GetDataForDurationCalculation ¶
func (*EntgoRepository) GetDataForMarkCalculation ¶
func (*EntgoRepository) GetDataForNormCalculation ¶
func (r *EntgoRepository) GetDataForNormCalculation(ctx context.Context, crit domain.SampleCriteria) ([]*domain.NormCalculationData, error)
GetDataForNormCalculation return data for 1 norm for all scales
func (*EntgoRepository) GetSamples ¶
func (*EntgoRepository) GetScaleNorms ¶
func (*EntgoRepository) GetTagIDsByCodes ¶
func (*EntgoRepository) GetTagsByCodes ¶
func (*EntgoRepository) GetTakeData ¶
func (*EntgoRepository) GetTestByCode ¶
func (*EntgoRepository) GetTests ¶
func (r *EntgoRepository) GetTests(ctx context.Context, args *domain.QueryTestsArgs) ([]*domain.Test, error)
func (*EntgoRepository) GetUserByEmail ¶
func (*EntgoRepository) GetUserByID ¶
func (*EntgoRepository) GetUserBySession ¶
func (r *EntgoRepository) GetUserBySession(ctx context.Context, s *domain.UserSession) (*domain.User, error)
func (*EntgoRepository) GetUserCount ¶
func (r *EntgoRepository) GetUserCount(ctx context.Context) (int, error)
func (*EntgoRepository) IfEmailRegistered ¶
func (*EntgoRepository) IfSessionRegistered ¶
func (r *EntgoRepository) IfSessionRegistered(ctx context.Context, s *domain.UserSession) (bool, error)
func (*EntgoRepository) ResponseCount ¶
func (r *EntgoRepository) ResponseCount(ctx context.Context) (int, error)
func (*EntgoRepository) TestCount ¶
func (r *EntgoRepository) TestCount(ctx context.Context) (int, error)
func (*EntgoRepository) UpdateTake ¶
func (*EntgoRepository) UpdateTakeMark ¶
func (*EntgoRepository) UpdateTestDuration ¶
func (*EntgoRepository) UpdateTestMark ¶
func (*EntgoRepository) UpdateUser ¶
func (*EntgoRepository) UpdateUserSessionLastActivityBySID ¶
func (r *EntgoRepository) UpdateUserSessionLastActivityBySID(ctx context.Context, sid string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.