func Search(name string, prioritySearchPaths ...string) (realPath string, err error)
func ExampleSearch() {
// init
var (
fileName = "gflie_example.txt"
tempDir = gfile.TempDir("gfile_example_search")
tempFile = gfile.Join(tempDir, fileName)
)
// write contents
gfile.PutContents(tempFile, "goframe example content")
// search file
realPath, _ := gfile.Search(fileName, tempDir)
fmt.Println(gfile.Basename(realPath))
// Output:
// gflie_example.txt
}
基本介绍通用时间管理模块,封装了常用的时间/日期相关的方法,作为标准库time的功能性扩展,提供了更多的功能特性。支持自...
基本介绍主要用于嵌入到用户自定义的结构体中,并且通过标签的形式给gmeta包的结构体打上自定义的标签内容(元数据),并在...
请求输入依靠ghttp.Request对象实现,ghttp.Request继承了底层的http.Request对象。ghttp.Request包含一个与当...
GoFrame提供了优雅的中间件请求控制方式,该方式也是主流的WebServer提供的请求流程控制方式,基于中间件设计可以为We...
动态分页是通过GET参数(通过QueryString)传递分页参数,默认分页参数名称为page。示例如下:package mainimport ("g...
对于比较大型的应用,更好的做法是使用包管理代码,而不是模块来管理代码。 这非常简单,设想一个如下结构的应用:/yourapplicati...
考虑一个包含 FileField 的表单:from django import formsclass UploadFileForm(forms.Form):title = forms.CharField(max_...
例如:在最基本的层面上,使用 filter 和 exclude 在数据库中进行过滤。使用 F 表达式 根据同一模型中的其他字段进...
模型准确且唯一的描述了数据。它包含您储存的数据的重要字段和行为。一般来说,每一个模型都映射一张数据库表。基础:每个模型都...