store

package
v0.0.0-...-4ad5369 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSlugAlreadyExists = errors.New("Slug already exists. Please choose a different one")
	ErrPostDoesNotExist  = errors.New("Post does not exist.")
)

Functions

This section is empty.

Types

type AddPostQueryParam

type AddPostQueryParam struct {
	Title       *string
	Description *string
	Slug        *string
	Content     *string
	AuthorName  *string
	Tags        *[]string
	IsPublished *bool
}

type BlogStore

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

func (*BlogStore) AddPost

func (u *BlogStore) AddPost(ctx context.Context, postParam *AddPostQueryParam) error

func (*BlogStore) DeletePost

func (u *BlogStore) DeletePost(ctx context.Context, postParam *DeletePostQueryParams) error

func (*BlogStore) GetPosts

func (u *BlogStore) GetPosts(ctx context.Context, postParam *GetPostsQueryParams) ([]entity.Post, error)

func (*BlogStore) UpdatePost

func (u *BlogStore) UpdatePost(ctx context.Context, postParam *UpdatePostQueryParams) error

type DeletePostQueryParams

type DeletePostQueryParams struct {
	Id int
}

type GetPostsQueryParams

type GetPostsQueryParams struct {
	Id *int
}

type IBlogs

type IBlogs interface {
	AddPost(context.Context, *AddPostQueryParam) error
	GetPosts(ctx context.Context, postParam *GetPostsQueryParams) ([]entity.Post, error)
	UpdatePost(context.Context, *UpdatePostQueryParams) error
	DeletePost(context.Context, *DeletePostQueryParams) error
}

type Store

type Store struct {
	Blogs IBlogs
}

func NewStorage

func NewStorage(db *database.Database, config *config.AtomicConfig) Store

type UpdatePostQueryParams

type UpdatePostQueryParams struct {
	Id          int
	Title       *string
	Description *string
	Slug        *string
	Content     *string
	AuthorName  *string
	Tags        *[]string
	IsPublished *bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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