This commit is contained in:
2024-10-13 13:31:58 +04:00
commit aec8d7ed48
54 changed files with 2827 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package domain
import "errors"
var (
ErrInternal = errors.New("internal error")
ErrConflictingData = errors.New("data conflicts with existing data in unique column")
ErrDataNotFound = errors.New("data not found")
ErrInvalidEmailCredentials = errors.New("invalid email or password")
ErrInvalidUsernameCredentials = errors.New("invalid username or password")
ErrTokenCreation = errors.New("error creating token")
ErrExpiredToken = errors.New("access token has expired")
ErrUsernameExists = errors.New("username already exists")
ErrEmailExists = errors.New("email already exists")
ErrInvalidToken = errors.New("invalid token")
)

View File

@@ -0,0 +1,20 @@
package domain
import (
"time"
"github.com/google/uuid"
)
type Message struct {
UserID uuid.UUID
ChatID string
Content string
Type string
Timestamp time.Time
}
type StreamMessage struct {
*Message
Commit func() error
}

View File

@@ -0,0 +1,7 @@
package domain
import "github.com/google/uuid"
type AuthPayload struct {
UserID uuid.UUID
}

View File

@@ -0,0 +1,14 @@
package domain
import (
"github.com/google/uuid"
)
type User struct {
ID uuid.UUID
Username string
Email string
Password string
// CreatedAt time.Time
// UpdatedAt time.Time
}