Documentation
¶
Index ¶
- Constants
- Variables
- type AggregatedEmojiReaction
- type Answer
- type AnswerRating
- type AnswerReaction
- type Author
- type BottomNavbarItem
- type EmailSubscription
- type EmailSubscriptionList
- type Emoji
- type ImageCategory
- type ImageSize
- type Invitation
- type Notification
- type NotificationPermission
- type NotificationPermissionPlatform
- type NotificationType
- type Photo
- type PrivateMessage
- type ProductType
- type Profile
- type Question
- type QuestionCategory
- type Quiz
- type QuizQuestion
- type QuizQuestionAnswer
Constants ¶
View Source
const ( DefaultBio = "Hello, there! 🌟" FreePlanNumAnswersPerDay = 1 PermissionNotificationType = "permission" )
Variables ¶
View Source
var ( // Below are left as examples. NotificationTypeNewPrivateMessage = NotificationType{"new_private_message"} NotificationTypeConnectionEngagedWithQuestion = NotificationType{"connection_engaged_with_question"} NotificationTypeIncrementNumUnseenMessages = NotificationType{"increment_num_unseen_msg"} NotificationTypeDecrementNumUnseenMessages = NotificationType{"decrement_num_unseen_msg"} NotificationTypeUpdateNumNotifications = NotificationType{"update_num_notifs"} NotificationTypePlatformUpdate = NotificationType{"platform_update"} NotificationTypePaymentFailed = NotificationType{"payment_failed"} NotificationTypeDailyConversationReminder = NotificationType{"daily_conversation_reminder"} NotificationTypes = enum.New( NotificationTypeNewPrivateMessage, NotificationTypeConnectionEngagedWithQuestion, NotificationTypeIncrementNumUnseenMessages, NotificationTypeDecrementNumUnseenMessages, NotificationTypeUpdateNumNotifications, NotificationTypePlatformUpdate, NotificationTypePaymentFailed, NotificationTypeDailyConversationReminder, ) )
View Source
var ( ImageSizeThumbnail = ImageSize{"thumbnail"} ImageSizePreview = ImageSize{"preview"} ImageSizeFull = ImageSize{"full"} ImageSizes = enum.New( ImageSizeThumbnail, ImageSizePreview, ImageSizeFull, ) )
View Source
var ( ImageCategoryProfilePhoto = ImageCategory{"profile_photo"} ImageCategoryProfileGallery = ImageCategory{"profile_gallery"} ImageCategories = enum.New( ImageCategoryProfilePhoto, ImageCategoryProfileGallery, ) )
View Source
var ( ProductTypeFree = ProductType{"free"} ProductTypePro = ProductType{"pro"} ProductTypes = enum.New( ProductTypeFree, ProductTypePro, ) )
View Source
var ( BottomNavbarItemHome, BottomNavbarItemNotifications, BottomNavbarItemSettings, BottomNavbarItemProfile, ) )
View Source
var ( EmailNewsletter = EmailSubscriptionList{"email_newsletter"} EmailInitialAnnoucement = EmailSubscriptionList{"launch_announcement"} EmailSubscriptionLists = enum.New( EmailNewsletter, EmailInitialAnnoucement, ) )
View Source
var DeleteOnceReadNotificationTypesMap = map[NotificationType]bool{ NotificationTypeDailyConversationReminder: true, }
DeleteOnceReadNotificationTypesMap is a map of notification types th;oiSJDfiujladijrgoizdikrjgat can be deleted once seen. Note that the boolean doesn't matter, this is just a lazy way of creating a set in Go.
View Source
var ImageSizeEnumToSizeMap = map[ImageSize]int{
ImageSizeThumbnail: 150,
ImageSizePreview: 800,
ImageSizeFull: 1600,
}
ImageSizeEnumToSizeMap maps an image size name to its actual size
View Source
var NotificationCenterButtonText = map[NotificationType]string{
NotificationTypeConnectionEngagedWithQuestion: "Answer",
}
Functions ¶
This section is empty.
Types ¶
type AggregatedEmojiReaction ¶
type AggregatedEmojiReaction struct {
Count int
RootEmoji Emoji
EmojiVariations []AnswerReaction
}
AggregatedEmojiReaction aggregates all the emoji reaction for a specific emoji root, for example :+1: can link all variations on skin tones.
type Answer ¶
type Answer struct {
ID int `json:"id"`
CreatedAt time.Time `json:"created_at"`
PublishedAt time.Time `json:"published_at"`
IsPublished bool `json:"isPublished"`
Content string `json:"content"`
IsQuiz bool `json:"is_quizz"`
QuizResults []QuizQuestionAnswer `json:"quizz_results"`
Author Author `json:"author"`
SeenAt *time.Time `json:"seen_at"`
AggregatedEmojiReaction []AggregatedEmojiReaction
Rating AnswerRating
}
func (*Answer) SeenAtOrZero ¶
type AnswerRating ¶
type AnswerReaction ¶
type Author ¶
type Author struct {
UserId int `json:"user_id"`
ProfileID int `json:"dating_profile_id"`
ProfileImage *Photo `json:"profileImage"`
Name string `json:"name"`
}
Author is a legacy transport shape kept for compatibility with current payloads.
func (*Author) HasProfileImage ¶
func (*Author) ProfileImageThumbnailURL ¶
type BottomNavbarItem ¶
type EmailSubscription ¶
type EmailSubscriptionList ¶
type ImageCategory ¶
type Invitation ¶
type Notification ¶
type Notification struct {
ID int `json:"id"`
Type NotificationType `json:"type"`
Title string `json:"title"`
Text string `json:"text"`
Link string `json:"link,omitempty"` // omitempty will not serialize the field if it's empty
Data map[string]interface{} `json:"data,omitempty"`
CreatedAt time.Time `json:"created_at"`
Read bool `json:"read"`
ReadAt time.Time `json:"read_at"`
ProfileID int `json:"profileId"`
// ProfileIDWhoCausedNotif is who caused the notification, if available.
ProfileIDWhoCausedNotif int `json:"profile_id_who_caused_notif"`
// ResourceIDTiedToNotif is what the notification is about, if it is a reaction to the creation
// of a specific resource, say an answerID.
ResourceIDTiedToNotif int `json:"resource_id_tied_to_notif"`
// When shown in the notification center, this has the text on the button to navigate to the linked ressource
ButtonText string
// ReadInNotificationsCenter determines whether the notification will be marked as read when seen in the notification
// center, or whether the user needs to click on it to mark it as read.
ReadInNotificationsCenter bool
}
type NotificationPermission ¶
type NotificationPermission struct {
// Title
Title string `json:"title"`
Subtitle string `json:"subtitle"`
Permission string `json:"permission"`
PlatformsList []NotificationPermissionPlatform `json:"platforms_list"`
}
type NotificationType ¶
type Photo ¶
type Photo struct {
ID int `json:"id"`
// Photo is the legacy full-size URL field kept for compatibility with existing consumers.
Photo string `json:"photo"`
ThumbnailURL string `json:"thumbnail_url"`
ThumbnailWidth int `json:"thumbnail_w"`
ThumbnailHeight int `json:"thumbnail_h"`
PreviewURL string `json:"preview_url"`
PreviewWidth int `json:"preview_w"`
PreviewHeight int `json:"preview_h"`
FullURL string `json:"full_url"`
FullWidth int `json:"full_w"`
FullHeight int `json:"full_h"`
Alt string `json:"alt"`
}
type PrivateMessage ¶
type PrivateMessage struct {
ID int `json:"id"`
PublishedAt time.Time `json:"published_at"`
Content string `json:"content"`
Sender Profile `json:"author"`
Recipient Profile `json:"recipient"`
SeenAt *time.Time `json:"seen_at"`
}
func (*PrivateMessage) HasSeenAt ¶
func (m *PrivateMessage) HasSeenAt() bool
func (*PrivateMessage) SeenAtOrZero ¶
func (m *PrivateMessage) SeenAtOrZero() time.Time
type ProductType ¶
type Profile ¶
type Profile struct {
ID int `json:"id"`
Name string `json:"name"`
Age int `json:"age"`
Bio string `json:"bio"`
PhoneNumberE164 string `json:"phone_number_e164"`
PhoneNumberInternational *string `json:"phone_number_international"`
CountryCode string `json:"country_code"`
ProfileImage *Photo `json:"profileImage"`
Photos []Photo `json:"photos"`
}
func (*Profile) ContactPhoneNumber ¶
func (*Profile) HasProfileImage ¶
func (*Profile) ProfileImageThumbnailURL ¶
type Question ¶
type Question struct {
ID int `json:"id"`
Content string `json:"content"`
Description string `json:"description"`
IsQuiz bool `json:"is_quiz"`
QuizQuestions map[int]QuizQuestion `json:"questions"`
Answer Answer `json:"answers"`
OtherAnswer Answer `json:"self_answer"` // Currently, this is used only for quiz results, to show self and other side by side.
VotingCount int `json:"voting_count"`
// Liked and Disliked are kept as separate fields for compatibility with current consumers.
Liked bool `json:"liked"`
Disliked bool `json:"disliked"`
VotedAt *time.Time
HasSelfDraft bool
}
func (*Question) HasVotedAt ¶
func (*Question) VotedAtOrZero ¶
type QuestionCategory ¶
type Quiz ¶
type Quiz struct {
Title string `json:"title"`
Description string `json:"description"`
Tags []string `json:"tags"`
ExternalID string `json:"external_id"`
Questions []QuizQuestion `json:"questions"`
}
type QuizQuestion ¶
type QuizQuestionAnswer ¶
Click to show internal directories.
Click to hide internal directories.