database

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDatabase

func OpenDatabase(logger logger.Interface, dbPath string) (db *gorm.DB, err error)

func Paginate

func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB

Types

type Bookmark

type Bookmark struct {
	ID          uint   `gorm:"primaryKey"`
	URL         string `gorm:"uniqueIndex:idx_bookmark_url"`
	Title       string
	Description string
	Tags        []Tag `gorm:"many2many:bookmark_tags;"`
	Read        bool
	Favorite    bool
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Session

type Session struct {
	ID        uint   `gorm:"primaryKey"`
	Token     string `gorm:"uniqueIndex:idx_session_token"`
	CreatedAt time.Time
	ExpiresAt time.Time
}

type Tag

type Tag struct {
	ID   uint   `gorm:"primaryKey"`
	Name string `gorm:"uniqueIndex:idx_tag_name"`
}

Jump to

Keyboard shortcuts

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