database

package
v0.0.0-...-fa757dc Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBName = "userService"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Connection

func Connection() *DB

func (*DB) CreateUser

func (db *DB) CreateUser(user *models.User) (*mongo.InsertOneResult, error)

func (*DB) DeleteUser

func (db *DB) DeleteUser(id string)

func (*DB) FindUser

func (db *DB) FindUser(id string) (models.User, error)

func (*DB) FindUsers

func (db *DB) FindUsers() ([]models.User, error)

func (*DB) UpdateUser

func (db *DB) UpdateUser(id string, data interface{}) (string, error)

Jump to

Keyboard shortcuts

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