database

package
v0.0.0-...-bb5f922 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	Client *mongo.Client
}

Mongo is responsible for representing a mongo instance and all methods that it implements

func OpenClientConnection

func OpenClientConnection(uri string) (*Mongo, error)

OpenClientConnection opens a new mongo connection using the given uri, in addition it also pings the new connection.

func (*Mongo) DeleteUser

func (m *Mongo) DeleteUser(u uuid.UUID) error

DeleteUser deletes a user based on a UUID

func (*Mongo) FindUser

func (m *Mongo) FindUser(u uuid.UUID) (user.User, error)

FindUser finds a user based on a UUID

func (*Mongo) InsertUser

func (m *Mongo) InsertUser(u user.User) error

InsertUser inserts new user to users collection

func (*Mongo) UpdateUser

func (m *Mongo) UpdateUser(u user.User, uuid uuid.UUID) error

UpdateUser finds a user based on a UUID and updates it according to the data passed.

Jump to

Keyboard shortcuts

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