blog

package
v0.0.0-...-80e8cda Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogPost

type BlogPost struct {
	ID          string
	Title       string
	Description string
	Tags        string
	Slug        string
	Text        string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	PublishedAt *time.Time
	CreatedBy   string
}

type CreateRq

type CreateRq struct {
	Title       string
	Description string
	Tags        string
	Text        string
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(db *sql.DB) *Repository

func (Repository) Create

func (r Repository) Create(bp BlogPost) error

func (Repository) GetAllPublished

func (r Repository) GetAllPublished() ([]BlogPost, error)

func (Repository) GetByCreatedBy

func (r Repository) GetByCreatedBy(userID string) ([]BlogPost, error)

func (Repository) GetByIDAndAuthor

func (r Repository) GetByIDAndAuthor(id, authorID string) (BlogPost, error)

func (Repository) GetBySlug

func (r Repository) GetBySlug(slug string) (BlogPost, error)

func (Repository) Publish

func (r Repository) Publish(bp BlogPost) error

func (Repository) Unpublish

func (r Repository) Unpublish(bp BlogPost) error

func (Repository) Update

func (r Repository) Update(bp BlogPost) error

type UpdateRq

type UpdateRq struct {
	ID          string
	Title       string
	Description string
	Tags        string
	Text        string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL