mongo

package
v0.0.0-...-0a9cbe0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf map[string]string) (drivers.DataStore, error)

Types

type Mongo

type Mongo struct {
	MongoURL string

	DB      *mongo.Database
	Context context.Context
	// contains filtered or unexported fields
}

func (*Mongo) Close

func (m *Mongo) Close() error

func (*Mongo) Connect

func (m *Mongo) Connect() error

func (*Mongo) CreateUser

func (m *Mongo) CreateUser(ctx context.Context, user *entity.User) (int, error)

func (*Mongo) GetUserByEmail

func (m *Mongo) GetUserByEmail(ctx context.Context, email string) (*entity.User, error)

func (*Mongo) GetUserByID

func (m *Mongo) GetUserByID(ctx context.Context, id int) (user *entity.User, err error)

func (*Mongo) GetUsers

func (m *Mongo) GetUsers(ctx context.Context) ([]*entity.User, error)

func (*Mongo) Name

func (m *Mongo) Name() string

func (*Mongo) Ping

func (m *Mongo) Ping() error

Jump to

Keyboard shortcuts

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