db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Note  = &noteSrv{}
	Input = &inputSrv{mux: &sync.RWMutex{}}
)

Functions

func Init

func Init()

Types

type FullTextSearch

type FullTextSearch interface {
	New(db *gorm.DB) FullTextSearch
	Init() error
	Index() error
	ReIndex() error
	Clean() error

	Search(keywords string, offset, limit int) ([]*model.Note, int64)
	Create(titleKeywords, contentKeywords string, id uint64) error
	Delete(id uint64) error
}

FullTextSearch interface

var Search FullTextSearch = &SQLite{}

type PostgreSQL

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

func (PostgreSQL) Clean

func (p PostgreSQL) Clean() error

func (PostgreSQL) Create

func (p PostgreSQL) Create(titleKeywords, contentKeywords string, id uint64) error

func (PostgreSQL) Delete

func (p PostgreSQL) Delete(id uint64) error

func (PostgreSQL) Index

func (p PostgreSQL) Index() error

func (PostgreSQL) Init

func (p PostgreSQL) Init() error

func (PostgreSQL) New

func (p PostgreSQL) New(db *gorm.DB) FullTextSearch

func (PostgreSQL) ReIndex

func (p PostgreSQL) ReIndex() error

func (PostgreSQL) Search

func (p PostgreSQL) Search(keywords string, offset, limit int) (arr []*model.Note, count int64)

type SQLite

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

func (SQLite) Clean

func (s SQLite) Clean() error

func (SQLite) Create

func (s SQLite) Create(titleKeywords, contentKeywords string, id uint64) error

func (SQLite) Delete

func (s SQLite) Delete(id uint64) error

func (SQLite) Index

func (s SQLite) Index() error

func (SQLite) Init

func (s SQLite) Init() error

func (SQLite) New

func (s SQLite) New(db *gorm.DB) FullTextSearch

func (SQLite) ReIndex

func (s SQLite) ReIndex() error

func (SQLite) Search

func (s SQLite) Search(keywords string, offset, limit int) (arr []*model.Note, count int64)

Jump to

Keyboard shortcuts

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