theme

package
v1.0.1-0...-5011f7a Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Theme

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

Theme ...

func New

func New(devMode bool, cfg *config.Config, service proto.TaoBlogServer, impl service.ToBeImplementedByRpc, searcher proto.SearchServer, auth *auth.Auth, fsys theme_fs.FS) *Theme

func (*Theme) ChangedAt

func (t *Theme) ChangedAt() time.Time

func (*Theme) Exception

func (t *Theme) Exception(w http.ResponseWriter, req *http.Request, e any) bool

func (*Theme) LastPostTime304Handler

func (t *Theme) LastPostTime304Handler(h http.Handler) http.Handler

func (*Theme) LastPostTime304HandlerFunc

func (t *Theme) LastPostTime304HandlerFunc(h http.HandlerFunc) http.Handler

func (*Theme) ProcessHomeQueries

func (t *Theme) ProcessHomeQueries(w http.ResponseWriter, req *http.Request, query url.Values) bool

func (*Theme) QueryByID

func (t *Theme) QueryByID(w http.ResponseWriter, r *http.Request, id int64)

func (*Theme) QueryByPage

func (t *Theme) QueryByPage(w http.ResponseWriter, r *http.Request, path string) (int64, error)

func (*Theme) QueryByTags

func (t *Theme) QueryByTags(w http.ResponseWriter, req *http.Request, tags []string)

func (*Theme) QueryFile

func (t *Theme) QueryFile(w http.ResponseWriter, req *http.Request, postID int64, file string)

TODO 没限制不可访问文章的附件是否不可访问。 毕竟,文章不可访问后,文件列表暂时拿不到。 不一定,比如,文件很可能是形如:IMG_XXXX.JPG,暴力遍历一下就能拿到。 file 不以 / 开头。 TODO 添加测试用例。

func (*Theme) QueryHome

func (t *Theme) QueryHome(w http.ResponseWriter, req *http.Request) error

func (*Theme) QuerySpecial

func (t *Theme) QuerySpecial(w http.ResponseWriter, req *http.Request, file string) bool

func (*Theme) QueryStatic

func (t *Theme) QueryStatic(w http.ResponseWriter, req *http.Request, file string)

TODO 没有处理错误(比如文件不存在)。

Directories

Path Synopsis
modules
fs

Jump to

Keyboard shortcuts

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