Versions in this module Expand all Collapse all v2 v2.0.2 Jan 16, 2024 Changes in this version + const CmdGenerateGetRevertID + const CmdGenerateImplement + const CmdGenerateInterface + func AsCommentLines(comment string) string + func BasicType(schemaType string, format string, ipt *importer.PackageImporter) string + func GetEnumByServiceName(serviceName string) map[string]enumeration.Enum + func PathFromSwaggerPath(str string) string + func RefName(ref oas.Refer) string + func RegisterEnum(serviceName string, tpe string, options ...enumeration.EnumOption) + func RequestOf(id string) string + func ResponseOf(id string) string + type Annotation interface + Extension func() string + ID func() string + Importer func() *importer.PackageImporter + Run func(cmd string, op Op) string + SetArgs func(args ...string) + func NewAnnotationRevert(id, extension string) Annotation + type AnnotationRevert struct + func (a *AnnotationRevert) Extension() string + func (a *AnnotationRevert) ID() string + func (a *AnnotationRevert) Importer() *importer.PackageImporter + func (a *AnnotationRevert) Run(cmd string, op Op) string + func (a *AnnotationRevert) SetArgs(args ...string) + type Field struct + Comment string + Name string + Tags Tags + Type string + func NewField(name string) *Field + func (f *Field) AddTag(tagKey, tagValue string, flags ...string) + func (f *Field) Anonymous() bool + func (f *Field) String() string + type Op interface + Annotation func() map[string]Annotation + CanRevert func() bool + HasRequest func() bool + ID func() string + Method func() string + Path func() string + RevertIDField func() string + RevertTarget func() string + WriteReqType func(w io.Writer, ipt *importer.PackageImporter) error + WriteRespBodyType func(w io.Writer, ipt *importer.PackageImporter) error + type Operation struct + func NewOperation(serviceName string, method string, path string, operation *oas.Operation, ...) *Operation + func (o *Operation) Annotation() map[string]Annotation + func (o *Operation) CanRevert() bool + func (o *Operation) HasRequest() bool + func (o *Operation) ID() string + func (o *Operation) Method() string + func (o *Operation) Path() string + func (o *Operation) RevertIDField() string + func (o *Operation) RevertTarget() string + func (o *Operation) WriteReqType(w io.Writer, ipt *importer.PackageImporter) error + func (o *Operation) WriteRespBodyType(w io.Writer, ipt *importer.PackageImporter) error + type Tag struct + Flags map[string]bool + Key string + Value string + func NewTag(key, value string) *Tag + func (tag *Tag) String() string + func (tag Tag) WithFlags(flags ...string) *Tag + type Tags map[string]*Tag + func (tags Tags) String() string + type TypeGenerator struct + Importer *importer.PackageImporter + ServiceName string + func NewTypeGenerator(serviceName string, ipt *importer.PackageImporter) *TypeGenerator + func (g *TypeGenerator) FieldFrom(name string, propSchema *oas.Schema, requiredFields ...string) *Field + func (g *TypeGenerator) PrefixType(tpe string) string + func (g *TypeGenerator) Type(schema *oas.Schema) (string, bool) + func (g *TypeGenerator) TypeIndirect(schema *oas.Schema) (string, bool) + func (g *TypeGenerator) WriteFields(w io.Writer, schema *oas.Schema) error Other modules containing this package gitee.com/eden-framework/eden-framework