datastore

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleDatastore

type ArticleDatastore interface {
	SaveArticle(article *models.Article) error
	FindArticleMetaWithPage(offset, limit int) (dtos.ArticleMetas, int64, error)
	FindArticleMetaByIDsWithPage(ids []int64, offset, limit int) (dtos.ArticleMetas, int64, error)
	FindArticleMetaByIDs(ids []int64) (dtos.ArticleMetas, error)
	GetArticleMetaByID(id int64) (*dtos.ArticleMeta, error)
	GetArticleByID(id int64) (*models.Article, error)
	FindArticleMetaByTagWithPage(tag string, offset, limit int) (dtos.ArticleMetas, int64, error)
	FindArticleMetaUntaggedWithPage(offset, limit int) (dtos.ArticleMetas, int64, error)
	GetArticleContentByID(id int64) (string, error)
	GetArticleUntaggedCount() (int64, error)
	GetArticleAllCount() (int64, error)
	ExistArticleByTitle(title string) (bool, error)
	ExistArticleByIDs(ids []int64) (bool, error)
	DeleteArticleByIDs(ids []int64) error
}

type ArticleSearchDatastore

type ArticleSearchDatastore interface {
	InitializeArticleSearch() error
	InsertArticleSearch(article *models.Article) error
	UpdateArticleSearch(article *models.Article) error
	DeleteArticleSearch(id int64) error
	DeleteArticleSearches(ids []int64) error
	SearchArticle(keyword string) ([]int64, error)
}

type ArticleTagDatastore

type ArticleTagDatastore interface {
	UpdateArticleTag(tag, newTag string) error
	FindArticleTagCounts() ([]*models.ArticleTagCountDTO, error)
	DeleteArticleTag(articleTags models.ArticleTags) error
	DeleteArticleTagsByIDs(ids []int64) error
}

type Datastore

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

func New

func New() *Datastore

func (*Datastore) CreateOrUpdateKeyValue

func (d *Datastore) CreateOrUpdateKeyValue(key, value string) error

func (*Datastore) DeleteArticleByIDs

func (d *Datastore) DeleteArticleByIDs(ids []int64) error

func (*Datastore) DeleteArticleSearch

func (d *Datastore) DeleteArticleSearch(id int64) error

func (*Datastore) DeleteArticleSearches

func (d *Datastore) DeleteArticleSearches(ids []int64) error

func (*Datastore) DeleteArticleTag

func (d *Datastore) DeleteArticleTag(articleTags models.ArticleTags) error

func (*Datastore) DeleteArticleTagsByIDs

func (d *Datastore) DeleteArticleTagsByIDs(ids []int64) error

func (*Datastore) DeleteNoteByIDs

func (d *Datastore) DeleteNoteByIDs(ids []int64) error

func (*Datastore) DeleteNoteSearch

func (d *Datastore) DeleteNoteSearch(id int64) error

func (*Datastore) DeleteNoteSearches

func (d *Datastore) DeleteNoteSearches(ids []int64) error

func (*Datastore) DeleteParagraphByIDAndNoteID

func (d *Datastore) DeleteParagraphByIDAndNoteID(id, noteID int64) error

func (*Datastore) DeleteParagraphByIDs

func (d *Datastore) DeleteParagraphByIDs(ids []int64) error

func (*Datastore) DeleteReferenceArticleByIDs

func (d *Datastore) DeleteReferenceArticleByIDs(ids []int64) error

func (*Datastore) DeleteReferenceWebByIDs

func (d *Datastore) DeleteReferenceWebByIDs(ids []int64) error

func (*Datastore) DeleteValueByKeys

func (d *Datastore) DeleteValueByKeys(keys []string) error

func (*Datastore) ExistArticleByIDs

func (d *Datastore) ExistArticleByIDs(ids []int64) (bool, error)

func (*Datastore) ExistArticleByTitle

func (d *Datastore) ExistArticleByTitle(title string) (bool, error)

func (*Datastore) ExistNoteByTitle

func (d *Datastore) ExistNoteByTitle(title string) (bool, error)

func (*Datastore) FindArticleMetaByIDs

func (d *Datastore) FindArticleMetaByIDs(ids []int64) (dtos.ArticleMetas, error)

func (*Datastore) FindArticleMetaByIDsWithPage

func (d *Datastore) FindArticleMetaByIDsWithPage(ids []int64, offset, limit int) (dtos.ArticleMetas, int64, error)

func (*Datastore) FindArticleMetaByTagWithPage

func (d *Datastore) FindArticleMetaByTagWithPage(tag string, offset, limit int) (dtos.ArticleMetas, int64, error)

func (*Datastore) FindArticleMetaUntaggedWithPage

func (d *Datastore) FindArticleMetaUntaggedWithPage(offset, limit int) (dtos.ArticleMetas, int64, error)

func (*Datastore) FindArticleMetaWithPage

func (d *Datastore) FindArticleMetaWithPage(offset, limit int) (dtos.ArticleMetas, int64, error)

func (*Datastore) FindArticleTagCounts

func (d *Datastore) FindArticleTagCounts() ([]*models.ArticleTagCountDTO, error)

func (*Datastore) FindNoteByIDs

func (d *Datastore) FindNoteByIDs(ids []int64) (models.Notes, error)

func (*Datastore) FindNoteByIDsWithPage

func (d *Datastore) FindNoteByIDsWithPage(ids []int64, offset, limit int) (models.Notes, int64, error)

func (*Datastore) FindNoteTitles

func (d *Datastore) FindNoteTitles() (models.Notes, error)

func (*Datastore) FindNoteWithPage

func (d *Datastore) FindNoteWithPage(offset, limit int) (models.Notes, int64, error)

func (*Datastore) FindParagraphByIDsAndNoteID

func (d *Datastore) FindParagraphByIDsAndNoteID(ids []int64, noteID int64) (models.Paragraphs, error)

func (*Datastore) GetArticleAllCount

func (d *Datastore) GetArticleAllCount() (int64, error)

func (*Datastore) GetArticleByID

func (d *Datastore) GetArticleByID(id int64) (*models.Article, error)

func (*Datastore) GetArticleContentByID

func (d *Datastore) GetArticleContentByID(id int64) (string, error)

func (*Datastore) GetArticleMetaByID

func (d *Datastore) GetArticleMetaByID(id int64) (*dtos.ArticleMeta, error)

func (*Datastore) GetArticleUntaggedCount

func (d *Datastore) GetArticleUntaggedCount() (int64, error)

func (*Datastore) GetNoteByID

func (d *Datastore) GetNoteByID(id int64) (*models.Note, error)

func (*Datastore) GetParagraphByIDAndNoteID

func (d *Datastore) GetParagraphByIDAndNoteID(id, noteID int64) (*models.Paragraph, error)

func (*Datastore) GetValue

func (d *Datastore) GetValue(key string) (string, error)

func (*Datastore) Init

func (d *Datastore) Init() error

func (*Datastore) InitializeArticleSearch

func (d *Datastore) InitializeArticleSearch() error

func (*Datastore) InitializeNoteSearch

func (d *Datastore) InitializeNoteSearch() error

func (*Datastore) InsertArticleSearch

func (d *Datastore) InsertArticleSearch(article *models.Article) error

func (*Datastore) InsertNoteSearch

func (d *Datastore) InsertNoteSearch(note *models.Note) error

func (*Datastore) SaveArticle

func (d *Datastore) SaveArticle(article *models.Article) error

func (*Datastore) SaveNote

func (d *Datastore) SaveNote(note *models.Note) error

func (*Datastore) SaveParagraph

func (d *Datastore) SaveParagraph(paragraph *models.Paragraph) error

func (*Datastore) SearchArticle

func (d *Datastore) SearchArticle(keyword string) ([]int64, error)

func (*Datastore) SearchNote

func (d *Datastore) SearchNote(keyword string) ([]int64, error)

func (*Datastore) UpdateArticleSearch

func (d *Datastore) UpdateArticleSearch(article *models.Article) error

func (*Datastore) UpdateArticleTag

func (d *Datastore) UpdateArticleTag(tag, newTag string) error

func (*Datastore) UpdateNoteSearch

func (d *Datastore) UpdateNoteSearch(note *models.Note) error

type MiscDatastore

type MiscDatastore interface {
	CreateOrUpdateKeyValue(key, value string) error
	GetValue(key string) (string, error)
	DeleteValueByKeys(keys []string) error
}

type NoteDatastore

type NoteDatastore interface {
	SaveNote(note *models.Note) error
	FindNoteWithPage(offset, limit int) (models.Notes, int64, error)
	FindNoteByIDsWithPage(ids []int64, offset, limit int) (models.Notes, int64, error)
	FindNoteByIDs(ids []int64) (models.Notes, error)
	FindNoteTitles() (models.Notes, error)
	GetNoteByID(id int64) (*models.Note, error)
	ExistNoteByTitle(title string) (bool, error)
	DeleteNoteByIDs(ids []int64) error
}

type NoteSearchDatastore

type NoteSearchDatastore interface {
	InitializeNoteSearch() error
	InsertNoteSearch(note *models.Note) error
	UpdateNoteSearch(note *models.Note) error
	DeleteNoteSearch(id int64) error
	DeleteNoteSearches(ids []int64) error
	SearchNote(keyword string) ([]int64, error)
}

type ParagraphDatastore

type ParagraphDatastore interface {
	SaveParagraph(paragraph *models.Paragraph) error
	GetParagraphByIDAndNoteID(id, noteID int64) (*models.Paragraph, error)
	FindParagraphByIDsAndNoteID(ids []int64, noteID int64) (models.Paragraphs, error)
	DeleteParagraphByIDs(ids []int64) error
	DeleteParagraphByIDAndNoteID(id, noteID int64) error
}

type ReferenceArticleDatastore

type ReferenceArticleDatastore interface {
	DeleteReferenceArticleByIDs(ids []int64) error
}

type ReferenceWebDatastore

type ReferenceWebDatastore interface {
	DeleteReferenceWebByIDs(ids []int64) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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