db

package
v0.0.0-...-d03bf0a Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Client             *mongo.Client
	Database           *mongo.Database
	JobPostsCollection *mongo.Collection
	GeoCollection      *mongo.Collection
	BatchesCollection  *mongo.Collection
	Context            context.Context
}

func Connect

func Connect(config *configuration.Configuration) *Connection

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) FindOneGeoBy

func (c *Connection) FindOneGeoBy(location string) (primitive.M, error)

func (*Connection) GetConditionalDocument

func (c *Connection) GetConditionalDocument(data *domain.JobPost) bson.D

func (*Connection) GetGeoDocument

func (c *Connection) GetGeoDocument(geocoding interface{}) bson.D

func (*Connection) InsertBatch

func (c *Connection) InsertBatch(documents []interface{}, stats *domain.Stats)

func (*Connection) InsertBatchStats

func (c *Connection) InsertBatchStats(status string, total int, stats *domain.Stats)

func (*Connection) InsertOneGeocoding

func (c *Connection) InsertOneGeocoding(location string, geocoding interface{})

type Geocoding

type Geocoding struct {
	Geocoding interface{} `bson:"geocoding"`
}

Jump to

Keyboard shortcuts

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