store

package
v0.0.0-...-a078def Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("this user doesn't exist in the database")

nolint: gofumpt

View Source
var ErrWrongPass = errors.New("password is not correct")

Functions

This section is empty.

Types

type SQLURL

type SQLURL struct {
	DB *gorm.DB
}

func NewURL

func NewURL(d *gorm.DB) SQLURL

func (SQLURL) Create

func (u SQLURL) Create()

Creates a table in the database that matches the URL table.

func (SQLURL) GetTable

func (u SQLURL) GetTable() ([]model.URL, error)

func (SQLURL) Insert

func (u SQLURL) Insert(url model.URL) error

type SQLUser

type SQLUser struct {
	DB *gorm.DB
}

func NewUser

func NewUser(d *gorm.DB) SQLUser

func (SQLUser) Create

func (u SQLUser) Create()

Creates a table in the database that matches the User table.

func (SQLUser) Insert

func (u SQLUser) Insert(user model.User) error

func (SQLUser) Retrieve

func (u SQLUser) Retrieve(user model.User) (model.User, error)

type URL

type URL interface {
	Insert(url model.URL) error
	GetTable() ([]model.URL, error)
}

type User

type User interface {
	Insert(user model.User) error
	Retrieve(user model.User) (model.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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