adopt

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const KitexGenPath = "kitex_gen"

Variables

This section is empty.

Functions

func AdoptHz

func AdoptHz(gen *protogen.Plugin) error

func AdoptKitex

func AdoptKitex(gen *protogen.Plugin) error

func BaseName

func BaseName(include, subFixToTrim string) string

BaseName get base name for path. ex: "github.com/p.s.m" => "p.s.m"

func GetGOPATH

func GetGOPATH() (string, error)

GetGOPATH retrieves the GOPATH from environment variables or the `go env` command.

func ImportToPath

func ImportToPath(path, subFix string) string

func ImportToPathAndConcat

func ImportToPathAndConcat(path, subFix string) string

func IsWindows

func IsWindows() bool

func PathToImport

func PathToImport(path, subFix string) string

func SearchGoMod

func SearchGoMod(cwd string) (moduleName, path string, found bool)

SearchGoMod searches go.mod from the given directory (which must be an absolute path) to the root directory. When the go.mod is found, its module name and path will be returned.

Types

type HzAdopter

type HzAdopter struct {
	Gen      *protogen.Plugin
	OutDir   string
	GoModule string
	ModelDir string
}

func (*HzAdopter) Init

func (ad *HzAdopter) Init()

func (*HzAdopter) ModifyGoPackage

func (ad *HzAdopter) ModifyGoPackage(req *pluginpb.CodeGeneratorRequest)

func (*HzAdopter) SetGoModule

func (ad *HzAdopter) SetGoModule()

type KitexAdopter

type KitexAdopter struct {
	Gen           *protogen.Plugin
	ModuleName    string
	PackagePrefix string
}

func (*KitexAdopter) Init

func (ad *KitexAdopter) Init() error

func (*KitexAdopter) ModifyGoPackage

func (ad *KitexAdopter) ModifyGoPackage(req *pluginpb.CodeGeneratorRequest) error

Jump to

Keyboard shortcuts

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