extract

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMongoModelImports

func AddMongoModelImports(data string, impt []string) (string, error)

func GetFileName

func GetFileName(structName, prefix string) (fileMongoName, fileIfName string)

func GetPkgName

func GetPkgName(structName string) string

Types

type IdlExtractStruct

type IdlExtractStruct struct {
	Name          string
	StructFields  []*StructField
	InterfaceInfo *InterfaceInfo
	UpdateInfo
}

type InterfaceInfo

type InterfaceInfo struct {
	Name    string
	Methods []*InterfaceMethod
}

type InterfaceMethod

type InterfaceMethod struct {
	Name             string
	ParsedTokens     string
	Params           code.Params
	Returns          code.Returns
	BelongedToStruct *IdlExtractStruct
}

type PbUsedInfo

type PbUsedInfo struct {
	DocArgs *config.DocArgument

	ImportPaths []string
	// contains filtered or unexported fields
}

func (*PbUsedInfo) GeneratePbFile

func (info *PbUsedInfo) GeneratePbFile() error

func (*PbUsedInfo) ParsePbIdl

func (info *PbUsedInfo) ParsePbIdl() (rawStructs []*IdlExtractStruct, err error)

type StructField

type StructField struct {
	Name               string
	Type               code.Type
	Tag                reflect.StructTag
	IsBelongedToStruct bool
	BelongedToStruct   *IdlExtractStruct
}

type ThriftUsedInfo

type ThriftUsedInfo struct {
	Req         *plugin.Request
	DocArgs     *config.DocArgument
	ImportPaths []string
}

func (*ThriftUsedInfo) ParseThriftIdl

func (info *ThriftUsedInfo) ParseThriftIdl() (rawStructs []*IdlExtractStruct, err error)

type UpdateInfo

type UpdateInfo struct {
	Update                bool
	UpdateCurdFileContent []byte
	UpdateIfFileContent   []byte
	PreMethodNamesMap     map[string]struct{}
	PreIfMethods          []*InterfaceMethod
}

Jump to

Keyboard shortcuts

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