Documentation ¶
Index ¶
- func InitDB(debugFlag bool) (*gorm.DB, error)
- type AuthorStatistic
- type DbStore
- func (s *DbStore) ClearAuthorStatistics() error
- func (s *DbStore) ClearPosts() error
- func (s *DbStore) GetToken() (*oauth2.Token, error)
- func (s *DbStore) GetTopPoster() ([]socialmedia.AuthorStatistic, error)
- func (s *DbStore) GetTopPosts() ([]socialmedia.Post, error)
- func (s *DbStore) SaveAuthorStatistic(p *socialmedia.Post) error
- func (s *DbStore) SavePost(p *socialmedia.Post) error
- func (s *DbStore) SaveToken(token *oauth2.Token) error
- func (s *DbStore) TransformToDBPost(p *socialmedia.Post) *Post
- type Post
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthorStatistic ¶
type AuthorStatistic struct { gorm.Model Author string TotalPosts int TotalUpvotes int TotalComments int }
AuthorStatistic represents the schema for the "author_statistics" table
type DbStore ¶
func (*DbStore) ClearAuthorStatistics ¶
func (*DbStore) ClearPosts ¶
func (*DbStore) GetTopPoster ¶
func (s *DbStore) GetTopPoster() ([]socialmedia.AuthorStatistic, error)
func (*DbStore) GetTopPosts ¶
func (s *DbStore) GetTopPosts() ([]socialmedia.Post, error)
func (*DbStore) SaveAuthorStatistic ¶
func (s *DbStore) SaveAuthorStatistic(p *socialmedia.Post) error
func (*DbStore) TransformToDBPost ¶
func (s *DbStore) TransformToDBPost(p *socialmedia.Post) *Post
Click to show internal directories.
Click to hide internal directories.