当前位置: 首页>>代码示例>>Golang>>正文


Golang beego.SetStaticPath函数代码示例

本文整理汇总了Golang中github.com/astaxie/beego.SetStaticPath函数的典型用法代码示例。如果您正苦于以下问题:Golang SetStaticPath函数的具体用法?Golang SetStaticPath怎么用?Golang SetStaticPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetStaticPath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: init

func init() {
	beego.SetStaticPath("/js", "static/js")
	beego.SetStaticPath("/img", "static/img")
	beego.SetStaticPath("/css", "static/css")

	beego.Router("/", &controllers.MainController{})

	beego.Router("/unit/list", &controllers.UnitController{}, "get:List")
	beego.Router("/unit/create", &controllers.UnitController{}, "get:CreateHtml")
	beego.Router("/unit/create", &controllers.UnitController{}, "post:Create")
	beego.Router("/unit/:id:int/update", &controllers.UnitController{}, "get:UpdateHtml")
	beego.Router("/unit/:id:int/update", &controllers.UnitController{}, "post:Update")
	beego.Router("/unit/:id:int/run", &controllers.UnitController{}, "get:Run")
	beego.Router("/unit/:id:int/delete", &controllers.UnitController{}, "get:Delete")

	beego.Router("/dockerd/list", &controllers.DockerdController{}, "get:List")
	beego.Router("/dockerd/create", &controllers.DockerdController{}, "get:CreateHtml")
	beego.Router("/dockerd/create", &controllers.DockerdController{}, "post:Create")
	beego.Router("/dockerd/:id:int/update", &controllers.DockerdController{}, "get:Update")
	beego.Router("/dockerd/:id:int/delete", &controllers.DockerdController{}, "get:Delete")

	beego.Router("/ippool/list", &controllers.IPPoolController{}, "get:ListAll")
	beego.Router("/ippool/list/used", &controllers.IPPoolController{}, "get:ListUsed")
	beego.Router("/ippool/list/free", &controllers.IPPoolController{}, "get:ListFree")
	beego.Router("/ippool/create", &controllers.IPPoolController{}, "get:CreateHtml")
	beego.Router("/ippool/create", &controllers.IPPoolController{}, "post:Create")
	beego.Router("/ippool/:id:int/release", &controllers.IPPoolController{}, "get:Release")
	beego.Router("/ippool/:id:int/delete", &controllers.IPPoolController{}, "get:Delete")

}
开发者ID:xingskycn,项目名称:duang,代码行数:30,代码来源:router.go

示例2: main

func main() {
	tracelog.StartFile(tracelog.LevelTrace, "logs", 1)
	tracelog.Started("main", "Initializing Postgres")
	var confName string = os.Getenv("BOOKS_CONF")
	if len(confName) == 0 {
		confName = "default"
	}
	s := []string{"conf/db/", confName, ".json"}
	jsonconf, err := config.NewConfig("json", strings.Join(s, ""))
	if err != nil {
		tracelog.Errorf(err, "main", "config.NewConfig", "Failed to find config", strings.Join(s, ""))
	}
	var User string = jsonconf.String("User")
	var Pass string = jsonconf.String("Pass")
	var DBName string = jsonconf.String("DBName")
	var buffer bytes.Buffer
	buffer.WriteString("user=")
	buffer.WriteString(User)
	buffer.WriteString(" password=")
	buffer.WriteString(Pass)
	buffer.WriteString(" dbname=")
	buffer.WriteString(DBName)
	s2 := []string{"user=", User, " password=", Pass, " dbname=", DBName, " sslmode=disable"}
	orm.RegisterDriver("postgres", orm.DR_Postgres)
	orm.RegisterDataBase("default", "postgres", strings.Join(s2, ""))
	beego.SetStaticPath("/images", "static/images")
	beego.SetStaticPath("/css", "static/css")
	beego.SetStaticPath("/js", "static/js")
	beego.SetStaticPath("/fonts", "static/fonts")
	beego.SetStaticPath("/partials", "static/partials")
	beego.EnableAdmin = true
	orm.RunCommand()
	beego.Run()
}
开发者ID:tshahmuratov,项目名称:GoCRUD,代码行数:34,代码来源:main.go

示例3: main

func main() {
	beego.SessionOn = true
	beego.SetStaticPath("/img", "static/img")
	beego.SetStaticPath("/css", "static/css")
	beego.SetStaticPath("/js", "static/js")
	beego.Run()
}
开发者ID:kebikeyi,项目名称:Go_Mvc,代码行数:7,代码来源:main.go

示例4: initStatic

func initStatic() error {
	uploadPath := utils.GetConf().String("upload::root")
	err := utils.EnsurePath(uploadPath)
	if err != nil {
		return err
	}

	jobPath := uploadPath + utils.GetConf().String("upload::job")
	err = utils.EnsurePath(jobPath)
	if err != nil {
		return err
	}

	exportPath := uploadPath + utils.GetConf().String("upload::export")
	err = utils.EnsurePath(exportPath)
	if err != nil {
		return err
	}

	beego.DirectoryIndex = true
	beego.StaticDir["/public"] = "public/"
	beego.SetStaticPath("/img", "public/img")
	beego.SetStaticPath("/export", exportPath)
	beego.SetStaticPath("/"+controllers.StaticPathPhoto, uploadPath)

	return nil
}
开发者ID:zbzzbd,项目名称:beego,代码行数:27,代码来源:main.go

示例5: main

func main() {

	initialize()

	beego.Info(beego.AppName, APP_VER)

	beego.InsertFilter("/docs/images/:all", beego.BeforeRouter, routers.DocsStatic)

	if !routers.IsPro {
		beego.SetStaticPath("/static_source", "static_source")
		beego.DirectoryIndex = true
	}

	beego.SetStaticPath("/products/images", "products/images/")

	// Register routers.
	beego.Router("/", &routers.HomeRouter{})
	beego.Router("/community", &routers.CommunityRouter{})
	beego.Router("/quickstart", &routers.QuickStartRouter{})
	beego.Router("/video", &routers.VideoRouter{})
	beego.Router("/products", &routers.ProductsRouter{})
	beego.Router("/team", &routers.PageRouter{})
	beego.Router("/about", &routers.AboutRouter{})
	beego.Router("/donate", &routers.DonateRouter{})
	beego.Router("/docs/", &routers.DocsRouter{})
	beego.Router("/docs/:all", &routers.DocsRouter{})
	beego.Router("/blog", &routers.BlogRouter{})
	beego.Router("/blog/:all", &routers.BlogRouter{})

	// Register template functions.
	beego.AddFuncMap("i18n", i18n.Tr)

	beego.Run()
}
开发者ID:ningjh,项目名称:beeweb,代码行数:34,代码来源:beeweb.go

示例6: Get

func (c *MainController) Get() {
	beego.SetStaticPath("/static", "static")
	beego.SetStaticPath("/images", "images")
	beego.SetStaticPath("/css", "css")
	beego.SetStaticPath("/js", "js")

	c.TplName = "login.tpl"
}
开发者ID:honeycombcmu,项目名称:StorageService,代码行数:8,代码来源:default.go

示例7: main

func main() {
	setting.ReadConfig()
	controllers.SocialInit()
	beego.EnableAdmin = true
	beego.SetStaticPath("/static", "static")
	beego.SetStaticPath("/avatars", "avatars")
	beego.Run()
}
开发者ID:naokij,项目名称:gotalk,代码行数:8,代码来源:main.go

示例8: init

func init() {
	beego.SetStaticPath("/js", "static/js")
	beego.SetStaticPath("/css", "static/css")
	beego.SetStaticPath("/fonts", "static/fonts")
	beego.SetStaticPath("/img", "static/img")
	beego.Router("/", &controllers.MainController{})
	beego.Router("/ws", &controllers.WSController{})
}
开发者ID:ArtushGhandilyan,项目名称:Game-XO,代码行数:8,代码来源:router.go

示例9: main

func main() {
	beego.SessionOn = true
	beego.SetStaticPath("/img", "static/img")
	beego.SetStaticPath("/css", "static/css")
	beego.SetStaticPath("/js", "static/js")
	beego.SetStaticPath("/easyui", "static/easyui")
	beego.SetStaticPath("/bootstrap", "static/bootstrap")
	beego.Run()
}
开发者ID:kebikeyi,项目名称:GoodsManage,代码行数:9,代码来源:main.go

示例10: main

func main() {
	beego.SetStaticPath("/images", "static/images")
	beego.SetStaticPath("/css", "static/css")
	beego.SetStaticPath("/js", "static/js")

	beego.Router("/:shorturl:string", &controllers.RedirectController{})
	beego.Router("/", &controllers.ShortenController{})
	beego.Run()
}
开发者ID:pricees,项目名称:beego_url,代码行数:9,代码来源:main.go

示例11: init

func init() {
	beego.SetStaticPath("/views", "views")
	beego.SetStaticPath("/static", "static")

	beego.Router("/", &controllers.MainController{})
	beego.Router("/api/proxy", &controllers.ProxyController{})

	// go regexp doesn't support Negative lookahead
	beego.Router("/:word(.*)", &controllers.RedirectController{})
}
开发者ID:liuyangc3,项目名称:proxy,代码行数:10,代码来源:main.go

示例12: main

func main() {
	//	注册文件目录
	beego.SetStaticPath("UPLOADS", "UPLOADS")
	beego.SetStaticPath("EDU", "EDU")

	//	启动session
	beego.SessionOn = true

	//	注册模板函数
	RegisterFuncMap()
	beego.Run()
}
开发者ID:snicks1,项目名称:learn,代码行数:12,代码来源:main.go

示例13: init

func init() {
	orm.RegisterDriver("mysql", orm.DR_MySQL)
	dbLink := "root:" + "[email protected](192.168.2.114:3306)/sfs?charset=utf8"
	orm.RegisterDataBase("default", "mysql", dbLink)
	//orm.Debug = true
	o := orm.NewOrm()
	o.Using("default")

	beego.SetStaticPath("/img", "img")
	beego.SetStaticPath("/css", "css")
	beego.SetStaticPath("/js", "js")
}
开发者ID:zengcheng,项目名称:sfs,代码行数:12,代码来源:n.go

示例14: main

func main() {
	beego.SetStaticPath("css", "static/css")
	beego.SetStaticPath("js", "static/js")

	//初始化
	initialize()

	beego.SessionOn = true
	beego.AutoRender = false

	beego.AddFuncMap("i18n", i18n.Tr)
	beego.Run()
}
开发者ID:lvzhongyi,项目名称:canku,代码行数:13,代码来源:main.go

示例15: init

func init() {
	orm.RegisterDriver("mysql", orm.DR_MySQL)
	//dbLink := "ocs:" + "[email protected](dbdev.gz.cvte.cn:3306)/sfs?charset=utf8"
	//dbLink := "root:" + "[email protected](192.168.2.114:3306)/sfs?charset=utf8"
	dbLink := beego.AppConfig.String("dbuser") + ":" + beego.AppConfig.String("dbpass") + "@tcp(" + beego.AppConfig.String("dbhost") + ":" + beego.AppConfig.String("dbport") + ")/" + beego.AppConfig.String("dbname") + "?charset=utf8"
	orm.RegisterDataBase("default", "mysql", dbLink)
	//orm.Debug = true
	o := orm.NewOrm()
	o.Using("default")

	beego.SetStaticPath("/img", "img")
	beego.SetStaticPath("/css", "css")
	beego.SetStaticPath("/js", "js")
}
开发者ID:zengcheng,项目名称:sfs,代码行数:14,代码来源:.go


注:本文中的github.com/astaxie/beego.SetStaticPath函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。