dao

package
v0.0.0-...-594631a Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountStats

type CountStats struct {
	mongox.Model `bson:",inline"`
	Type         string `bson:"type"`
	Count        int64  `bson:"count"`
}

type CountStatsDao

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

func NewCountStatsDao

func NewCountStatsDao(db *mongo.Database) *CountStatsDao

func (*CountStatsDao) Create

func (d *CountStatsDao) Create(ctx context.Context, countStats *CountStats) (string, error)

func (*CountStatsDao) DecreaseByReferenceIdAndType

func (d *CountStatsDao) DecreaseByReferenceIdAndType(ctx context.Context, statsType string, count int) error

func (*CountStatsDao) DeleteByReferenceIdAndType

func (d *CountStatsDao) DeleteByReferenceIdAndType(ctx context.Context, statsType string) error

func (*CountStatsDao) GetByFilter

func (d *CountStatsDao) GetByFilter(ctx context.Context, filter bson.D) ([]*CountStats, error)

func (*CountStatsDao) IncreaseByReferenceIdAndType

func (d *CountStatsDao) IncreaseByReferenceIdAndType(ctx context.Context, statsType string, delta int) error

type ICountStatsDao

type ICountStatsDao interface {
	Create(ctx context.Context, countStats *CountStats) (string, error)
	DeleteByReferenceIdAndType(ctx context.Context, statsType string) error
	DecreaseByReferenceIdAndType(ctx context.Context, statsType string, count int) error
	IncreaseByReferenceIdAndType(ctx context.Context, statsType string, delta int) error
	GetByFilter(ctx context.Context, filter bson.D) ([]*CountStats, error)
}

Jump to

Keyboard shortcuts

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