builder

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package builder 提供编译成 HTML 的相关功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder 提供了一个可重复生成 HTML 内容的对象

func New

func New(fs filesystem.WritableFS, l *log.Logger) *Builder

New 声明 Builder 实例

fs 表示用于保存编译后的 HTML 文件的系统。可以是内存或是文件系统, 以及任何实现了 filesystem.WritableFS 接口都可以; l 表示的是在把 Builder 当作 http.Handler 处理时,在出错时的日志输出通道。 如果为空,则会采用 log.Default() 作为默认值。 如果不准备其当作 http.Handler 使用,则此值是无用;

func (*Builder) Rebuild

func (b *Builder) Rebuild(src fs.FS, base string) error

Rebuild 重新生成数据

func (*Builder) ServeHTTP

func (b *Builder) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP 作为 HTTP 服务接口使用

Jump to

Keyboard shortcuts

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