mongo

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdSort = internal.IdSorter
)

Variables

View Source
var Sorters = map[int]mongop.MongoSorter{
	IdSort: (*mongop.IdSorter)(nil),
}

Functions

This section is empty.

Types

type MomentMongoModel

type MomentMongoModel interface {
	Insert(ctx context.Context, data *internal.Moment) error
	FindOne(ctx context.Context, id string) (*internal.Moment, error)
	Update(ctx context.Context, data *internal.Moment) error
	Delete(ctx context.Context, id string) error
	FindMany(ctx context.Context, fopts *internal.FilterOptions, popts *paginator.PaginationOptions, sorter int) ([]*internal.Moment, error)
	Count(ctx context.Context, filter *internal.FilterOptions) (int64, error)
	FindManyAndCount(ctx context.Context, fopts *internal.FilterOptions, popts *paginator.PaginationOptions, sorter int) ([]*internal.Moment, int64, error)
}

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

func NewMomentModel

func NewMomentModel(url, db string, c cache.CacheConf) MomentMongoModel

NewMomentModel returns a model for the mongo.

type PostFilter

type PostFilter struct {
	*internal.FilterOptions
	// contains filtered or unexported fields
}

func (*PostFilter) CheckOnlyCommunityId

func (f *PostFilter) CheckOnlyCommunityId()

func (*PostFilter) CheckOnlyCommunityIds

func (f *PostFilter) CheckOnlyCommunityIds()

func (*PostFilter) CheckOnlyUserId

func (f *PostFilter) CheckOnlyUserId()

Jump to

Keyboard shortcuts

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