mysql

package
v0.0.0-...-9908c75 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	DB *sql.DB
}

func (*DB) AuthenticateUser

func (m *DB) AuthenticateUser(email, password string) (int, error)

func (*DB) Close

func (d *DB) Close()

func (*DB) Connect

func (d *DB) Connect(dsn string) error

func (*DB) GetArticle

func (m *DB) GetArticle(id int) (*models.Article, error)

Get gets a single article from the DB

func (*DB) GetUser

func (m *DB) GetUser(id int) (*models.User, error)

func (*DB) InsertArticle

func (m *DB) InsertArticle(title, content, url string) (int, error)

Insert adds an article to the DB

func (*DB) InsertUser

func (m *DB) InsertUser(name, email, password string) error

func (*DB) LatestArticles

func (m *DB) LatestArticles() ([]*models.Article, error)

Latest gets the 10 most recent articles from the DB

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳