sdk

package
v0.0.0-...-ccd8cf7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const GinctlV100ReleaseTime = "g202105261512"
View Source
const TabIndentWith4Space = "    "
View Source
const TabIndentWith8Space = "        "

Variables

This section is empty.

Functions

func GenerateBase

func GenerateBase(path, output, dir string, log log.Logger) error

func GenerateClientFactory

func GenerateClientFactory(pkgList, serviceList []string, output string, isPublish bool, isOld bool)

Types

type APIDecl

type APIDecl struct {
	// contains filtered or unexported fields
}

type Constant

type Constant struct {
	Name  string
	Group []string
	Value ConstantValue
}

type ConstantValue

type ConstantValue struct {
	// contains filtered or unexported fields
}

type Field

type Field struct {
	Name string
	Type string
	Tag  string

	StructFields []*Field
	Comment      string
	// contains filtered or unexported fields
}

type Generator

type Generator struct {
	*bytes.Buffer

	FileName string
	APIName  string

	APIDecls map[string]*APIDecl

	RequestDecls  []*StructType
	ResponseDecls []*StructType
	GeneralDecls  []*StructType

	Log log.Logger

	Constants []*Constant
	ImportMap map[string]string
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(opts ...Option) *Generator

func (*Generator) GenGO

func (g *Generator) GenGO()

func (*Generator) GenPHP

func (g *Generator) GenPHP()

func (*Generator) P

func (g *Generator) P(str ...string)

func (*Generator) Parse

func (g *Generator) Parse(file string) error

type Option

type Option func(g *Generator)

func WithLogger

func WithLogger(log log.Logger) Option

func WithOld

func WithOld(old bool) Option

func WithPublish

func WithPublish(publish bool) Option

func WithWorkDir

func WithWorkDir(dir string) Option

type StructType

type StructType struct {
	Name   string
	Fields []*Field

	Pos token.Pos
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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