website

package
v0.0.0-...-aa15ba8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicate    = errors.New("Record already exists")
	ErrNotExists    = errors.New("Row not exists")
	ErrUpdateFailed = errors.New("Update failed")
	ErrDeleteFailed = errors.New("delete failed")
)

Functions

This section is empty.

Types

type SQLiteRepository

type SQLiteRepository struct {
	// contains filtered or unexported fields
}

func NewSQLiteRepository

func NewSQLiteRepository(db *sql.DB) *SQLiteRepository

func (*SQLiteRepository) All

func (r *SQLiteRepository) All() ([]Website, error)

func (*SQLiteRepository) Create

func (r *SQLiteRepository) Create(website Website) (*Website, error)

func (*SQLiteRepository) Delete

func (r *SQLiteRepository) Delete(id int64) error

func (*SQLiteRepository) GetByName

func (r *SQLiteRepository) GetByName(name string) (*Website, error)

func (*SQLiteRepository) Migrate

func (r *SQLiteRepository) Migrate() error

func (*SQLiteRepository) Update

func (r *SQLiteRepository) Update(id int64, updated Website) (*Website, error)

type Website

type Website struct {
	ID   int64
	Name string
	URL  string
	Rank int64
}

Jump to

Keyboard shortcuts

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