models

package
v0.0.0-...-2c08a0f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bookmark

type Bookmark struct {
	ID               int64     `db:"id" json:"id"`
	URL              string    `db:"url" json:"url"`
	LastStatusCode   int64     `db:"last_status_code" json:"last_status_code"`
	LastStatusCheck  int64     `db:"last_status_check" json:"last_status_check"`
	LastStatusReason string    `db:"last_status_reason" json:"last_status_reason"`
	Title            string    `db:"title" json:"title"`
	CreatedAt        time.Time `db:"created_at" json:"created_at"`
	Inbox            int64     `db:"inbox" json:"inbox"`

	Host string `db:"-" json:"host"`
}

Bookmark stores the basic information of a web URL.

type BookmarkDAO

type BookmarkDAO interface {
	All() ([]*Bookmark, error)
	Bootstrap() error
	Delete(*Bookmark) error
	Expired() ([]*Bookmark, error)
	GetByID(id int64) (*Bookmark, error)
	Insert(*Bookmark) (*Bookmark, error)
	Invalid() ([]*Bookmark, error)
	Update(*Bookmark) error
}

BookmarkDAO provides DB persistence to bookmarks.

func NewBookmarkDAO

func NewBookmarkDAO(db *sqlx.DB) BookmarkDAO

NewBookmarkDAO instanties a BookmarkDAO

Jump to

Keyboard shortcuts

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