db

package
v0.0.0-...-d7f15a6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: Apache-2.0 Imports: 6 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 {
	DatabaseURI string
}

func InitConfig

func InitConfig() (*Config, error)

type Database

type Database struct {
	*gorm.DB
}

func New

func New(config *Config) (*Database, error)

func (*Database) CreateTodo

func (db *Database) CreateTodo(todo *model.Todo) error

func (*Database) CreateUser

func (db *Database) CreateUser(user *model.User) error

func (*Database) DeleteTodoById

func (db *Database) DeleteTodoById(id uint) error

func (*Database) GetTodoById

func (db *Database) GetTodoById(id uint) (*model.Todo, error)

func (*Database) GetTodosByUserId

func (db *Database) GetTodosByUserId(userId uint) ([]*model.Todo, error)

func (*Database) GetUserByEmail

func (db *Database) GetUserByEmail(email string) (*model.User, error)

func (*Database) UpdateTodo

func (db *Database) UpdateTodo(todo *model.Todo) error

Jump to

Keyboard shortcuts

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