mongodb

package
v0.0.0-...-1a49654 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB() dbConnection

Types

type DataBase

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

func New

func New(connectString string, connectTimeout time.Duration) DataBase

func (DataBase) IsExists

func (s DataBase) IsExists(ctx context.Context, storagePage *database.Page) (bool, error)

func (DataBase) Remove

func (s DataBase) Remove(ctx context.Context, storagePage *database.Page) error

func (DataBase) Save

func (s DataBase) Save(ctx context.Context, page *database.Page) error

type Notes

type Notes struct {
	*mongo.Collection
}

type Page

type Page struct {
	URL      string `bson:"url"`
	UserName string `bson:"username"`
}

func (Page) Filter

func (p Page) Filter() bson.M

Jump to

Keyboard shortcuts

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