db

package
v0.0.0-...-8f69cf3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(db *sqlx.DB, cache *cache.Cache) *Storage

func (*Storage) AddComment

func (r *Storage) AddComment(ctx context.Context, postID int64, newComment *model.NewComment) (*model.Comment, error)

func (*Storage) AddPost

func (r *Storage) AddPost(ctx context.Context, newPost *model.NewPost) (*model.Post, error)

func (*Storage) GetAllPosts

func (r *Storage) GetAllPosts(ctx context.Context) ([]*model.Post, error)

func (*Storage) GetCommentPath

func (r *Storage) GetCommentPath(ctx context.Context, commentID int64) (string, error)

func (*Storage) GetCommentsBranch

func (r *Storage) GetCommentsBranch(ctx context.Context, postID int64, path string) ([]*model.Comment, error)

func (*Storage) GetPost

func (r *Storage) GetPost(ctx context.Context, postID int64) (*model.Post, error)

func (*Storage) UpdateEnableCommentToPost

func (r *Storage) UpdateEnableCommentToPost(ctx context.Context, postID int64, authorID uuid.UUID, commentsEnabled bool) (*model.Post, error)

Jump to

Keyboard shortcuts

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