gen

package
v0.0.0-...-7cad488 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageFunctions

func PackageFunctions(pkgDir, genFilename, namePrefix string, printOnly bool, jsonTypeReplacements map[string]string, onlyFuncs ...string) error

func RewriteAstFile

func RewriteAstFile(fset *token.FileSet, filePkg *ast.Package, astFile *ast.File, filePath string, verbose bool, printTo io.Writer, jsonTypeReplacements map[string]string, localImportPrefixes []string) (err error)

func RewriteDir

func RewriteDir(path string, verbose bool, printOnly io.Writer, jsonTypeReplacements map[string]string, localImportPrefixes []string) (err error)

func RewriteFile

func RewriteFile(filePath string, verbose bool, printOnly io.Writer, jsonTypeReplacements map[string]string, localImportPrefixes []string) (err error)

Types

type Impl

type Impl int
const (
	ImplDescription Impl = 1 << iota
	ImplCallWrapper
	ImplCallWithStringsWrapper
	ImplCallWithNamedStringsWrapper
	ImplCallWithJSONWrapper

	ImplWrapper = ImplDescription | ImplCallWrapper | ImplCallWithStringsWrapper | ImplCallWithNamedStringsWrapper | ImplCallWithJSONWrapper
)

func ImplFromString

func ImplFromString(str string) (Impl, error)

func (Impl) String

func (impl Impl) String() string

func (Impl) WriteFunctionWrapper

func (impl Impl) WriteFunctionWrapper(w io.Writer, funcFile *ast.File, funcDecl *ast.FuncDecl, implType, funcPackage string, neededImportLines map[string]struct{}, jsonTypeReplacements map[string]string) error

Jump to

Keyboard shortcuts

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