finder

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Finder = New()

默认

Functions

This section is empty.

Types

type ExtensionsArray

type ExtensionsArray = []string

后缀

type HintsMap

type HintsMap = map[string][]string

命中

type PathsArray

type PathsArray = []string

路径

type ViewFinder

type ViewFinder struct {
	// 分隔符 "::"
	HintPathDelimiter string

	// 路径
	Paths PathsArray

	// 试图
	Views ViewsMap

	// 命中
	Hints HintsMap

	// 后缀
	Extensions ExtensionsArray
}

*

  • 视图 *
  • @create 2022-1-1
  • @author deatil

func New

func New() *ViewFinder

构造函数

func (*ViewFinder) AddExtension

func (this *ViewFinder) AddExtension(extension string) *ViewFinder

添加后缀

func (*ViewFinder) AddLocation

func (this *ViewFinder) AddLocation(location string) *ViewFinder

添加

func (*ViewFinder) AddNamespace

func (this *ViewFinder) AddNamespace(namespace string, hints []string) *ViewFinder

添加命名空间

func (*ViewFinder) FileExist

func (this *ViewFinder) FileExist(filename string) bool

文件判断是否存在

func (*ViewFinder) Find

func (this *ViewFinder) Find(name string) string

查找视图

func (*ViewFinder) FindInPaths

func (this *ViewFinder) FindInPaths(name string, paths []string) string

在目录里查找文件

func (*ViewFinder) FindNamespacedView

func (this *ViewFinder) FindNamespacedView(name string) string

查找命名空间视图

func (*ViewFinder) Flush

func (this *ViewFinder) Flush() *ViewFinder

清空

func (*ViewFinder) GetExtensions

func (this *ViewFinder) GetExtensions() ExtensionsArray

获取后缀

func (*ViewFinder) GetHints

func (this *ViewFinder) GetHints() HintsMap

获取命中

func (*ViewFinder) GetPossibleViewFiles

func (this *ViewFinder) GetPossibleViewFiles(name string) []string

添加

func (*ViewFinder) GetViews

func (this *ViewFinder) GetViews() ViewsMap

获取试图

func (*ViewFinder) HasHintInformation

func (this *ViewFinder) HasHintInformation(name string) bool

判断是否有分隔符

func (*ViewFinder) NormalizeName

func (this *ViewFinder) NormalizeName(name string) string

重设

func (*ViewFinder) ParseNamespaceSegments

func (this *ViewFinder) ParseNamespaceSegments(name string) []string

解析命名空间

func (*ViewFinder) PrependLocation

func (this *ViewFinder) PrependLocation(location string) *ViewFinder

prependLocation

func (*ViewFinder) PrependNamespace

func (this *ViewFinder) PrependNamespace(namespace string, hints []string) *ViewFinder

添加命名空间到前面

func (*ViewFinder) ReplaceNamespace

func (this *ViewFinder) ReplaceNamespace(namespace string, hints []string) *ViewFinder

替换命名空间

func (*ViewFinder) ResolvePath

func (this *ViewFinder) ResolvePath(path string) string

重设路径

type ViewsMap

type ViewsMap = map[string]string

试图

Jump to

Keyboard shortcuts

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