transport

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(config *config.Toml, handler http.Handler) *http.Server

func NewHandler

func NewHandler(o *Options) http.Handler

func NewTemplate

func NewTemplate(config *config.Toml) (*template.Template, error)

NewTemplate 加载主题模板文件

Types

type About

type About struct {
	Template *template.Template
	Service  service.IArticle
	Config   *config.Toml
}

func (*About) ServeHTTP

func (h *About) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ArticleDetail

type ArticleDetail struct {
	Template *template.Template
	Service  service.IArticle
	Config   *config.Toml
}

func (*ArticleDetail) ServeHTTP

func (h *ArticleDetail) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CDNProxy

type CDNProxy struct {
	Template *template.Template
	Service  service.IArticle
	Config   *config.Toml
}

CDNProxy 反向代理,解决跨域图片加载问题

func (*CDNProxy) ServeHTTP

func (h *CDNProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HomePage

type HomePage struct {
	Template *template.Template
	Service  service.IArticle
	Config   *config.Toml
}

func (*HomePage) ServeHTTP

func (h *HomePage) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	HomePage      *HomePage
	ArticleDetail *ArticleDetail
	Search        *Search
	About         *About
	CDNProxy      *CDNProxy
	Config        *config.Toml
}
type Search struct {
	Template *template.Template
	Service  service.IArticle
	Config   *config.Toml
}

func (*Search) ServeHTTP

func (h *Search) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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