importpath

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImportPathMockGetByCurrentDirProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockCommonProxyContext
		pctx.MethodName = "GetByCurrentDir"
		return
	}()
	ImportPathMockGetCurrentDirModFilePathProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockCommonProxyContext
		pctx.MethodName = "GetCurrentDirModFilePath"
		return
	}()
	ImportPathMockGetModFilePathProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockCommonProxyContext
		pctx.MethodName = "GetModFilePath"
		return
	}()
	ImportPathMockSplitImportPathWithTypeProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockCommonProxyContext
		pctx.MethodName = "SplitImportPathWithType"
		return
	}()
)
View Source
var (
	ImportPathMockMockGetByCurrentDirProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockMockCommonProxyContext
		pctx.MethodName = "GetByCurrentDir"
		return
	}()
	ImportPathMockMockGetCurrentDirModFilePathProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockMockCommonProxyContext
		pctx.MethodName = "GetCurrentDirModFilePath"
		return
	}()
	ImportPathMockMockGetModFilePathProxyContext = func() (pctx inject.ProxyContext) {
		pctx = importPathMockMockCommonProxyContext
		pctx.MethodName = "GetModFilePath"
		return
	}()
)

Functions

func RegisterProxyMethod added in v0.12.0

func RegisterProxyMethod(pctx inject.ProxyContext, cf inject.CtxFunc)

Types

type IImportPath

type IImportPath interface {
	GetByCurrentDir() (path string, err error)
	GetCurrentDirModFilePath() (modDir string, modPath string, err error)
	GetModFilePath(dir string) (modDir string, modPath string, err error)
	SplitImportPathWithType(importPathWithType string) (string, string)
}

type IImportPathMock added in v0.5.0

type IImportPathMock interface {
	GetByCurrentDir() (path string, err error)
	GetCurrentDirModFilePath() (modDir string, modPath string, err error)
	GetModFilePath(dir string) (modDir string, modPath string, err error)
}

type ImportPath

type ImportPath struct {
}

func (*ImportPath) FindAllModule added in v0.15.2

func (p *ImportPath) FindAllModule(dir string) (mods []Module, err error)

FindAllModule 寻找目录下的所有module

func (*ImportPath) GetByCurrentDir

func (p *ImportPath) GetByCurrentDir() (path string, err error)

GetCurrentDirPath 获取当前目录的包导入路径

func (*ImportPath) GetCurrentDirModFilePath

func (p *ImportPath) GetCurrentDirModFilePath() (modDir, modPath string, err error)

func (*ImportPath) GetModFilePath

func (p *ImportPath) GetModFilePath(dir string) (modDir, modPath string, err error)

func (*ImportPath) SplitImportPathWithType added in v0.5.0

func (p *ImportPath) SplitImportPathWithType(importPathWithType string) (string, string)

type ImportPathMock added in v0.5.0

type ImportPathMock struct {
	GetByCurrentDirFunc func() (path string, err error)

	GetCurrentDirModFilePathFunc func() (modDir string, modPath string, err error)

	GetModFilePathFunc func(dir string) (modDir string, modPath string, err error)

	SplitImportPathWithTypeFunc func(importPathWithType string) (string, string)
}

func (*ImportPathMock) GetByCurrentDir added in v0.5.0

func (mockRecv *ImportPathMock) GetByCurrentDir() (path string, err error)

func (*ImportPathMock) GetCurrentDirModFilePath added in v0.5.0

func (mockRecv *ImportPathMock) GetCurrentDirModFilePath() (modDir string, modPath string, err error)

func (*ImportPathMock) GetModFilePath added in v0.5.0

func (mockRecv *ImportPathMock) GetModFilePath(dir string) (modDir string, modPath string, err error)

func (*ImportPathMock) SplitImportPathWithType added in v0.5.0

func (mockRecv *ImportPathMock) SplitImportPathWithType(importPathWithType string) (string, string)

type ImportPathMockMock added in v0.5.0

type ImportPathMockMock struct {
	GetByCurrentDirFunc func() (path string, err error)

	GetCurrentDirModFilePathFunc func() (modDir string, modPath string, err error)

	GetModFilePathFunc func(dir string) (modDir string, modPath string, err error)
}

func (*ImportPathMockMock) GetByCurrentDir added in v0.5.0

func (mockRecv *ImportPathMockMock) GetByCurrentDir() (path string, err error)

func (*ImportPathMockMock) GetCurrentDirModFilePath added in v0.5.0

func (mockRecv *ImportPathMockMock) GetCurrentDirModFilePath() (modDir string, modPath string, err error)

func (*ImportPathMockMock) GetModFilePath added in v0.5.0

func (mockRecv *ImportPathMockMock) GetModFilePath(dir string) (modDir string, modPath string, err error)

type Module added in v0.15.2

type Module struct {
	modfile.Module

	RelDir string
}

Jump to

Keyboard shortcuts

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