commentcached

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Code generated by goctl. DO NOT EDIT.

Index

Constants

View Source
const CommentCollectionName = "comment"

Variables

View Source
var (
	ErrNotFound        = mon.ErrNotFound
	ErrInvalidObjectId = errors.New("invalid objectId")
)

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID      primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	ReplyTo string             `bson:"replyTo,omitempty" json:"replyTo,omitempty"`

	ParentId string `bson:"parentId,omitempty" json:"parentId,omitempty"`
	Type     string `bson:"type,omitempty" json:"type,omitempty"`
	Text     string `bson:"text,omitempty" json:"text,omitempty"`
	AuthorId string `bson:"authorId,omitempty" json:"authorId,omitempty"`

	UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
	CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"`
}

type CommentModel

type CommentModel interface {
	FindByAuthorIdAndType(ctx context.Context, authorId string, _type string, skip int64, limit int64) ([]Comment, int64, error)
	FindByParent(ctx context.Context, _type string, parentId string, skip int64, limit int64) ([]Comment, int64, error)
	FindByReplyToAndType(ctx context.Context, _type string, replyTo string, skip int64, limit int64) ([]Comment, int64, error)
	CountByParent(ctx context.Context, _type string, parentId string) (int64, error)
	// contains filtered or unexported methods
}

CommentModel is an interface to be customized, add more methods here, and implement the added methods in customCommentModel.

func NewCommentModel

func NewCommentModel(url, db string, c cache.CacheConf) CommentModel

NewCommentModel returns a model for the mongo.

Jump to

Keyboard shortcuts

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