Documentation ¶
Index ¶
- type CommentStore
- func (c *CommentStore) Comment(id uuid.UUID) (goreddit.Comment, error)
- func (c *CommentStore) CommentsByPost(postID uuid.UUID) ([]goreddit.Comment, error)
- func (c *CommentStore) CreateComment(cmt *goreddit.Comment) error
- func (c *CommentStore) DeleteComment(id uuid.UUID) error
- func (c *CommentStore) UpdateComment(t *goreddit.Comment) error
- type PostStore
- func (s *PostStore) CreatePost(p *goreddit.Post) error
- func (s *PostStore) DeletePost(id uuid.UUID) error
- func (s *PostStore) Post(id uuid.UUID) (goreddit.Post, error)
- func (s *PostStore) Posts() ([]goreddit.Post, error)
- func (s *PostStore) PostsByThread(threadID uuid.UUID) ([]goreddit.Post, error)
- func (s *PostStore) UpdatePost(p *goreddit.Post) error
- type Store
- type ThreadStore
- func (s *ThreadStore) CreateThread(t *goreddit.Thread) error
- func (s *ThreadStore) DeleteThread(id uuid.UUID) error
- func (s *ThreadStore) Thread(id uuid.UUID) (goreddit.Thread, error)
- func (s *ThreadStore) Threads() ([]goreddit.Thread, error)
- func (s *ThreadStore) UpdateThread(t *goreddit.Thread) error
- type UserStore
- func (s *UserStore) CreateUser(t *goreddit.User) error
- func (s *UserStore) DeleteUser(id uuid.UUID) error
- func (s *UserStore) UpdateUser(t *goreddit.User) error
- func (s *UserStore) User(id uuid.UUID) (goreddit.User, error)
- func (s *UserStore) UserByUsername(username string) (goreddit.User, error)
- func (s *UserStore) Users() ([]goreddit.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentStore ¶
func (*CommentStore) CommentsByPost ¶
func (*CommentStore) CreateComment ¶
func (c *CommentStore) CreateComment(cmt *goreddit.Comment) error
func (*CommentStore) DeleteComment ¶
func (c *CommentStore) DeleteComment(id uuid.UUID) error
func (*CommentStore) UpdateComment ¶
func (c *CommentStore) UpdateComment(t *goreddit.Comment) error
type PostStore ¶
func (*PostStore) PostsByThread ¶
PostsByThread retrieves the posts per thread
type Store ¶
type Store struct { *ThreadStore *PostStore *CommentStore *UserStore }
Store struct that contains the PostgreSQL stores
type ThreadStore ¶
ThreadStore is a struct with a reference to sqlx.DB
func (*ThreadStore) CreateThread ¶
func (s *ThreadStore) CreateThread(t *goreddit.Thread) error
func (*ThreadStore) DeleteThread ¶
func (s *ThreadStore) DeleteThread(id uuid.UUID) error
func (*ThreadStore) UpdateThread ¶
func (s *ThreadStore) UpdateThread(t *goreddit.Thread) error
type UserStore ¶
UserStore is a struct with a reference to sqlx.DB
func (*UserStore) UserByUsername ¶
Click to show internal directories.
Click to hide internal directories.