pgstore

package
v0.0.0-...-9a1b10e Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBPgLink struct {
	Short         string     `db:"short"`
	Url           string     `db:"url"`
	Search        string     `db:"search"`
	RedirectCount int        `db:"redirect_cont"`
	CreatedAt     time.Time  `db:"created_at"`
	UpdatedAt     time.Time  `db:"updated_at"`
	DeletedAt     *time.Time `db:"deleted_at"`
}
type Links struct {
	// contains filtered or unexported fields
}
func NewLinks(dsn string) (*Links, error)

func (*Links) Close

func (ls *Links) Close()

func (*Links) Create

func (ls *Links) Create(ctx context.Context, l link.Link) (*link.Link, error)

func (*Links) Delete

func (ls *Links) Delete(ctx context.Context, short shorturl.ShortUrl) error

func (*Links) IncRedirectCount

func (ls *Links) IncRedirectCount(ctx context.Context, short shorturl.ShortUrl) error

func (*Links) Read

func (ls *Links) Read(ctx context.Context, short shorturl.ShortUrl) (*link.Link, error)

func (*Links) ReadByOrigin

func (ls *Links) ReadByOrigin(ctx context.Context, l link.Link) (*link.Link, error)

ReadByOrigin ищет ссылку в БД по совпадению url

func (ls *Links) SearchLinks(ctx context.Context, s string) (chan link.Link, error)

Jump to

Keyboard shortcuts

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