• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang beego.SetStaticPath函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init

func init() {

	// main
	beego.Router("/", &controllers.IndexController{})
	beego.Router("/plan", &controllers.PlanController{})

	// beego.Router("/report", &controllers.ReportController{})
	beego.Router("/getlastexecution", &controllers.GetLastExecutionController{})

	// Statistics
	// beego.Router("/statistics", &controllers.StatisticsController{})
	beego.Router("/statistics/sprint", &controllers.StatisticsController{})
	beego.Router("/api/statistics/sprint", &controllers.StatisticsController{}, "get:Sprint")
	// beego.Router("/api/statistics/stock", &controllers.StatisticsController{}, "get:Stock")

	// Test
	beego.Router("/test", &controllers.TestController{})

	// About
	beego.Router("/about", &controllers.AboutController{})

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

	// api
	beego.Router("/api/getplan", &apis.ApiController{}, "get:GetPlan")
	beego.Router("/api/getlastexecution", &apis.ApiController{}, "get:GetLastExecution")
	beego.Router("/api/runcmd", &apis.ApiController{}, "get:RunCmd")

	// static file
	beego.SetStaticPath("/data", "data")
}
开发者ID:RoyburnsPeng,项目名称:goTestLinkReport,代码行数:32,代码来源:router.go


示例17: main

func main() {
	initialize()
	go catchExit()

	beego.Info(beego.AppName, APP_VER)

	// Register routers.
	beego.Router("/", &routers.HomeRouter{})
	beego.Router("/refresh", &routers.RefreshRouter{})
	beego.Router("/search", &routers.SearchRouter{})
	beego.Router("/index", &routers.IndexRouter{})
	// beego.Router("/label", &routers.LabelsRouter{})
	beego.Router("/function", &routers.FuncsRouter{})
	beego.Router("/example", &routers.ExamplesRouter{})
	beego.Router("/about", &routers.AboutRouter{})

	beego.Router("/api/v1/badge", &routers.ApiRouter{}, "get:Badge")

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

	// "robot.txt"
	beego.Router("/robots.txt", &routers.RobotRouter{})

	// For all unknown pages.
	beego.Router("/:all", &routers.HomeRouter{})

	// Static path.
	beego.SetStaticPath("/public", "public")
	beego.Run()
}
开发者ID:juju2013,项目名称:gowalker,代码行数:34,代码来源:gowalker.go


示例18: main

func main() {
	version()
	fmt.Printf("built on %s\n", BuildTime())
	flag.Parse()
	cfg := NewMonitorConfig(*InputConfFile)
	err := cfg.LoadConfig()
	if err != nil {
		log.Error(err.Error())
		return
	}

	server, err := libnet.Listen(cfg.TransportProtocols, cfg.Listen)
	if err != nil {
		log.Error(err.Error())
		return
	}
	log.Info("server start: ", server.Listener().Addr().String())

	m := NewMonitor(cfg)
	//TODO not use go
	m.subscribeChannels()
	go server.Serve(func(session *libnet.Session) {

	})

	beego.Router("api/v1/monitor", &controllers.MonitorController{})
	//beego.SetStaticPath("/views", "/mh/mygo/src/github.com/oikomi/FishChatServer/monitor/views")
	beego.SetStaticPath("/views", "views")
	beego.Run()
}
开发者ID:alvin921,项目名称:FishChatServer,代码行数:30,代码来源:monitor.go


示例19: init

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

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

	beego.Router("/accounts/register", &controllers.RegistrationController{})
}
开发者ID:mjpeck,项目名称:hudunwut,代码行数:7,代码来源:router.go


示例20: main

func main() {

	//初始化
	initialize()

	beego.Info(beego.AppName, APP_VER)

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

	// 开启 ORM 调试模式
	orm.Debug = true
	// 自动建表
	orm.RunSyncdb("default", false, true)

	beego.Router("/", &controllers.MainController{})
	beego.Router("/user/reg", &controllers.UserController{}, "post:reg")

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

	beego.Run()
}
开发者ID:javazhen,项目名称:blog,代码行数:25,代码来源:main.go



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang beego.TestBeegoInit函数代码示例发布时间:2022-05-24
下一篇:
Golang beego.SetLogger函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap