adapter

package
v0.77.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generate contract for API that use interface or functions style

func New

func New() *Generator

func (*Generator) Generate

func (g *Generator) Generate(source, typeName string, predicate func(receiver *toolbox.FunctionInfo) bool, metaUpdater func(metaType *TypeMeta, receiver *toolbox.FunctionInfo)) (*string, error)

Generate generates code

func (*Generator) GenerateMatched

func (g *Generator) GenerateMatched(source string, matcher func(typeName string) bool, predicate func(receiver *toolbox.FunctionInfo) bool, metaUpdater func(metaType *TypeMeta, receiver *toolbox.FunctionInfo)) (map[string]string, error)

GenerateMatched generated code for all matched types

type TypeMeta

type TypeMeta struct {
	ID              string
	OwnerPackage    string
	OwnerType       string
	SimpleOwnerType string

	TypeName   string
	SourceType string
	Imports    string
	Methods    string
	Fields     string
	Func       string
	Params     string
	Result     string
	Embed      bool
	// 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