core

package
v0.0.0-...-0064678 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

This file is in core bc GenUUID generates UUID that are needed for core models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUUID

func GenUUID() (string, error)

Types

type Comment

type Comment struct {
	ID        string   `bson:"_id"`
	AuthorID  string   `bson:"author_id"`
	Message   string   `bson:"message"`
	Images    []string `bson:"images,omitempty"`
	CreatedAt int64    `bson:"created_at"` // unix timestamp
}

type Community

type Community struct {
	ID          string   `bson:"_id"`
	Name        string   `bson:"name"`
	Image       string   `bson:"image"`
	Info        string   `bson:"info"`
	FollowerIDs []string `bson:"followers,omitempty"`
	AdminIDs    []string `bson:"admins,omitempty"`
	PostIDs     []string `bson:"posts,omitempty"`
	CreatedAt   int64    `bson:"created_at"` // unix timestamp
}

type Dialog

type Dialog struct {
	ID           string    `bson:"_id"`
	Name         string    `bson:"name"`
	Participants []string  `bson:"participants"`
	Messages     []Message `bson:"messages,omitempty"`
	CreatedAt    int64     `bson:"created_at"`
}

type EditInfo

type EditInfo struct {
	Name     common.UserName `bson:"name"`
	Avatar   string          `bson:"avatar"`
	Phone    string          `bson:"phone"`
	Location string          `bson:"location"`
	BirthDay string          `bson:"birth_day"`
}

type Friends

type Friends struct {
	ID                string   `bson:"_id"` // User ID
	Friends           []string `bson:"friends,omitempty"`
	IncomingRequests  []string `bson:"incoming_requests,omitempty"`
	OutcomingRequests []string `bson:"outcoming_requests,omitempty"`
}

type IsRead

type IsRead struct {
	Participant string `bson:"_id" json:"id"`
	IsRead      bool   `bson:"is_read" json:"is_read"`
}

type Like

type Like struct {
	ID        string   `bson:"_id"`
	Subject   string   `bson:"subject_id"`
	Amount    int64    `bson:"amount"`
	UserIDs   []string `bson:"user_ids,omitempty"`
	CreatedAt int64    `bson:"created_at"` // unix timestamp
}

type Message

type Message struct {
	ID          string   `bson:"_id"`
	Body        string   `bson:"body"`
	AuthorID    string   `bson:"author_id"`
	IsRead      []IsRead `bson:"is_participants_read,omitempty"`
	Attachments []string `json:"attachments"`
	Images      []string `json:"images"`
	CreatedAt   int64    `bson:"created_at"` // unix timestamp
}

type PaginationParameters

type PaginationParameters struct {
	Limit int64 `query:"limit,omitempty"`
	Page  int64 `query:"page,omitempty"`
}

type Post

type Post struct {
	ID          string   `bson:"_id"`
	AuthorID    string   `bson:"author_id"`
	Message     string   `bson:"message"`
	Images      []string `bson:"images,omitempty"`
	Attachments []string `bson:"attachments,omitempty"`
	CreatedAt   int64    `bson:"created_at"` // unix timestamp
	Type        string   `bson:"type"`
	CommentsIDs []string `bson:"comment_ids,omitempty"`
}

type User

type User struct {
	ID           string          `bson:"_id"`
	Name         common.UserName `bson:"name"`
	Image        string          `bson:"images"`
	Email        string          `bson:"email"`
	Phone        string          `bson:"phone"`
	Location     string          `bson:"location"`
	BirthDay     string          `bson:"birth_day"`
	CreatedAt    int64           `bson:"created_at"` // unix timestamp
	Posts        []string        `bson:"posts,omitempty"`
	DialogIDs    []string        `bson:"dialog_ids,omitempty"`
	CommunityIDs []string        `bson:"community_ids,omitempty"`
}

User describes a user entity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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