maker_protobuf

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TDPBDefineSTBuiltin = `` /* 208-byte string literal not displayed */
View Source
const TDPBProtoFileBuiltin = `` /* 273-byte string literal not displayed */

Variables

View Source
var (
	ArrTemplateDataDefine = []*generator.TemplateDataDefine{
		{Name: "TmplDataPBDefineST", Sample: &TmplDataPBDefineST{}},
		{Name: "TmplDataPBDefineSTField", Sample: &TmplDataPBDefineSTField{}},
		{Name: "TmplDataPBProtoFile", Sample: &TmplDataPBProtoFile{}},
	}
)
View Source
var TDPBDefineST = &generator.TemplateDefine{
	Name:     "TDPBDefineST",
	Filepath: "protobuf_define_st.tmpl",

	BuiltinTemplateText: TDPBDefineSTBuiltin,
}
View Source
var TDPBProtoFile = &generator.TemplateDefine{
	Name:                "TDPBProtoFile",
	Filepath:            "protobuf_proto_file.tmpl",
	WantTemplateData:    "TmplDataPBProtoFile",
	BuiltinTemplateText: TDPBProtoFileBuiltin,
}

Functions

func GenDefineSTCode added in v0.3.0

func GenDefineSTCode(pSet *generator.PrototypeSet, td *TmplDataPBDefineST, df *generator.DefineST) (string, error)

func GenProtoFile added in v0.3.0

func GenProtoFile(pSet *generator.PrototypeSet, origFn string) (string, error)

func GenSetForProto

func GenSetForProto(pSet *generator.PrototypeSet) ([]string, error)

func PrepareTmplDataDefineST added in v0.3.0

func PrepareTmplDataDefineST(pSet *generator.PrototypeSet, td *TmplDataPBDefineST, pf *generator.DefineST) error

func PrepareTmplDataDefineSTField added in v0.3.0

func PrepareTmplDataDefineSTField(pSet *generator.PrototypeSet, td *TmplDataPBDefineSTField, pf *generator.DefineSTField) error

func PrepareTmplDataProtoFile added in v0.3.0

func PrepareTmplDataProtoFile(pSet *generator.PrototypeSet, td *TmplDataPBProtoFile, pf *generator.File) error

Types

type Context added in v0.3.0

type Context struct {
	Dir     string `json:"dir"`
	Package string `json:"package"`

	PBOptions map[string]string `json:"pbOptions"`

	PBOuterImport map[string]string `json:"pbOuterImport"`

	PBPlugins []string `json:"pbPlugins"`
}
var GenCtx *Context

type PBOption added in v0.3.0

type PBOption struct {
	Sequence int
	NotNull  bool
}

func ParsePBOption added in v0.3.0

func ParsePBOption(str string) (*PBOption, error)

type TmplDataPBDefineST added in v0.3.0

type TmplDataPBDefineST struct {
	*generator.TmplDataDefineST

	SuperProtoFile *TmplDataPBProtoFile

	PBFields []*TmplDataPBDefineSTField
}

type TmplDataPBDefineSTField added in v0.3.0

type TmplDataPBDefineSTField struct {
	*generator.TmplDataDefineSTField

	SuperDefineST *TmplDataPBDefineST

	PBSequence int
}

type TmplDataPBProtoFile added in v0.3.0

type TmplDataPBProtoFile struct {
	*generator.TmplDataProtoFile

	PBImport  []string
	PBPackage string
	PBOptions map[string]string

	PBDefineSTCode []string
}

Jump to

Keyboard shortcuts

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