entgo

package
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

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 (r *EntgoRepository) AddOrUpdateResponse(ctx context.Context, takeID uuid.UUID, itm *domain.Item) (*domain.Response, error)

func (*EntgoRepository) CreateOrUpdateNorm

func (r *EntgoRepository) CreateOrUpdateNorm(ctx context.Context, nrm *domain.Norm) (*domain.Norm, error)

func (*EntgoRepository) CreateOrUpdateResult

func (r *EntgoRepository) CreateOrUpdateResult(ctx context.Context, res *domain.Result) (*domain.Result, error)

func (*EntgoRepository) CreateOrUpdateSample

func (r *EntgoRepository) CreateOrUpdateSample(ctx context.Context, smp *domain.Sample) (*domain.Sample, error)

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 (r *EntgoRepository) CreateTake(ctx context.Context, tk *domain.Take) (*domain.Take, error)

func (*EntgoRepository) CreateUser

func (r *EntgoRepository) CreateUser(ctx context.Context, u *domain.User) (*domain.User, error)

func (*EntgoRepository) FinishedTakeCount

func (r *EntgoRepository) FinishedTakeCount(ctx context.Context) (int, error)

func (*EntgoRepository) GetDataForDurationCalculation

func (r *EntgoRepository) GetDataForDurationCalculation(ctx context.Context) ([]*domain.Test, error)

func (*EntgoRepository) GetDataForMarkCalculation

func (r *EntgoRepository) GetDataForMarkCalculation(ctx context.Context) ([]*domain.Test, error)

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 (r *EntgoRepository) GetSamples(ctx context.Context) ([]*domain.Sample, error)

func (*EntgoRepository) GetScaleNorms

func (r *EntgoRepository) GetScaleNorms(ctx context.Context, scaleID uuid.UUID, sampleIDs []uuid.UUID) ([]*domain.Norm, error)

func (*EntgoRepository) GetTagIDsByCodes

func (r *EntgoRepository) GetTagIDsByCodes(ctx context.Context, codes ...string) ([]uuid.UUID, error)

func (*EntgoRepository) GetTagsByCodes

func (r *EntgoRepository) GetTagsByCodes(ctx context.Context, locale string, codes ...string) ([]*domain.Tag, error)

func (*EntgoRepository) GetTake

func (r *EntgoRepository) GetTake(ctx context.Context, takeID uuid.UUID) (*domain.Take, error)

func (*EntgoRepository) GetTakeData

func (r *EntgoRepository) GetTakeData(ctx context.Context, tk *domain.Take, locale string) (*domain.Test, error)

func (*EntgoRepository) GetTestByCode

func (r *EntgoRepository) GetTestByCode(ctx context.Context, code string, locale string) (*domain.Test, error)

func (*EntgoRepository) GetTests

func (r *EntgoRepository) GetTests(ctx context.Context, args *domain.QueryTestsArgs) ([]*domain.Test, error)

func (*EntgoRepository) GetUserByEmail

func (r *EntgoRepository) GetUserByEmail(ctx context.Context, email string) (*domain.User, error)

func (*EntgoRepository) GetUserByID

func (r *EntgoRepository) GetUserByID(ctx context.Context, id uuid.UUID) (*domain.User, error)

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 (r *EntgoRepository) IfEmailRegistered(ctx context.Context, email string) (bool, error)

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 (r *EntgoRepository) UpdateTake(ctx context.Context, tk *domain.Take) (*domain.Take, error)

func (*EntgoRepository) UpdateTakeMark

func (r *EntgoRepository) UpdateTakeMark(ctx context.Context, takeID uuid.UUID, mark int) error

func (*EntgoRepository) UpdateTestDuration

func (r *EntgoRepository) UpdateTestDuration(ctx context.Context, testID uuid.UUID, duration time.Duration) error

func (*EntgoRepository) UpdateTestMark

func (r *EntgoRepository) UpdateTestMark(ctx context.Context, testID uuid.UUID, mark float64) error

func (*EntgoRepository) UpdateUser

func (r *EntgoRepository) UpdateUser(ctx context.Context, u *domain.User) (*domain.User, error)

func (*EntgoRepository) UpdateUserSessionLastActivityBySID

func (r *EntgoRepository) UpdateUserSessionLastActivityBySID(ctx context.Context, sid string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL