store

package
v0.0.0-...-90a12ec Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("article not found")
)

Functions

func NewArticleRepositoryFromFS

func NewArticleRepositoryFromFS(
	filesystem fs.FS,
	includeUnpublished bool,
) (*ArticleRepository, ParseResult, error)

Types

type ArticleRepository

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

func NewArticleRepository

func NewArticleRepository(
	articles []*model.Article,
) (*ArticleRepository, error)

func (*ArticleRepository) Count

func (r *ArticleRepository) Count(ctx context.Context) int

func (*ArticleRepository) FindAll

func (r *ArticleRepository) FindAll(context.Context) ([]*model.Article, error)

func (*ArticleRepository) FindAllTags

func (r *ArticleRepository) FindAllTags(ctx context.Context) ([]string, error)

func (*ArticleRepository) FindByTag

func (r *ArticleRepository) FindByTag(
	_ context.Context,
	tag string,
) ([]*model.Article, error)

func (*ArticleRepository) FindOneBySlug

func (r *ArticleRepository) FindOneBySlug(
	_ context.Context,
	slug string,
) (*model.Article, error)

func (*ArticleRepository) Search

func (r *ArticleRepository) Search(
	_ context.Context,
	terms string,
) ([]*model.Article, error)

func (*ArticleRepository) TagInfo

func (r *ArticleRepository) TagInfo(context.Context) map[string]int

func (*ArticleRepository) Tags

type ParseResult

type ParseResult struct {
	Articles           []*model.Article
	Duration           time.Duration
	Unpublished        int
	Count              int
	IncludeUnpublished bool
}

func (ParseResult) String

func (r ParseResult) String() string

Jump to

Keyboard shortcuts

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