Documentation
¶
Index ¶
- func New() pkgenerator.Plugin
- type FieldBuilder
- type FieldSet
- func (x *FieldSet) Alias() string
- func (x *FieldSet) FieldIsInline() bool
- func (x *FieldSet) GoName() string
- func (x *FieldSet) ID() string
- func (x *FieldSet) IsOneOfField() bool
- func (x *FieldSet) OneOfField() *FieldSet
- func (x *FieldSet) OneOfIsInline() bool
- func (x *FieldSet) ParentField() *FieldSet
- func (x *FieldSet) Value() string
- type IdGenerator
- type InlineSet
- type Marshal
- type OneOfSet
- type Plugin
- type Unmarshal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() pkgenerator.Plugin
Types ¶
type FieldBuilder ¶
type FieldBuilder struct {
// contains filtered or unexported fields
}
FieldBuilder for load the proto field into the fieldSet.
type FieldSet ¶
type FieldSet struct { // Field represents the origin object in the protogen. Field *protogen.Field // Options represents the Options for field. Options *pbjson.FieldOptions // JSONKey represents the keyword in JSON format. JSONKey string // And the value is not nil means the field type if oneof. OneOfSet *OneOfSet // IsOneOfPart represents whether the field is part member in an oneof field. IsOneOfPart bool // InlineSet the value is not nil means the field is inline. InlineSet *InlineSet // Parent represents the field to which the inline message belongs or the oneof field for oneof part. Parent *FieldSet // Level is the level of the message to which the field belongs. Level int // Number is the unique number for this field. Number int64 }
func (*FieldSet) FieldIsInline ¶
FieldIsInline indicates whether directly expanded in current ares.
func (*FieldSet) IsOneOfField ¶
IsOneOfField return the field whether is oneof.
func (*FieldSet) OneOfField ¶
func (*FieldSet) OneOfIsInline ¶
func (*FieldSet) ParentField ¶
type IdGenerator ¶
type IdGenerator struct {
// contains filtered or unexported fields
}
IdGenerator for generate a unique id for every field.
func (*IdGenerator) Take ¶
func (x *IdGenerator) Take() int64
type InlineSet ¶
type InlineSet struct { // Childs represents the list of fields which inline to the message. Childs []*FieldSet }
type Marshal ¶
type Marshal struct {
// contains filtered or unexported fields
}
func (*Marshal) GenerateCode ¶
type OneOfSet ¶
type OneOfSet struct { // Options represents the Options for oneof. Options *pbjson.OneofOptions // Parts represents the list of fields which location in the oneof field. Parts []*FieldSet }
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin for implements pgkgenerator.Plugin
func (*Plugin) Generate ¶
func (p *Plugin) Generate(g *protogen.GeneratedFile)
Generate to generate codes for specified file. except for the imports, by calling the generator's methods P, In, and Out.
func (*Plugin) Init ¶
Init is called once before code generated. The `file` will be ignored if return false.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.