Documentation ¶
Index ¶
- func GenerateRandomString() string
- func ParseUnixTime(date string) (int64, error)
- type Article
- type ArticlePayload
- type ArticleSeries
- type KV
- type LikesList
- type Long
- type LongPayload
- type LongSeries
- type LongTopics
- type Post
- type PostPayload
- type Posts
- type Question
- type Relations
- type Stats
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomString ¶
func GenerateRandomString() string
func ParseUnixTime ¶
Types ¶
type Article ¶
type Article struct { ID uuid.UUID `json:"id"` Title string `json:"title"` URL string `json:"url"` Topics []string `json:"topics"` Questions []string `json:"questions"` QuestionDisplay []string `json:"question_display"` Date string `json:"date"` MustRead bool `json:"must_read"` PublishedOn int64 `json:"published_on,omitempty"` }
Article is the main entity of the app.
type ArticlePayload ¶
type ArticleSeries ¶
type ArticleSeries []Article
ArticleSeries is a slice of Article to transport between database, application, and frontend.
type Long ¶
type Long struct { ID uuid.UUID `json:"id,omitempty"` Title string `json:"title,omitempty"` URL string `json:"url,omitempty"` Topic string `json:"topic,omitempty"` }
Long is the entity that represents articles in the longer reads section
type LongPayload ¶
type LongPayload []Long
LongPayload is a slice of Longs to be parsed into from the payload received from the frontend via the longer reads insertLong method
type LongSeries ¶
type LongSeries []Long
LongSeries is a slice of Longs to transport between database, appilcation, and frontend.
type LongTopics ¶
type LongTopics []string
LongTopics is a slice of strings representing all topics for long articles in the database.
type Post ¶
type Post struct { ID uuid.UUID `json:"id,omitempty"` UserID uuid.UUID `json:"user_id"` Author string `json:"author"` AuthorClass string `json:"author_class"` Likes int `json:"likes"` TLDR string `json:"tldr"` Examples string `json:"examples"` Notes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Date string `json:"date"` Public bool `json:"public"` CreatedAt int64 `json:"created_at,omitempty"` ArticleID uuid.UUID `json:"article_id"` ArticleTitle string `json:"article_title"` ArticleURL string `json:"article_url"` }
type PostPayload ¶
type PostPayload struct { UserID uuid.UUID `json:"user_id"` Likes int `json:"likes"` TLDR string `json:"tldr"` Examples string `json:"examples"` Notes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Date string `json:"date"` Public string `json:"public"` ArticleID uuid.UUID `json:"article_id"` ArticleTitle string `json:"article_title"` ArticleURL string `json:"article_url"` }
type Stats ¶
type Stats struct { NumberofArticles int `json:"number_of_articles"` TopicsWithMostArticles []KV `json:"topics_with_most_articles"` TopicsWithFewestArticles []KV `json:"topics_with_fewest_articles"` QuestionsWithMostArticles []KV `json:"questions_with_most_articles"` QuestionsWthFewestArticles []KV `json:"questions_with_fewest_articles"` }
Click to show internal directories.
Click to hide internal directories.