Documentation
¶
Index ¶
- type ActivationToken
- type ActivationTokenRequestDTO
- type AuthorDTO
- type ChangePasswordDTO
- type Chat
- type ChatCreateRequestDTO
- type ChatCreateResponseDTO
- type ChatRecordDTO
- type ChatUserDTO
- type ChatsResponseDTO
- type Comment
- type CommentCreateRequestDTO
- type CommentFeedResponseDTO
- type CommentPaginationDTO
- type CommentResponseDTO
- type FirstMessageResponseDTO
- type GeneralFeedDTO
- type GeneralFeedPaginationDTO
- type Hashtag
- type InitiatePasswordResetResponseDTO
- type Like
- type Location
- type LocationDTO
- type Message
- type MessageCreateRequestDTO
- type MessagePaginationDTO
- type MessageRecordDTO
- type MessagesResponseDTO
- type Notification
- type NotificationRecordDTO
- type NotificationUserDTO
- type NotificationsResponseDTO
- type PasswordResetToken
- type Post
- type PostCreateRequestDTO
- type PostResponseDTO
- type PushSubscription
- type PushSubscriptionRequestDTO
- type PushSubscriptionResponseDTO
- type ResetPasswordRequestDTO
- type Subscription
- type SubscriptionInfo
- type SubscriptionKeys
- type SubscriptionPaginationDTO
- type SubscriptionPostRequestDTO
- type SubscriptionPostResponseDTO
- type SubscriptionResponseDTO
- type User
- type UserActivationRequestDTO
- type UserCreateRequestDTO
- type UserFeedDTO
- type UserFeedPaginationDTO
- type UserFeedRecordDTO
- type UserInformationUpdateDTO
- type UserLoginRequestDTO
- type UserLoginResponseDTO
- type UserProfileResponseDTO
- type UserRefreshTokenRequestDTO
- type UserResponseDTO
- type UserSearchPaginationDTO
- type UserSearchRecordDTO
- type UserSearchResponseDTO
- type UserSubscriptionRecordDTO
- type UserSubscriptionSearchRecordDTO
- type VapidKeyResponseDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationToken ¶
type ActivationToken struct { Id uuid.UUID `gorm:"column:id;primary_key"` Username string `gorm:"column:username_fk;type:varchar(20)"` User User `gorm:"foreignKey:username_fk;references:username"` Token string `gorm:"column:token;not_null;varchar(6)"` ExpirationTime time.Time `gorm:"column:expiration_time;not_null"` }
type ActivationTokenRequestDTO ¶
type ActivationTokenRequestDTO struct {
Token string `json:"token" binding:"required"`
}
type ChangePasswordDTO ¶
type ChatCreateRequestDTO ¶
type ChatCreateResponseDTO ¶
type ChatCreateResponseDTO struct { ChatId string `json:"chatId"` Message *FirstMessageResponseDTO `json:"message"` }
type ChatRecordDTO ¶
type ChatRecordDTO struct { ChatId string `json:"chatId"` User *ChatUserDTO `json:"user"` }
type ChatUserDTO ¶
type ChatsResponseDTO ¶
type ChatsResponseDTO struct {
Records []ChatRecordDTO `json:"records"`
}
type Comment ¶
type Comment struct { Id uuid.UUID `gorm:"column:id;primary_key"` PostID uuid.UUID `gorm:"column:post_id"` Post Post `gorm:"foreignKey:post_id;references:id"` Username string `gorm:"column:username_fk;type:varchar(20)"` User User `gorm:"foreignKey:username_fk;references:username"` Content string `gorm:"column:content;type:varchar(128);not_null"` CreatedAt time.Time `gorm:"column:created_at;not_null"` }
type CommentCreateRequestDTO ¶
type CommentCreateRequestDTO struct {
Content string `json:"content" binding:"required"`
}
type CommentFeedResponseDTO ¶
type CommentFeedResponseDTO struct { Records []CommentResponseDTO `json:"records"` Pagination *CommentPaginationDTO `json:"pagination"` }
type CommentPaginationDTO ¶
type CommentResponseDTO ¶
type FirstMessageResponseDTO ¶
type GeneralFeedDTO ¶
type GeneralFeedDTO struct { Records []PostResponseDTO `json:"records"` Pagination *GeneralFeedPaginationDTO `json:"pagination"` }
type InitiatePasswordResetResponseDTO ¶
type InitiatePasswordResetResponseDTO struct {
Email string `json:"email"` // Response contains censored mail
}
type LocationDTO ¶
type Message ¶
type Message struct { Id uuid.UUID `gorm:"column:id;primary_key"` ChatId uuid.UUID `gorm:"column:chat_id"` Chat Chat `gorm:"foreignKey:chat_id;references:id"` Username string `gorm:"column:username_fk;type:varchar(20)"` User User `gorm:"foreignKey:username_fk;references:username"` Content string `gorm:"column:content;type:varchar(256);null"` CreatedAt time.Time `gorm:"column:created_at;not_null"` }
type MessageCreateRequestDTO ¶
type MessageCreateRequestDTO struct {
Content string `json:"content" binding:"required"`
}
type MessagePaginationDTO ¶
type MessageRecordDTO ¶
type MessagesResponseDTO ¶
type MessagesResponseDTO struct { Records []MessageRecordDTO `json:"records"` Pagination *MessagePaginationDTO `json:"pagination"` }
type Notification ¶
type Notification struct { Id uuid.UUID `gorm:"column:id;primaryKey"` Timestamp time.Time `gorm:"column:timestamp"` NotificationType string `gorm:"column:notification_type"` ForUsername string `gorm:"column:for_username"` // the user that the notification is for ForUser User `gorm:"foreignKey:for_username;references:username"` FromUsername string `gorm:"column:from_username"` // the user that created the notification by following or reposting FromUser User `gorm:"foreignKey:from_username;references:username"` }
type NotificationRecordDTO ¶
type NotificationRecordDTO struct { NotificationId string `json:"notificationId"` Timestamp time.Time `json:"timestamp"` NotificationType string `json:"notificationType"` User *NotificationUserDTO `json:"user"` }
type NotificationUserDTO ¶
type NotificationsResponseDTO ¶
type NotificationsResponseDTO struct {
Records []NotificationRecordDTO `json:"records"`
}
type PasswordResetToken ¶
type PasswordResetToken struct { Id uuid.UUID `gorm:"type:uuid;primary_key;"` Username string `gorm:"column:username_fk;type:varchar(20);not_null"` User User `gorm:"foreignKey:username_fk;references:username"` Token string `gorm:"column:token;type:varchar(6);not_null"` ExpirationTime time.Time `gorm:"column:expiration_time;not_null"` }
type Post ¶
type Post struct { Id uuid.UUID `gorm:"column:id;primary_key"` Username string `gorm:"column:username_fk;type:varchar(20)"` User User `gorm:"foreignKey:username_fk;references:username"` Content string `gorm:"column:content;type:varchar(256);null"` ImageUrl string `gorm:"column:image_url;type:varchar(128);null"` CreatedAt time.Time `gorm:"column:created_at;not_null"` LocationId *uuid.UUID `gorm:"column:location_id;null"` Location Location `gorm:"foreignKey:location_id;references:id"` RepostId *uuid.UUID `gorm:"column:repost_id;null"` // no foreign key constraint, original post may be deleted without affecting repost }
type PostCreateRequestDTO ¶
type PostCreateRequestDTO struct { Content string `json:"content"` Location *LocationDTO `json:"location"` RepostId *string `json:"repostedPostId"` }
type PostResponseDTO ¶
type PostResponseDTO struct { PostId uuid.UUID `json:"postId"` Author *AuthorDTO `json:"author"` CreationDate time.Time `json:"creationDate"` Content string `json:"content"` Comments int64 `json:"comments"` Likes int64 `json:"likes"` Liked bool `json:"liked"` Location *LocationDTO `json:"location"` Repost *PostResponseDTO `json:"repost"` }
type PushSubscription ¶
type PushSubscription struct { Id uuid.UUID `gorm:"column:id;primary_key"` Username string `gorm:"column:username_fk;type:varchar(20)"` User User `gorm:"foreignKey:username_fk;references:username"` Type string `gorm:"column:type;type:varchar(4)"` // either "web" or "expo" Endpoint string `gorm:"column:endpoint;type:text"` // for web only P256dh string `gorm:"column:p256dh;type:text"` // for web only Auth string `gorm:"column:auth;type:text"` // for web only ExpoToken string `gorm:"column:expo_token;type:text"` // for expo only }
type PushSubscriptionRequestDTO ¶
type PushSubscriptionRequestDTO struct { Type string `json:"type" binding:"required"` SubscriptionInfo *SubscriptionInfo `json:"subscription"` // subscription info for web push notifications Token string `json:"token"` // token for expo push notifications }
type PushSubscriptionResponseDTO ¶
type PushSubscriptionResponseDTO struct {
SubscriptionId string `json:"subscriptionId"`
}
type ResetPasswordRequestDTO ¶
type Subscription ¶
type Subscription struct { Id uuid.UUID `gorm:"column:id;primary_key"` SubscriptionDate time.Time `gorm:"column:subscription_date;not null"` FollowerUsername string `gorm:"column:follower;type:varchar(20)"` Follower User `gorm:"foreignKey:follower;references:username"` // Person who follows FollowingUsername string `gorm:"column:following;type:varchar(20)"` // Person who is being followed Following User `gorm:"foreignKey:following;references:username"` }
type SubscriptionInfo ¶
type SubscriptionInfo struct { Endpoint string `json:"endpoint" binding:"required"` SubscriptionKeys SubscriptionKeys `json:"keys" binding:"required"` }
type SubscriptionKeys ¶
type SubscriptionPostRequestDTO ¶
type SubscriptionPostRequestDTO struct {
Following string `json:"following" binding:"required"`
}
type SubscriptionResponseDTO ¶
type SubscriptionResponseDTO struct { Records []UserSubscriptionRecordDTO `json:"records"` Pagination *SubscriptionPaginationDTO `json:"pagination"` }
type User ¶
type User struct { Username string `gorm:"column:username;primary_key;type:varchar(20)"` Nickname string `gorm:"column:nickname;type:varchar(25)"` Email string `gorm:"column:email;type:varchar(128);not_null;unique"` PasswordHash string `gorm:"column:password_hash;type:varchar(80);not_null"` CreatedAt time.Time `gorm:"column:created_at;not_null"` Activated bool `gorm:"column:activated;not_null"` ProfilePictureUrl string `gorm:"column:profile_picture_url;type:varchar(128);null"` Status string `gorm:"column:status;type:varchar(128)"` Chats []Chat `gorm:"many2many:chat_users;"` // gorm handles the join table }
type UserActivationRequestDTO ¶
type UserActivationRequestDTO struct {
Token string `json:"token" binding:"required"`
}
type UserCreateRequestDTO ¶
type UserFeedDTO ¶
type UserFeedDTO struct { Records []UserFeedRecordDTO `json:"records"` Pagination *UserFeedPaginationDTO `json:"pagination"` }
type UserFeedPaginationDTO ¶
type UserFeedRecordDTO ¶
type UserFeedRecordDTO struct { PostId string `json:"postId"` CreationDate time.Time `json:"creationDate"` Content string `json:"content"` Comments int64 `json:"comments"` Likes int64 `json:"likes"` Liked bool `json:"liked"` Location *LocationDTO `json:"location"` Repost *PostResponseDTO `json:"repost"` }
type UserLoginRequestDTO ¶
type UserLoginResponseDTO ¶
type UserProfileResponseDTO ¶
type UserProfileResponseDTO struct { Username string `json:"username"` Nickname string `json:"nickname"` Status string `json:"status"` ProfilePictureUrl string `json:"profilePictureUrl"` Follower int64 `json:"follower"` Following int64 `json:"following"` Posts int64 `json:"posts"` SubscriptionId *string `json:"subscriptionId"` }
type UserRefreshTokenRequestDTO ¶
type UserRefreshTokenRequestDTO struct {
RefreshToken string `json:"refreshToken" binding:"required"`
}
type UserResponseDTO ¶
type UserSearchPaginationDTO ¶
type UserSearchRecordDTO ¶
type UserSearchResponseDTO ¶
type UserSearchResponseDTO struct { Records []UserSearchRecordDTO `json:"records"` Pagination *UserSearchPaginationDTO `json:"pagination"` }
type UserSubscriptionRecordDTO ¶
type UserSubscriptionRecordDTO struct { FollowerId *uuid.UUID `gorm:"column:follower_id" json:"followerId"` // SubscriptionID, wenn Nutzer mir folgt - ggf. null FollowingId *uuid.UUID `gorm:"column:following_id" json:"followingId"` // SubscriptionID, wenn ich Nutzer folge - ggf. null Username string `gorm:"column:username" json:"username"` // Der Benutzername des Followers/Following Nickname string `gorm:"column:nickname" json:"nickname"` // Der Spitzname des Followers/Following ProfilePictureUrl string `gorm:"column:profile_picture_url" json:"profilePictureUrl"` // Die URL des Profilbildes des Followers/Following }
type VapidKeyResponseDTO ¶
type VapidKeyResponseDTO struct {
Key string `json:"key"`
}
Click to show internal directories.
Click to hide internal directories.