postgres

package
v0.0.0-...-bf23469 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT 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 (s *SnippetModel) Get(id int) (*models.Snippet, error)

Get this will return specific snippet based on id

func (*SnippetModel) Insert

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

Insert This will insert a new snippet into the database

func (*SnippetModel) Latest

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

Latest This will return the top 10 most recently created snippets

type UserModel

type UserModel struct {
	DB *sql.DB
}

func (*UserModel) Authenticate

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

func (*UserModel) Get

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

func (*UserModel) Insert

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

Jump to

Keyboard shortcuts

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