dao

package
v0.0.0-...-fe7ef4e Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommentNotFound = errors.New("comment not found")
)

Functions

func NewPGCommentDAO

func NewPGCommentDAO(pgClient *pgkit.PGClient) *pgCommentDAO

func NewRedisCommentDAO

func NewRedisCommentDAO(client *rediskit.RedisClient, baseDAO CommentDAO) *redisCommentDAO

Types

type Comment

type Comment struct {
	ID        uuid.UUID
	VideoID   string
	Content   string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewFakeComment

func NewFakeComment(videoID string) *Comment

func (*Comment) ToProto

func (c *Comment) ToProto() *pb.CommentInfo

type CommentDAO

type CommentDAO interface {
	ListByVideoID(ctx context.Context, videoID string, limit, offset int) ([]*Comment, error)
	Create(ctx context.Context, comment *Comment) (uuid.UUID, error)
	Update(ctx context.Context, comment *Comment) error
	Delete(ctx context.Context, id uuid.UUID) error
	DeleteByVideoID(ctx context.Context, videoID string) error
}

Jump to

Keyboard shortcuts

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