mysql

package
v0.0.0-...-bb74d98 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: GPL-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 SnippetModel

type SnippetModel struct {
	DB *sql.DB
}

func (*SnippetModel) Get

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

Get an snippet based on its id

func (*SnippetModel) Insert

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

Insert a new snippet to database.

func (*SnippetModel) Latest

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

Get 10 most recently created snippets

type UserModel

type UserModel struct {
	DB *sql.DB
}

func (*UserModel) Authenticate

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

func (*UserModel) Get

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

func (*UserModel) Insert

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

Jump to

Keyboard shortcuts

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