Documentation ¶
Index ¶
- type ArticlesDB
- func (aDB *ArticlesDB) Delete(ids string) error
- func (aDB *ArticlesDB) Find(terms string) (*core.ArticleSeries, error)
- func (aDB *ArticlesDB) Get(offset, limit int) (*core.ArticleSeries, error)
- func (aDB *ArticlesDB) GetArticle(id int) (*core.Article, error)
- func (aDB *ArticlesDB) GetQuestion(qn string) (string, error)
- func (aDB *ArticlesDB) Store(data *core.ArticleSeries) error
- func (aDB *ArticlesDB) Update(data *core.ArticleSeries) error
- type AuthDB
- type LongsDB
- func (lDB *LongsDB) Delete(ids string) error
- func (lDB *LongsDB) Get(topic string) (*core.LongSeries, error)
- func (lDB *LongsDB) GetAll() (*core.LongSeries, error)
- func (lDB *LongsDB) GetTopics() (*core.LongTopics, error)
- func (lDB *LongsDB) Store(data *core.LongPayload) error
- func (lDB *LongsDB) Update(data *core.Long) error
- type PostsDB
- func (pDB *PostsDB) AddPost(post *core.Post) error
- func (pDB *PostsDB) DeletePost(postID int) error
- func (pDB *PostsDB) GetAllPublicPosts() (*core.Posts, error)
- func (pDB *PostsDB) GetLikes(id int, userOrPost string) ([]int, error)
- func (pDB *PostsDB) GetPost(id int) (*core.Post, error)
- func (pDB *PostsDB) GetPosts(userIDs []int, public bool) (*core.Posts, error)
- func (pDB *PostsDB) UpdatePost(postID int, post *core.Post) error
- type SocialsDB
- func (sDB *SocialsDB) Follow(userID, toFollow int) error
- func (sDB *SocialsDB) GetFollowedBy(userID int) ([]int, error)
- func (sDB *SocialsDB) GetFollowing(userID int) ([]int, error)
- func (sDB *SocialsDB) Like(userID, postID int) error
- func (sDB *SocialsDB) UnFollow(userID, toUnFollow int) error
- func (sDB *SocialsDB) Unlike(userID, postID int) error
- type StatsDB
- type UsersDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticlesDB ¶
func NewArticlesDB ¶
func NewArticlesDB(dsn string) (*ArticlesDB, error)
NewPscaleDB returns a connection interface for the application to connect to the planetscale database.
func (*ArticlesDB) Delete ¶
func (aDB *ArticlesDB) Delete(ids string) error
func (*ArticlesDB) Find ¶
func (aDB *ArticlesDB) Find(terms string) (*core.ArticleSeries, error)
Find implements a mysql fulltext search of the articles table
func (*ArticlesDB) Get ¶
func (aDB *ArticlesDB) Get(offset, limit int) (*core.ArticleSeries, error)
Get retrieves a slice of 10 articles from the planetscale database with limit and offset in the query.
func (*ArticlesDB) GetArticle ¶
func (aDB *ArticlesDB) GetArticle(id int) (*core.Article, error)
func (*ArticlesDB) GetQuestion ¶
func (aDB *ArticlesDB) GetQuestion(qn string) (string, error)
func (*ArticlesDB) Store ¶
func (aDB *ArticlesDB) Store(data *core.ArticleSeries) error
Store stores a slice of articles sent from the front end admin dashboard via the articles service.
func (*ArticlesDB) Update ¶
func (aDB *ArticlesDB) Update(data *core.ArticleSeries) error
type LongsDB ¶
func NewLongsDB ¶
NewPscaleDB returns a connection interface for the application to connect to the planetscale database.
type PostsDB ¶
func NewPostsDB ¶
NewPscaleDB returns a connection interface for the application to connect to the planetscale database.
func (*PostsDB) DeletePost ¶
type SocialsDB ¶
func NewSocialsDB ¶
NewPscaleDB returns a connection interface for the application to connect to the planetscale database.
type StatsDB ¶
func NewStatsDB ¶
NewPscaleDB returns a connection interface for the application to connect to the planetscale database.