Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeGen ¶
type CodeGen struct { Messages []*Message // required, proto Message ByName string // required, 生成名称 Version string // required, 生成版本 PackageName string // required, proto 包名 Options map[string]string // required, proto option Style string // 字段代码风格, snakeCase, smallCamelCase, camelCase DisableDocComment bool // 禁用doc注释 DisableBool bool // 禁用bool,使用int32 DisableTimestamp bool // 禁用google.protobuf.Timestamp,使用int64 EnableOpenapiv2Annotation bool // 启用int64的openapiv2注解 // contains filtered or unexported fields }
func (*CodeGen) Print ¶
Print formats using the default formats for its operands and writes to the generated output. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered.
func (*CodeGen) Printf ¶
Printf formats according to a format specifier for its operands and writes to the generated output. It returns the number of bytes written and any write error encountered.
type Message ¶
type Message struct { Name string // 名称, camel case TableName string // 表名, snake name Comment string // 注释 Fields []*MessageField // 字段 }
type MessageField ¶
type MessageField struct { Cardinality protoreflect.Cardinality // optional, required, or repeated Type protoreflect.Kind // 类型 TypeName string // 类型名称, 如果Type=protoreflect.MessageKind时 Name string // 名称, snake or small camel case ColumnName string // 列名, snake case Comment string // 注释 }
Click to show internal directories.
Click to hide internal directories.