model

package
v0.0.0-...-63ac2f8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type Shorturl

type Shorturl struct {
	Shorten string `db:"shorten"` // shorten key
	Url     string `db:"url"`     // original url
}

type ShorturlModel

type ShorturlModel struct {
	sqlc.CachedConn
	// contains filtered or unexported fields
}

func NewShorturlModel

func NewShorturlModel(conn sqlx.SqlConn, c cache.CacheConf) *ShorturlModel

func (*ShorturlModel) Delete

func (m *ShorturlModel) Delete(shorten string) error

func (*ShorturlModel) FindOne

func (m *ShorturlModel) FindOne(shorten string) (*Shorturl, error)

func (*ShorturlModel) Insert

func (m *ShorturlModel) Insert(data Shorturl) (sql.Result, error)

func (*ShorturlModel) Update

func (m *ShorturlModel) Update(data Shorturl) error

Jump to

Keyboard shortcuts

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