generator

package
v0.0.0-...-b00e0b0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DocBaseURL = "https://cloud.tencent.com"

Variables

This section is empty.

Functions

func GenerateAllClients

func GenerateAllClients()

func IsArrayType

func IsArrayType(tpe string) bool

Types

type API

type API struct {
	Service    *string
	Name       string
	Version    string
	Desc       string
	DocURL     string
	Parameters *TypeSchema
	Response   *TypeSchema
}

func NewAPI

func NewAPI(service *string, name string, desc string, docUrl string) *API

func (*API) AddParameter

func (api *API) AddParameter(name string, tpe *TypeSchema)

func (*API) AddResponseProp

func (api *API) AddResponseProp(name string, tpe *TypeSchema)

func (*API) Scan

func (api *API) Scan()

func (*API) ScanServiceName

func (api *API) ScanServiceName()

func (*API) Write

func (api *API) Write(file *codegen.File)

func (*API) WriteInvoke

func (api *API) WriteInvoke(file *codegen.File)

type APIDoc

type APIDoc struct {
	*APIDocEntries
	Service   string
	APIs      map[string]*API
	DataTypes map[string]*TypeSchema
}

func NewAPIDoc

func NewAPIDoc(apiDocEntries *APIDocEntries) *APIDoc

func (*APIDoc) Scan

func (doc *APIDoc) Scan()

func (*APIDoc) SyncAndWriteFiles

func (doc *APIDoc) SyncAndWriteFiles()

func (*APIDoc) WriteAPIs

func (doc *APIDoc) WriteAPIs()

func (*APIDoc) WriteDataTypes

func (doc *APIDoc) WriteDataTypes()

type APIDocEntries

type APIDocEntries struct {
	ContentsURL  string
	DataTypesURL string
}

type BasicType

type BasicType string
const (
	BasicTypeDate      BasicType = "Date"
	BasicTypeTimestamp BasicType = "Timestamp"
	BasicTypeString    BasicType = "String"
	BasicTypeInteger   BasicType = "Integer"
	BasicTypeBoolean   BasicType = "Boolean"
	BasicTypeFloat     BasicType = "Float"
)

func IndirectType

func IndirectType(tpe string) (basicType *BasicType)

type TypeSchema

type TypeSchema struct {
	ImportPath     string
	Name           string
	Desc           string
	Type           *BasicType
	Items          *TypeSchema
	AdditionalProp *TypeSchema
	AllOf          []*TypeSchema
	Props          map[string]*TypeSchema
	Required       bool
	Tag            string
}

func (*TypeSchema) AddProp

func (s *TypeSchema) AddProp(name string, propSchema *TypeSchema)

func (*TypeSchema) IsArray

func (s *TypeSchema) IsArray() bool

func (*TypeSchema) IsMap

func (s *TypeSchema) IsMap() bool

func (*TypeSchema) IsObject

func (s *TypeSchema) IsObject() bool

func (*TypeSchema) IsRef

func (s *TypeSchema) IsRef() bool

func (*TypeSchema) SnippetType

func (s *TypeSchema) SnippetType(file *codegen.File) codegen.SnippetType

func (*TypeSchema) Write

func (s *TypeSchema) Write(file *codegen.File)

Jump to

Keyboard shortcuts

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