Ego采用Go编写的一个全栈Web框架

网友投稿 1062 2022-10-27

Ego采用Go编写的一个全栈Web框架

Ego采用Go编写的一个全栈Web框架

Ego

Ego is a full-stack web framework written in Go, lightweight and efficient front-end component solutions, based on gin. The front-end is compiled, does not affect the back-end.

This is a work in progress.

简体中文

Contents

DocsRequirementsInstallationUpdateBuild-toolsExamplesTestRestfulPlansDonateContributingLicense

Docs

API Docs    中文文档GoDoc

Requirements:

Go Version ≥1.7

Installation:

go get github.com/go-ego/ego

Update:

go get -u github.com/go-ego/ego

Build-tools

go get -u github.com/go-ego/re

re new

To create a new Ego web application

$ re new my-webapp

re run

To run the application we just created, you can navigate to the application folder and execute:

$ cd my-webapp && re run

Examples:

Router

package mainimport ( "github.com/go-ego/ego")func main() { router := ego.Classic() ego.UseRenders() router.GlobHTML("views/html/*") parArr := [5]int{1, 2, 3, 4, 5} router.Ego("/head/", "head/head.html", ego.Map{ "head": "Test to load the HTML template", "parArr": parArr, }) router.Run(":3100")}

icon.vgo

// pkg icon

{prpo}

head.vgo

import ( "icons" icon "icons/icon.vgo" )

ego:{{.head}}
vclass={icon-share-to} node={ id="slot1"} prpo={node---1}
{{range .parArr}}

arr::: {{.}}

{{end}}

Renderings:

TestRestful

package mainimport ( "github.com/go-ego/ego")const httpUrl string = "http://127.0.0.1:3000"func main() { router := ego.Classic() router.Static("/js", "./views/js") router.Static("/src", "./views/src") router.GlobHTML("views/html/*") strUrl := httpUrl + "/test/hlist" paramMap := ego.Map{ "lon": "10.1010101", "lat": "20.202020", "type": "1", } router.TestHtml(strUrl, paramMap) // http url, http parameter, args (optional parameters): The default is "data". router.Run(":3100")}

Renderings:

More instructions

Plans

Compression and merge css/jsCSS PreprocessingTry supports MVVM and vdomUpdate web framework

Donate

Supporting ego, buy me a coffee.

Contributing

To contribute to Ego, please see Contribution Guidelines. Fork -> Patch -> Push -> Test -> Pull Request. See contributors page for full list of contributors.

License

Ego is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Go----Go 语言中的标识符和关键字
下一篇:linux c的结构体赋值方法
相关文章

 发表评论

暂时没有评论,来抢沙发吧~