Database

package
v0.0.0-...-67b66e9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	User   string = "users"
	Url    string = "urls"
	UrlIfo string = "url_infos"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBase

type DataBase struct {
	Client *mongo.Database
}

func ConnectionDatabase

func ConnectionDatabase() *DataBase

func (*DataBase) Add

func (db *DataBase) Add(col string, data interface{}) (*mongo.InsertOneResult, error)

func (*DataBase) Delete

func (db *DataBase) Delete(col string, id string) error

func (*DataBase) Get

func (db *DataBase) Get(col, id string) (*mongo.SingleResult, error)

func (*DataBase) GetBy

func (db *DataBase) GetBy(col string, data interface{}) (*mongo.SingleResult, error)

func (*DataBase) GetList

func (db *DataBase) GetList(col string, data interface{}) (*mongo.Cursor, error)

func (*DataBase) Update

func (db *DataBase) Update(col string, id string, data interface{}) (*mongo.UpdateResult, error)

Jump to

Keyboard shortcuts

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