Documentation ¶
Index ¶
Constants ¶
View Source
const CollectionUser = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthUseCase ¶
type ChatRoom ¶
type ChatRoom struct { ID primitive.ObjectID `json:"_id,omitempty"` Name string `json:"name"` Description string `json:"description"` CreatedBy primitive.ObjectID `json:"created_by,omitempty"` Type string `json:"type"` Participants []primitive.ObjectID `json:"participants,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` }
type ErrorResponse ¶
type ForgotPasswordPayload ¶
type ForgotPasswordPayload struct {
Email string `json:"email" binding:"required,email"`
}
type LoginPayload ¶
type Message ¶
type Message struct { ID primitive.ObjectID `json:"_id,omitempty"` UserID primitive.ObjectID `json:"userId"` ChatRoomID primitive.ObjectID `json:"chatRoomId"` Content string `json:"content"` Attachment string `json:"attachment,omitempty"` IsRevoked bool `json:"isRevoked,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
type RegisterPayload ¶
type TokenPayload ¶
type Tokens ¶
type Tokens struct { Access TokenPayload `json:"access"` Refresh TokenPayload `json:"refresh"` }
type User ¶
type User struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` Username string `json:"username" bson:"username" validate:"required"` Name string `json:"name" bson:"name" validate:"required"` Email string `json:"email" bson:"email" validate:"required"` Password string `json:"password,omitempty" bson:"password" validate:"required"` Avatar string `json:"avatar,omitempty" bson:"avatar,omitempty"` IsVerified bool `json:"isVerified,omitempty" bson:"isVerified,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` }
type UserRepository ¶
type UserRepository interface { Create(document *User) error FindOne(filter bson.M, projection bson.M) (*User, error) Find(filter bson.M) ([]User, error) FindWithPagination(filter bson.M, limit int64, page int64) ([]User, error) Delete(filter bson.M) error Update(filter bson.M, update bson.M) error }
Click to show internal directories.
Click to hide internal directories.