Documentation
¶
Index ¶
- Variables
- type AddPostQueryParam
- type BlogStore
- func (u *BlogStore) AddPost(ctx context.Context, postParam *AddPostQueryParam) error
- func (u *BlogStore) DeletePost(ctx context.Context, postParam *DeletePostQueryParams) error
- func (u *BlogStore) GetPosts(ctx context.Context, postParam *GetPostsQueryParams) ([]entity.Post, error)
- func (u *BlogStore) UpdatePost(ctx context.Context, postParam *UpdatePostQueryParams) error
- type DeletePostQueryParams
- type GetPostsQueryParams
- type IBlogs
- type Store
- type UpdatePostQueryParams
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 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) 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
Click to show internal directories.
Click to hide internal directories.