init
This commit is contained in:
16
internal/core/domain/errors.go
Normal file
16
internal/core/domain/errors.go
Normal 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")
|
||||
)
|
20
internal/core/domain/message.go
Normal file
20
internal/core/domain/message.go
Normal 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
|
||||
}
|
7
internal/core/domain/token.go
Normal file
7
internal/core/domain/token.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package domain
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type AuthPayload struct {
|
||||
UserID uuid.UUID
|
||||
}
|
14
internal/core/domain/user.go
Normal file
14
internal/core/domain/user.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user