mongo

package
v0.0.0-...-54ca9e8 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

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

func NewLimiterRepo

func NewLimiterRepo(col string, db *MongoRepo) *Limiter

func (*Limiter) Get

func (m *Limiter) Get(shorturl string) (entity.Limiter, error)

func (*Limiter) Save

func (m *Limiter) Save(l *entity.Limiter) error

func (*Limiter) UpdateByShortURL

func (m *Limiter) UpdateByShortURL(shortulr string, limiter *entity.Limiter) error

type MongoRepo

type MongoRepo struct {
	*mongoUtils.MongoClient
}

func NewMongoRepo

func NewMongoRepo(mu *mongoUtils.MongoClient) *MongoRepo

func (*MongoRepo) GetOne

func (m *MongoRepo) GetOne(ctx context.Context, obj *bson.M, collection string) *mongo.SingleResult

Get from db

func (*MongoRepo) Save

func (m *MongoRepo) Save(ctx context.Context, obj *bson.M, collection string) error

Jump to

Keyboard shortcuts

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