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.
Install / Use
/learn @go-ego/EgoREADME
Ego
<!--<img align="right" src="https://raw.githubusercontent.com/go-ego/ego/master/logo.jpg">--> <!--<a href="https://circleci.com/gh/go-ego/ego/tree/dev"><img src="https://img.shields.io/circleci/project/go-ego/ego/dev.svg" alt="Build Status"></a>--> <!--<a href="https://github.com/go-ego/ego/releases"><img src="https://img.shields.io/badge/%20version%20-%206.0.0%20-blue.svg?style=flat-square" alt="Releases"></a>-->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
- Docs
- Requirements
- Installation
- Update
- Build-tools
- Examples
- TestRestful
- Plans
- Donate
- Contributing
- License
Docs
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 main
import (
"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
<div class="icon">
<i class="iconfont {vclass}" {node}></i>
<p>{prpo}</p>
</div>
<style>
.header-left{
float:left;
}
.header-right{
float:right;
}
.iconfont {
position: relative;
font-size:24px
}
</style>
head.vgo
import (
"icons"
icon "icons/icon.vgo"
)
<div class="head">
<div>ego:{{.head}}</div>
<icon>
vclass={icon-share-to}
node={ id="slot1"}
prpo={node---1}
</icon>
<div>
{{range .parArr}}
<p>arr::: {{.}}</p>
{{end}}
</div>
</div>
Renderings:
<p align="center"> <img src="https://github.com/go-ego/ego/blob/master/img/head.png" width="700" hight="500"> </p>TestRestful
package main
import (
"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:
<p align="center"> <img src="https://github.com/go-ego/ego/blob/master/img/test.png" width="700" hight="500"> </p>Plans
- Compression and merge css/js
- CSS Preprocessing
- Try supports MVVM and vdom
- Update 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.
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
341.8kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
