Documentation ¶
Overview ¶
Package queries provides access to all the database queries for all models
Package queries provides access to all the database queries for all models
Index ¶
- type BlogQueries
- func (q *BlogQueries) CreateBlogPost(b *models.FullBlogPost) error
- func (q *BlogQueries) DeleteBlogPost(id uuid.UUID) error
- func (q *BlogQueries) GetBlogPost(id uuid.UUID) (models.BlogPost, error)
- func (q *BlogQueries) GetBlogPosts() ([]models.BlogPost, error)
- func (q *BlogQueries) GetFullBlogPost(id uuid.UUID) (models.FullBlogPost, error)
- func (q *BlogQueries) GetFullBlogPosts() ([]models.FullBlogPost, error)
- func (q *BlogQueries) UpdateBlogPost(b *models.FullBlogPost) error
- type ImageQueries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlogQueries ¶
BlogQueries is a type to collate all queries associated with BlogPosts
func (*BlogQueries) CreateBlogPost ¶
func (q *BlogQueries) CreateBlogPost(b *models.FullBlogPost) error
CreateBlogPost creates a new blog post with the provided FullBlogPost
func (*BlogQueries) DeleteBlogPost ¶
func (q *BlogQueries) DeleteBlogPost(id uuid.UUID) error
DeleteBlogPost deletes a blog post with the given ID
func (*BlogQueries) GetBlogPost ¶
GetBlogPost gets the blog post with the provided ID
func (*BlogQueries) GetBlogPosts ¶
func (q *BlogQueries) GetBlogPosts() ([]models.BlogPost, error)
GetBlogPosts gets all blog posts
func (*BlogQueries) GetFullBlogPost ¶
func (q *BlogQueries) GetFullBlogPost(id uuid.UUID) (models.FullBlogPost, error)
GetFullBlogPost gets the blog post with the provided ID (with source)
func (*BlogQueries) GetFullBlogPosts ¶
func (q *BlogQueries) GetFullBlogPosts() ([]models.FullBlogPost, error)
GetFullBlogPosts gets all blog posts (with source)
func (*BlogQueries) UpdateBlogPost ¶
func (q *BlogQueries) UpdateBlogPost(b *models.FullBlogPost) error
UpdateBlogPost updates a blog post with the information in the provided FullBlogPost
type ImageQueries ¶
ImageQueries is a type to collate all queries associated with Images
func (*ImageQueries) AddImage ¶
func (q *ImageQueries) AddImage(img *models.Image) error
AddImage adds an image
func (*ImageQueries) DeleteImage ¶
func (q *ImageQueries) DeleteImage(id uuid.UUID) error
DeleteImage will delete an image with the provided ID
func (*ImageQueries) GetImages ¶
func (q *ImageQueries) GetImages() ([]models.Image, error)
GetImages will get all images available
func (*ImageQueries) UpdateImage ¶
func (q *ImageQueries) UpdateImage(img *models.Image) error
UpdateImage will update an image to have the provided information in Image