db

package
v0.0.0-...-7ec0da2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(path string) (*sql.DB, error)

Types

type Count

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

func NewCount

func NewCount(sql *sql.DB) Count

func (Count) Add

func (c Count) Add(link models.Link) error

func (Count) Count

func (c Count) Count(link models.Link) (int, error)

type Crypt

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

func NewCrypt

func NewCrypt(sql *sql.DB) Crypt

func (Crypt) Hash

func (c Crypt) Hash(str string) string
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(db *sql.DB) Link

func (Link) Create

func (l Link) Create(link models.Link) (models.Link, error)

func (Link) Delete

func (l Link) Delete(link models.Link) error

func (Link) GetAllByUser

func (l Link) GetAllByUser(user models.UserInfo) ([]models.Link, error)

func (Link) GetByAPIPoint

func (l Link) GetByAPIPoint(link models.Link) (models.Link, error)

func (Link) GetByID

func (l Link) GetByID(link models.Link) (models.Link, error)

func (Link) IsApiPointExist

func (l Link) IsApiPointExist(str string) bool

func (Link) Scan

func (l Link) Scan(row *sql.Row) (models.Link, error)

func (Link) ScanRows

func (l Link) ScanRows(rows *sql.Rows) ([]models.Link, error)

type User

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

func NewUser

func NewUser(db *sql.DB) User

func (User) Add

func (u User) Add(user models.UserConn) (models.UserInfo, error)

func (User) Connection

func (u User) Connection(conn models.UserConn) (models.UserInfo, bool, error)

func (User) GetById

func (u User) GetById(user models.UserInfo) (models.UserInfo, error)

func (User) IsUserExist

func (u User) IsUserExist(user models.UserInfo) bool

func (User) ScanConnection

func (u User) ScanConnection(row *sql.Row) (models.UserConn, error)

func (User) ScanInfo

func (u User) ScanInfo(row *sql.Row) (models.UserInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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