sqlite

package
v0.0.0-...-b99b76b Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShortyModel

type ShortyModel struct {
	DB *sql.DB
}

ShortyModel wraps a db connection

func (*ShortyModel) AddClick

func (m *ShortyModel) AddClick(s *models.Shorty) error

AddClick updates a shorty

func (*ShortyModel) Find

func (m *ShortyModel) Find(hashID string) (*models.Shorty, error)

Find finds one shorty by HashId

func (*ShortyModel) FindAll

func (m *ShortyModel) FindAll() ([]*models.Shorty, error)

FindAll returns all shorties

func (*ShortyModel) InitTable

func (m *ShortyModel) InitTable() error

InitTable creates DB table

func (*ShortyModel) Insert

func (m *ShortyModel) Insert(s *models.Shorty) error

Insert adds a new shorty

func (*ShortyModel) Remove

func (m *ShortyModel) Remove(hashID string) error

Remove deletes a shorty

func (*ShortyModel) RemoveAll

func (m *ShortyModel) RemoveAll() error

RemoveAll removes all entries

type UserModel

type UserModel struct {
	DB *sql.DB
}

UserModel wraps a db connection

func (*UserModel) Authenticate

func (m *UserModel) Authenticate(email, password string) (*models.User, error)

Authenticate a user by email and password

func (*UserModel) Create

func (m *UserModel) Create(u *models.User) error

Create a user

func (*UserModel) Find

func (m *UserModel) Find(email string) (*models.User, error)

Find a user by email

func (*UserModel) InitTable

func (m *UserModel) InitTable() error

InitTable creates user table

Jump to

Keyboard shortcuts

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