render

package
v0.0.0-...-bcf4c9c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeys

func GetKeys(cfgs []*Config) []string

GetKeys 获取配置文件中模板里指定的所有key 这些key用来去Storage中获取数据

func Register

func Register(name string, fn interface{})

Register 注册模板渲染函数

Types

type Config

type Config struct {
	Src       string   `toml:"src"`
	Dst       string   `toml:"dst"`
	Keys      []string `toml:"keys"`
	ReloadCmd string   `toml:"reload_cmd"`
}

Config 应用模板配置

type Processor

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

Processor 模板实际处理者

func NewProcessor

func NewProcessor(cfg *Config) (*Processor, error)

NewProcessor 创建Processor实例

func (*Processor) GetInKeys

func (p *Processor) GetInKeys(keys []string) []string

GetInKeys 给定一些key, 判断哪些key在process, 并返回

func (*Processor) GetTemplate

func (p *Processor) GetTemplate() string

GetTemplate 获取渲染模板路径

func (*Processor) Rendering

func (p *Processor) Rendering() (err error)

Rendering 渲染模板

Jump to

Keyboard shortcuts

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