mongo

package
v0.0.0-...-0660248 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *mongo.Client

Connect connects to mongoDB

Types

type Database

type Database interface {
	Insert(string, []byte, *mongo.Client) error
	Find(string, *mongo.Client) (bson.M, error)
}

Database is used as interface to represent database operation

type Service

type Service struct {
}

Service contains mongo db client

func (*Service) Find

func (s *Service) Find(email string, client *mongo.Client) (bson.M, error)

Find gets data if exist from mongo db client

func (*Service) Insert

func (s *Service) Insert(email string, vault []byte, client *mongo.Client) error

Insert wraps InsertOne command from mongodb Driver and insert email and vault to db

Jump to

Keyboard shortcuts

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