feat: initial sqlite store
This commit is contained in:
parent
52814db43d
commit
9918c9918f
10 changed files with 560 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"database/sql"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
|
@ -74,8 +75,8 @@ func (s *Service) RegisterUser(ctx context.Context, email string) (*store.User,
|
|||
timeoutCtx, cancel := context.WithTimeout(ctx, s.operationTimeout)
|
||||
defer cancel()
|
||||
|
||||
nullString := store.NullString{Valid: false}
|
||||
nullTime := store.NullTime{Valid: false}
|
||||
nullString := store.NullString{NullString: sql.NullString{Valid: false}}
|
||||
nullTime := store.NullTime{NullTime: sql.NullTime{Valid: false}}
|
||||
user := store.User{
|
||||
ID: s.idGenerator.NewID(),
|
||||
Email: email,
|
||||
|
|
@ -86,7 +87,7 @@ func (s *Service) RegisterUser(ctx context.Context, email string) (*store.User,
|
|||
ProfileImageURL: nullString,
|
||||
|
||||
Status: store.UserStatusActive,
|
||||
StatusReason: "New registration",
|
||||
StatusReason: nullString,
|
||||
StatusChangedAt: nullTime,
|
||||
StatusExpiresAt: nullTime,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue