Versions in this module Expand all Collapse all v0 v0.0.5 Aug 29, 2023 Changes in this version type Auth + Redis *redis.Client + func (s Auth) RequestPasswordReset(ctx context.Context, input model.RequestPasswordResetInput) (bool, error) + func (s Auth) ResetPassword(ctx context.Context, input model.ResetPasswordInput) (bool, error) v0.0.4 Aug 28, 2023 v0.0.3 Aug 28, 2023 Changes in this version type Auth + Ent *ent.Client type Event + Ent *ent.Client v0.0.2 Aug 24, 2023 v0.0.1 Aug 24, 2023 Changes in this version + var ErrExpiredToken = errors.New("token expired") + var JWTSigningMethod = jwt.SigningMethodES512 + func Module() fx.Option + type Auth struct + Config *appconfig.Config + JWT JWT + MailService Mail + Turnstile Turnstile + UserRepo repo.User + func (s Auth) AuthByLoginInput(ctx context.Context, args model.LoginInput) (*model.User, error) + func (s Auth) AuthByToken(ctx context.Context, token string) (*model.User, error) + func (s Auth) CreateUser(ctx context.Context, args model.CreateUserInput) (*model.User, error) + func (s Auth) CurrentUser(ctx context.Context) (*model.User, error) + func (s Auth) SetUserToken(ctx context.Context, user *model.User) error + type Directive struct + User User + func (s Directive) Admin(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) + func (s Directive) Private(ctx context.Context, obj any, next graphql.Resolver, userIDFieldName *string) (res any, err error) + type Event struct + AuthService Auth + EventRepo repo.Event + ResearchService Research + func (s Event) CalculateStats(ctx context.Context, researchID string, filterInput string, ...) (*model.GroupCountResult, error) + func (s Event) CreateEvent(ctx context.Context, event *model.Event) error + func (s Event) CreateEventFromInput(ctx context.Context, input *model.NewEvent) (*model.Event, error) + func (s Event) GetEvent(ctx context.Context, eventID string) (*model.Event, error) + func (s Event) GetEvents(ctx context.Context) ([]*model.Event, error) + func (s Event) GetEventsByResearchID(ctx context.Context, researchID string) ([]*model.Event, error) + func (s Event) GetPaginatedEvents(ctx context.Context, researchID string, first int, after string) (*model.EventsConnection, error) + type JWT struct + Config *appconfig.Config + func NewJWT(config *appconfig.Config) (JWT, error) + func (s *JWT) Sign(userId string) (string, error) + func (s *JWT) Verify(token string) (sub string, t time.Time, err error) + type Mail struct + ResendClient *resend.Client + func (s Mail) Send(r *SendEmailRequest) (string, error) + type Research struct + ResearchRepo repo.Research + func (s Research) GetAllResearch(ctx context.Context) ([]*model.Research, error) + func (s Research) GetResearchByID(ctx context.Context, id string) (*model.Research, error) + type SendEmailRequest struct + Html string + Subject string + Text string + To []string + type Turnstile struct + Config *appconfig.Config + func NewTurnstile(config *appconfig.Config) Turnstile + func (s Turnstile) Verify(ctx context.Context, turnstileResponse, expectedAction string) error + type User struct + UserRepo repo.User + func (s User) GetUsers(ctx context.Context) ([]*model.User, error)