Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PostRepository ¶
type PostRepository struct {
// contains filtered or unexported fields
}
PostRepository keeps data in postgres db
func NewPostRepository ¶
func NewPostRepository(db *sql.DB) *PostRepository
NewPostRepository return a new repo
func (*PostRepository) AddPost ¶
func (s *PostRepository) AddPost(u adding.Post) error
AddPost saves the given Post to the repository
func (*PostRepository) DeletePost ¶
func (s *PostRepository) DeletePost(id uint) error
func (*PostRepository) GetAllPosts ¶
func (s *PostRepository) GetAllPosts() ([]listing.Post, error)
GetAllPosts returns all Posts from the storage
type UserPolicyRepository ¶
type UserPolicyRepository struct {
// contains filtered or unexported fields
}
func NewUserPolicyRepository ¶
func NewUserPolicyRepository(db *sql.DB) *UserPolicyRepository
NewUserRepository return a new repo
func (*UserPolicyRepository) IsOwnerOfPost ¶
func (s *UserPolicyRepository) IsOwnerOfPost(userID, postID uint) bool
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository keeps data in postgres db
func NewUserRepository ¶
func NewUserRepository(db *sql.DB) *UserRepository
NewUserRepository returns a new repo
Click to show internal directories.
Click to hide internal directories.