model

package
v0.0.0-...-22c784e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AboutStore

type AboutStore struct {
	About map[string]interface{}
}

func NewAboutStore

func NewAboutStore(cfg *config.Config) (*AboutStore, error)

type Article

type Article struct {
	Slug        string        `db:"slug"`
	Title       string        `db:"title"`
	Content     template.HTML `db:"content"`
	Preview     template.HTML `db:"preview"`
	Categories  string        `db:"categories"`
	Tags        string        `db:"tags"`
	Pinned      bool          `db:"pinned"`
	Draft       bool          `db:"draft"`
	PublishedAt time.Time     `db:"published_at"`
}

func NewArticle

func NewArticle(path string, entry fs.DirEntry) (article *Article, err error)

NewArticle creates a Article instance with provided repo path `base`, article `path` and article `entry`.

func (*Article) Href

func (a *Article) Href() string

func (*Article) ShortPublicationDate

func (a *Article) ShortPublicationDate() string

type ArticleStore

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

func NewArticleStore

func NewArticleStore(db *sqlx.DB, cfg *config.Config) (*ArticleStore, error)

func (*ArticleStore) ReadArticle

func (s *ArticleStore) ReadArticle(slug string) (*Article, error)

func (*ArticleStore) ReadArticleCount

func (s *ArticleStore) ReadArticleCount() (int, error)

func (*ArticleStore) ReadArticles

func (s *ArticleStore) ReadArticles(limit int, offset int) ([]*Article, error)

func (*ArticleStore) ScanArticles

func (s *ArticleStore) ScanArticles() error

ScanArticles walks the artile file tree of the repo and parses them concurrently.

Jump to

Keyboard shortcuts

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