Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UsernameMinLength is the minimum length of a username. UsernameMinLength = 3 // UsernameMaxLength is the maximum length of a username. UsernameMaxLength = 24 // UserNameMaxLength is the maximum length of a users' name. UserNameMaxLength = 64 // UserBioMaxLength is the maximum length of a users' bio. UserBioMaxLength = 256 // UserMaxAge is the maximum age of a user. funfact: (03/29/2022 - current oldest person is Kane Tananka at age 119) UserMaxAge = 120 )
Variables ¶
View Source
var ( //ErrInvalidUsername is returned when the provided username is invalid (too short or too long). ErrInvalidUsername = fiber.NewError(fiber.StatusBadRequest, "invalid-username") // ErrInvalidName is returned when the provided name is invalid (too short or too long). ErrInvalidName = fiber.NewError(fiber.StatusBadRequest, "invalid-name") // ErrUserAlreadyExists is returned when the user already exists. ErrUserAlreadyExists = fiber.NewError(fiber.StatusBadRequest, "user-already-exists") // ErrUsernameTaken is returned when the username is already taken. ErrUsernameTaken = fiber.NewError(fiber.StatusBadRequest, "username-taken") // ErrInvalidBio is returned when the provided bio is invalid (too long). ErrInvalidBio = fiber.NewError(fiber.StatusBadRequest, "invalid-bio") // ErrInvalidAge is returned when the provided age is invalid (too high). ErrInvalidAge = fiber.NewError(fiber.StatusBadRequest, "invalid-age") )
Functions ¶
This section is empty.
Types ¶
type CreateMeetupDTO ¶
type CreateMeetupDTO struct { Name string `json:"name"` Description string `json:"description,omitempty"` InviteOnly bool `json:"invite_only"` MinAge int `json:"min_age"` MeetupLocation MeetupLocation `json:"location,omitempty"` }
CreateMeetupDTO represents a meetup creation data transfer object.
type CreateUserDTO ¶
CreateUserDTO is the data transfer object for creating a user.
type GroupMember ¶
type GroupMember struct{}
type Meetup ¶
type Meetup struct { ID string `json:"id" gorm:"primaryKey"` Name string `json:"name"` Description string `json:"description,omitempty"` InviteOnly bool `json:"invite_only" gorm:"default:false"` MinAge int `json:"min_age" gorm:"default:-1"` MeetupLocation MeetupLocation `json:"location,omitempty" gorm:"embedded;embeddedPrefix:location_"` OwnerID string `json:"owner_id"` Owner User `json:"-" gorm:"foreignKey:OwnerID"` Participants []User `gorm:"many2many:participants;"` CreatedAt time.Time `json:"created_at"` }
Meetup represents a UpMeet meetup.
type MeetupLocation ¶
type MeetupLocation struct { Name string `json:"name,omitempty"` Country string `json:"country,omitempty"` State string `json:"state,omitempty"` City string `json:"city,omitempty"` ZipCode string `json:"zip_code,omitempty"` StreetName string `json:"street_name,omitempty"` StreetNumber string `json:"street_number,omitempty"` }
MeetupLocation represents a meetup location.
type MeetupRepository ¶
type MeetupService ¶
type ParticipantPermissions ¶
type UpdateMeetupDTO ¶
type UpdateMeetupDTO struct { Name string `json:"name"` Description string `json:"description,omitempty"` InviteOnly bool `json:"invite_only"` MinAge int `json:"min_age"` MeetupLocation MeetupLocation `json:"location,omitempty"` }
UpdateMeetupDTO represents a meetup update data transfer object.
type UpdateUserDTO ¶
type UpdateUserDTO struct { Username string `json:"username,omitempty"` Name string `json:"name,omitempty"` Bio string `json:"bio,omitempty"` Age int `json:"age,omitempty"` AgePrivate bool `json:"age_private,omitempty"` InstagramProfile string `json:"instagram_profile,omitempty"` FacebookProfile string `json:"facebook_profile,omitempty"` TwitterProfile string `json:"twitter_profile,omitempty"` DiscordTag string `json:"discord_tag,omitempty"` Meetups []*Meetup `gorm:"many2many:participants;"` }
UpdateUserDTO is the data transfer object for updating a user.
type User ¶
type User struct { ID string `json:"id" gorm:"primaryKey"` Username string `json:"username" gorm:"uniqueIndex"` Name string `json:"name" gorm:"index"` ProfilePicture string `json:"profile_picture"` Age int `json:"age" gorm:"default:-1"` AgeVerified bool `json:"age_verified"` AgePrivate bool `json:"age_private"` Bio string `json:"bio"` InstagramProfile string `json:"instagram_profile"` FacebookProfile string `json:"facebook_profile"` TwitterProfile string `json:"twitter_profile"` DiscordTag string `json:"discord_tag"` CreatedAt time.Time `json:"created_at"` }
User is a user of the UpMeet application.
type UserRepository ¶
type UserRepository interface { CreateUser(u *User) error GetUserByID(id string) (*User, error) GetUserByEmail(email string) (*User, error) GetUserByUsername(username string) (*User, error) SearchUsersByName(name string) ([]*User, error) SearchUsersByUsername(username string) ([]*User, error) UpdateUser(u *User) error DeleteUser(id string) error }
type UserService ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.