builder

package
v0.0.0-...-19eb0a2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 aggronmagi <czy463@163.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// InnerTemplate  - 模板生成器
	InnerTemplate = "template"
	// InnerPrinter - 打印插件参数. 用于调试
	InnerPrinter = "printer"
)

内部生成器名称

View Source
const (
	OptionGoPKG = "proto.gopkg"
)

Variables

This section is empty.

Functions

func Build

func Build(progs []*ast.YTProgram, outPath string, merge bool) (err error)

Build 生成代码

func EnableGenerator

func EnableGenerator(key string) (err error)

EnableGenerator 生效内置生成器

func GetInnerGenerator

func GetInnerGenerator() (list []string)

GetInnerGenerator 获取内置插件

func LoadGoPluginGenerater

func LoadGoPluginGenerater(name string) (err error)

LoadGoPluginGenerater 加载插件,并生效

func NewCmdPluginGenerater

func NewCmdPluginGenerater(cmd string) (err error)

NewCmdPluginGenerater 新建命令行插件-代码生成器

func RegisterGenerater

func RegisterGenerater(gen Generater)

RegisterGenerater 注册生成器

Types

type Generater

type Generater interface {
	// Generate 生成代码接口
	Generate(prog *ast.YTProgram) (outs []*Output, err error)
	// Union 唯一标识符 用于标识不同插件
	Union() string
}

Generater go插件 代码生成接口

type Output

type Output struct {
	File string
	Data []byte
}

Output 生成结果

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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