core

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext()

func Shutdown

func Shutdown()

Types

type Article

type Article struct {
	Title     string `hsk:"size(128)"`
	Category  string
	ImageKey  *keys.TimeKey
	Content   template.HTML `hsk:"size(4096)"`
	WrittenBy string        `hsk:"size(64)"`
	Public    bool          `hsk:"default(false)"`
	Intro     string        `hsk:"size(128)"`
}

Article is a Blog Post

func (Article) Valid

func (a Article) Valid() error

type BlogContext

type BlogContext interface {
	UpdateArticle(k hsk.Key, obj Article) error
	CreateArticle(obj Article) (hsk.Key, error)
	RemoveArticle(key hsk.Key) error

	GetArticle(key hsk.Key) (Article, error)
	GetLatestArticles(page, size int) (records.Page, error)
	GetNonPublicArticles(page, size int) (records.Page, error)
}

func Context

func Context() BlogContext

Jump to

Keyboard shortcuts

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