db

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

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongoDB *mongodb.Config
}

Config represents the configuration of the database interface

type DB

type DB interface {
	CloseConnection() error

	CreateUser(u *model.User) error
	GetUser(id string) (*model.User, error)
	GetUserByEmail(email string) (*model.User, error)
	SaveUser(u *model.User) error
	DeleteUser(id string) error
}

DB is the interface which must be implemented by all db drivers

func NewConnection

func NewConnection(config *Config) (DB, error)

NewConnection creates a new database connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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