api

package
v0.0.0-...-488a63d Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeGenerator

type CodeGenerator struct {
	TsIndexTemplate   string
	TsPackageTemplate string
	TsconfigTemplate  string
	TsReadmeTemplate  string

	JsIndexTsTemplate string
	JsIndexTemplate   string
	JsPackageTemplate string
	JsReadMeTemplate  string

	Outpath string
	ApiSpec Spec
}

func (*CodeGenerator) GenEsCode

func (c *CodeGenerator) GenEsCode()

func (*CodeGenerator) GenTsCode

func (c *CodeGenerator) GenTsCode()

type Field

type Field struct {
	Name      string
	Type      string
	Documents string
	Doc       string
	Validate  string
	// contains filtered or unexported fields
}

type Info

type Info struct {
	Title   string
	Desc    string
	Author  string
	Email   string
	Version string
}

type Route

type Route struct {
	FuncName   string
	Method     string
	Request    string
	ReqType    Type
	Response   string
	ResType    Type
	Path       string
	Doc        string
	Comment    string
	ValidToken bool
}

type Spec

type Spec struct {
	Documents  string
	Comment    string
	Info       Info
	ApiName    string
	Types      []Type
	ServiceDoc string
	Route      []Route
}

func ToSpec

func ToSpec(spec *ast.Spec) Spec

type Type

type Type struct {
	Name      string
	Fields    []Field
	Documents string
	Doc       string
}

func (Type) IsJSON

func (t Type) IsJSON() bool

Jump to

Keyboard shortcuts

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