Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginRequest ¶
type LoginResponse ¶
type Photo ¶
type PhotoDAO ¶
type PhotoDAO struct { ID primitive.ObjectID `bson:"_id,omitempty"` Base64 string `bson:"base64"` OwnerID primitive.ObjectID `bson:"owner_id"` Name string `bson:"name"` Description string `bson:"description"` Type string `bson:"type"` }
PhotoDAO is a version of Photo that is used by MongoDB to interact with the data
type SignUpRequest ¶
type SignUpResponse ¶
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` Subscriptions []string `json:"subscriptions"` Photos []string `json:"photos"` Balance int64 `json:"balance"` SubscriptionPrice int64 `json:"subscription_price"` }
func (User) IsSubscribedTo ¶
IsSubscribedTo checks is a user is subscribed to another user by its ID
type UserAuth ¶
type UserAuth struct { ID string `json:"id,omitempty"` Email string `json:"email"` UserID string `json:"user_id"` PasswordHash string `json:"password_hash"` }
func (*UserAuth) ToDAO ¶
func (u *UserAuth) ToDAO(dao *UserAuthDAO)
ToDAO Transfers the data from a UserAuth struct to a UserAuthDAO struct.
type UserAuthDAO ¶
type UserAuthDAO struct { ID primitive.ObjectID `bson:"_id,omitempty"` Email string `bson:"email"` UserID primitive.ObjectID `bson:"user_id"` PasswordHash string `bson:"password_hash"` }
UserAuthDAO is a version of UserAuth that is used by MongoDB to interact with the data
func (*UserAuthDAO) ToModel ¶
func (dao *UserAuthDAO) ToModel(auth *UserAuth)
ToModel Transfers the data from a UserAuthDAO struct to a UserAuth struct.
type UserDAO ¶
type UserDAO struct { ID string `bson:"_id,omitempty"` Name string `bson:"name"` Email string `bson:"email"` Subscriptions []primitive.ObjectID `json:"subscriptions"` Photos []primitive.ObjectID `bson:"photos"` Balance int64 `bson:"balance"` SubscriptionPrice int64 `bson:"subscription_price"` }
UserDAO is a version of User that is used by MongoDB to interact with the data
Click to show internal directories.
Click to hide internal directories.