udwGoWriter

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustWriteObjectToMainPackage

func MustWriteObjectToMainPackage(obj interface{}) string

func WriteGoFileGetterWithDirFileList

func WriteGoFileGetterWithDirFileList(req WriteGoFileGetterWithDirFileListRequest)

func WriteGoFileGetterWithGlobalVariable

func WriteGoFileGetterWithGlobalVariable(req WriteGoFileGetterRequest)

func WriteIfStatmentToBuf

func WriteIfStatmentToBuf(_buf *bytes.Buffer, ifExpr string, bodyFn func())

func WriteStringToGolang

func WriteStringToGolang(s string) string

func WriteTestWrapFunction

func WriteTestWrapFunction(req WriteTestWrapFunctionReq)

Types

type GoFileContext

type GoFileContext struct {
	Buf bytes.Buffer
	// contains filtered or unexported fields
}

func NewGoFileContext

func NewGoFileContext(PkgImportPath string) *GoFileContext

func (*GoFileContext) AddImportPath

func (gotpl *GoFileContext) AddImportPath(importPath string)

func (*GoFileContext) AddImportPathList

func (gotpl *GoFileContext) AddImportPathList(importPathList []string)

func (*GoFileContext) AddImportPathWithAlias

func (gotpl *GoFileContext) AddImportPathWithAlias(importPath string, alias string)

func (*GoFileContext) AddUnderScoreImportPath

func (gotpl *GoFileContext) AddUnderScoreImportPath(importPath string)

func (*GoFileContext) GetPkgImportPath

func (gotpl *GoFileContext) GetPkgImportPath() string

func (*GoFileContext) MergeFile

func (gotpl *GoFileContext) MergeFile(gotpl1 *GoFileContext) *GoFileContext

func (*GoFileContext) MustWriteFile

func (gotpl *GoFileContext) MustWriteFile(_filepath string, body []byte)

func (*GoFileContext) MustWriteFileWithSelfBuffer

func (gotpl *GoFileContext) MustWriteFileWithSelfBuffer(_filepath string)

func (*GoFileContext) MustWriteGoTypePackagePrefix

func (gotpl *GoFileContext) MustWriteGoTypePackagePrefix(pkgImportPath string) string

func (*GoFileContext) MustWriteGoTypes

func (gotpl *GoFileContext) MustWriteGoTypes(objTyp udwGoParser.Type) string

func (*GoFileContext) MustWriteGoTypesV2

func (gotpl *GoFileContext) MustWriteGoTypesV2(typ types.Type) string

func (*GoFileContext) MustWriteObject

func (file *GoFileContext) MustWriteObject(obj interface{}) string

func (*GoFileContext) MustWriteObjectToBuf

func (file *GoFileContext) MustWriteObjectToBuf(obj interface{}, _buf *bytes.Buffer)

func (*GoFileContext) MustWriteObjectToSelfBuf

func (file *GoFileContext) MustWriteObjectToSelfBuf(obj interface{})

func (*GoFileContext) MustWriteTypeByReflect

func (file *GoFileContext) MustWriteTypeByReflect(typ reflect.Type) string

func (*GoFileContext) SetBuildFlagContent

func (gotpl *GoFileContext) SetBuildFlagContent(content string)

func (*GoFileContext) SetBuildFlagList

func (gotpl *GoFileContext) SetBuildFlagList(flagList []string)

type WriteGoFileGetterRequest

type WriteGoFileGetterRequest struct {
	PackageName  string
	FunctionName string
	Obj          interface{}

	GoFilePath                  string
	BuildFlag                   string
	ObjTypeByteSliceHexEncoding bool
}

type WriteGoFileGetterWithDirFileListRequest

type WriteGoFileGetterWithDirFileListRequest struct {
	PackageName  string
	FunctionName string
	RootFileDir  string

	GoFilePath string
	BuildFlag  string
}

type WriteTestWrapFunctionReq

type WriteTestWrapFunctionReq struct {
	PkgPath  string
	FuncName string
	FuncBody []byte
	GoFile   *GoFileContext
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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