Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidTranscriptTags = errors.New("do not contains json tag in transcriptTagNames")
ErrInvalidTranscriptTags means invalid transcriptTag included.
Functions ¶
This section is empty.
Types ¶
type BuildField ¶
type BuildField struct {
Name string
Embed bool
Tag *BuildTag
TranscriptTags []string
// contains filtered or unexported fields
}
BuildField represents field of BuildStruct.
func (*BuildField) IsArray ¶
func (f *BuildField) IsArray() bool
IsArray returns field type is array.
func (*BuildField) IsArrayPtr ¶
func (f *BuildField) IsArrayPtr() bool
IsArrayPtr returns field type is array of pointer.
func (*BuildField) IsPtrArray ¶
func (f *BuildField) IsPtrArray() bool
IsPtrArray returns field type is pointer array.
func (*BuildField) IsPtrArrayPtr ¶
func (f *BuildField) IsPtrArrayPtr() bool
IsPtrArrayPtr returns field type is pointer of pointer array.
func (*BuildField) WithJWG ¶
func (f *BuildField) WithJWG() bool
WithJWG returns is field jwg annotated type.
type BuildSource ¶
type BuildSource struct {
Structs []*BuildStruct
// contains filtered or unexported fields
}
BuildSource represents source code of assembling..
func Parse ¶
func Parse(pkg *genbase.PackageInfo, typeInfos genbase.TypeInfos, opts *ParseOptions) (*BuildSource, error)
Parse construct *BuildSource from package & type information.
type BuildStruct ¶
type BuildStruct struct {
Fields []*BuildField
// contains filtered or unexported fields
}
BuildStruct represents struct of assembling..
type BuildTag ¶
type BuildTag struct {
Name string
Ignore bool // e.g. Secret string `json:"-"`
OmitEmpty bool // e.g. Field int `json:",omitempty"`
ShouldEmit bool // e.g. Field int `json:",shouldemit"` shouldemit is not official supported tag.
String bool // e.g. Int64String int64 `json:",string"`
// contains filtered or unexported fields
}
BuildTag represents tag of BuildField.
type ParseOptions ¶
type ParseOptions struct {
TranscriptTagNames []string
NoOmitempty bool
NoOmitemptyFieldTypes []string
}
ParseOptions means options to Parse function.
Click to show internal directories.
Click to hide internal directories.