mysql

package
v0.0.0-...-40e0601 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnippetModel

type SnippetModel struct {
	DB *sql.DB
}

func (*SnippetModel) Get

func (m *SnippetModel) Get(id int) (*models.Snippet, error)

func (*SnippetModel) Insert

func (m *SnippetModel) Insert(title, content, expires string) (int, error)

func (*SnippetModel) Latest

func (m *SnippetModel) Latest() ([]*models.Snippet, error)

type UserModel

type UserModel struct {
	DB *sql.DB
}

func (*UserModel) Authenticate

func (m *UserModel) Authenticate(email, password string) (int, error)

Verify whether a user exists with the provided email address and password.

func (*UserModel) ChangePassword

func (m *UserModel) ChangePassword(id int, currentPassword, newPassword string) error

func (*UserModel) Get

func (m *UserModel) Get(id int) (*models.User, error)

Get details for a specific user based on their user ID.

func (*UserModel) Insert

func (m *UserModel) Insert(name, email, password string) error

Add a new record to the users table.

Jump to

Keyboard shortcuts

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