domain

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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          = BottomNavbarItem{"home"}
	BottomNavbarItemNotifications = BottomNavbarItem{"notifications"}
	BottomNavbarItemSettings      = BottomNavbarItem{"settings"}
	BottomNavbarItemProfile       = BottomNavbarItem{"profile"}

	BottomNavbarItems = enum.New(
		BottomNavbarItemHome,
		BottomNavbarItemNotifications,
		BottomNavbarItemSettings,
		BottomNavbarItemProfile,
	)
)
View Source
var (
	EmailNewsletter         = EmailSubscriptionList{"email_newsletter"}
	EmailInitialAnnoucement = EmailSubscriptionList{"launch_announcement"}

	EmailSubscriptionLists = enum.New(
		EmailNewsletter,
		EmailInitialAnnoucement,
	)
)
View Source
var DefaultBirthdate = time.Date(1898, time.January, 6, 0, 0, 0, 0, time.UTC)
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) HasSeenAt

func (a *Answer) HasSeenAt() bool

func (*Answer) SeenAtOrZero

func (a *Answer) SeenAtOrZero() time.Time

type AnswerRating

type AnswerRating struct {
	Effort       int `json:"effort"`
	Clarity      int `json:"clarity"`
	Truthfulness int `json:"truthfulness"`
}

type AnswerReaction

type AnswerReaction struct {
	Emoji   Emoji
	Profile Profile
}

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 (a *Author) HasProfileImage() bool

func (*Author) ProfileImageThumbnailURL

func (a *Author) ProfileImageThumbnailURL() string

type BottomNavbarItem

type BottomNavbarItem enum.Member[string]

type EmailSubscription

type EmailSubscription struct {
	ID               int     `json:"id"`
	Email            string  `json:"email"`
	Verified         bool    `json:"verified"`
	ConfirmationCode string  `json:"confirmation_code"`
	Lat              float64 `json:"latitude"`
	Lon              float64 `json:"longitude"`
}

type EmailSubscriptionList

type EmailSubscriptionList enum.Member[string]

type Emoji

type Emoji struct {
	ID          int
	UnifiedCode string
	ShortCode   string
}

type ImageCategory

type ImageCategory enum.Member[string]

type ImageSize

type ImageSize enum.Member[string]

type Invitation

type Invitation struct {
	ID               int       `json:"id"`
	CreatedAt        time.Time `json:"created_at"`
	InviteeName      string    `json:"invitee_name"`
	ConfirmationCode string    `json:"confirmation_code"`
}

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 NotificationPermissionPlatform

type NotificationPermissionPlatform struct {
	Platform string `json:"platform"`
	Granted  bool   `json:"granted"`
}

type NotificationType

type NotificationType enum.Member[string]

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 ProductType enum.Member[string]

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 (p *Profile) ContactPhoneNumber() string

func (*Profile) HasProfileImage

func (p *Profile) HasProfileImage() bool

func (*Profile) ProfileImageThumbnailURL

func (p *Profile) ProfileImageThumbnailURL() string

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 (q *Question) HasVotedAt() bool

func (*Question) VotedAtOrZero

func (q *Question) VotedAtOrZero() time.Time

type QuestionCategory

type QuestionCategory struct {
	Name     string `json:"name"`
	Selected bool   `json:"selected"`
}

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 QuizQuestion struct {
	Order     int    `json:"order"`
	Content   string `json:"content"`
	Type      string `json:"type"`
	AnswerMin string `json:"answer_min"`
	AnswerMax string `json:"answer_max"`
}

type QuizQuestionAnswer

type QuizQuestionAnswer struct {
	Order       int    `json:"order"`
	AnswerValue int    `json:"answer_value"`
	AnswerText  string `json:"answer_text"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL