view

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 5 Imported by: 3

README

view

chefgo view module.

Documentation

Index

Constants

View Source
const (
	NAME = "VIEW"
)

Variables

This section is empty.

Functions

func Configure

func Configure(cfg Map)

Configure 更新配置

func Go

func Go()

Go 直接开跑 此方法只单独使用模块时用

func Parse

func Parse(body Body) (string, error)

func Ready

func Ready()

Ready 准备运行 此方法只单独使用模块时用

func Register

func Register(name string, value Any, overrides ...bool)

Register 开放给外

Types

type Body

type Body struct {
	View     string
	Site     string
	Language string
	Timezone *time.Location
	Data     Map
	Model    Map
	Helpers  Map
}

type Config

type Config struct {
	Driver  string
	Root    string
	Shared  string
	Left    string
	Right   string
	Setting Map
}

LogConfig 日志模块配置

type Connect

type Connect interface {
	Open() error
	Health() (Health, error)
	Close() error

	Parse(Body) (string, error)
}

LogConnect 日志连接

type Driver

type Driver interface {
	// 连接到驱动
	Connect(config Config) (Connect, error)
}

LogDriver view驱动

type Health

type Health struct {
	Workload int64
}

type Helper

type Helper struct {
	Name   string   `json:"name"`
	Desc   string   `json:"desc"`
	Alias  []string `json:"alias"`
	Action Any      `json:"-"`
}

type Module

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

日志模块定义

func (*Module) Config

func (this *Module) Config(config Config, override bool)

func (*Module) Configure

func (this *Module) Configure(global Map)

func (*Module) Connect

func (this *Module) Connect()

func (*Module) Driver

func (this *Module) Driver(name string, driver Driver, override bool)

Driver 为view模块注册驱动

func (*Module) Helper

func (this *Module) Helper(name string, config Helper, override bool)

func (*Module) Initialize

func (this *Module) Initialize()

func (*Module) Launch

func (this *Module) Launch()

func (*Module) Parse

func (this *Module) Parse(body Body) (string, error)

func (*Module) Register

func (this *Module) Register(name string, value Any, override bool)

func (*Module) Terminate

func (this *Module) Terminate()

Jump to

Keyboard shortcuts

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