Giter VIP home page Giter VIP logo

echo-web's People

Contributors

hb-chen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

echo-web's Issues

redigo: connection pool exhausted

{"time":"2018-03-28T15:33:28+08:00","level":"DEBUG","prefix":"log","file":"/root/go/src/echo-web/model/orm/logger.go","line":"14","message":"orm log:[log /root/go/src/echo-web/vendor/github.com/hb-go/gorm/main.go:684 redigo: connection pool exhausted] \n"}

no buildable Go source files

你好,当我go run server.go 的时候出现no buildable Go source files
[ go run server.go | done: 1.976113s ]
router\www\router.go:11:2: no buildable Go source files in D:\workspace\go\src\echo-web\assets
module\render\render.go:20:2: no buildable Go source files in D:\workspace\go\src\echo-web\template

InMemoryStore的set和get方法,参数好像不一样

minfo := MaterialInfo{}
var count int64
db := DB().Where("db_internal_id = ?", id)
if err := Cache(db).First(&minfo).Count(&count).Error; err != nil {
log.Debugf("GetMaterialInfoById error: %v", err)
return nil
}
上面这种写法你们那没问题吗,我的怎么报错
{"time":"2018-12-18T18:14:53.3992271+08:00","level":"-","prefix":"api","file":"recover.go","line":"73","message":"[PANIC RECOVER] reflect.Set: value of type *model.MaterialInfo is not assignable to type model.MaterialInfo goroutine 37 [running]
我在set之前加了以下代码才通过
var value interface{}
v := reflect.ValueOf(out)
value = v.Interface()
if v.Kind() == reflect.Ptr {
p := v.Elem()
value = p.Interface()
}
c.store.Set(key, value, c.Expire)

command-line-arguments

usr/local/Cellar/go/1.7.4_2/libexec/pkg/tool/darwin_amd64/link: cannot open file /usr/local/Cellar/go/1.7.4_2/libexec/pkg/darwin_amd64/github.com/labstack/echo.a: open /usr/local/Cellar/go/1.7.4_2/libexec/pkg/darwin_amd64/github.com/labstack/echo.a: no such file or directory

?

去掉子域名部署

谢谢楼主,去掉子域名部署更好.少即是多.一般采用e.Group("/api"),e.Group("/ws").

redigo依赖问题

编译失败,错误: “pkg\mod\github.com\garyburd\[email protected]+incompatible\redis\pool.go:28:2: use of internal package github.com/gomodule/redigo/internal not allowed”

经查原因如下:
redigo已经移到新地址: github.com/gomodule/redigo
但是middleware/cache/redis.go引用的还是旧库: github.com/garyburd/redigo

问下echo日志中间件配置当前日期的文件

您好,我是go新手,无意间发现echo框架,非常喜欢,但水平有限希望您能解释以下内容
日志中间件配置的output 如何以当天的日期创建一个文档 配置给output 以下代码 日志并没有写入任何信息
如果方便的话 能否加我一下qq 619735688 谢谢
var fd *os.File
e := echo.New()
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
fd, _ = os.OpenFile("这里通过time获取当天日期2017-02-01.log", os.O_APPEND|os.O_CREATE, 0644)
return next(c)
}
})
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{Output: fd}))
e.GET("/", func(c echo.Context) error {
return c.JSON(http.StatusOK, "asd")
})
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
fd.Close()
return next(c)
}
})

使用go mod,运行失败

 ./run.sh
>>>> 18:30:22 remove pkg
>>>> 18:30:22 [ run ] server
# github.com/hb-go/echo-web/middleware/session
../github.com/hb-go/echo-web/middleware/session/redis.go:53:3: cannot use "github.com/garyburd/redigo/redis".Pool literal (type *"github.com/garyburd/redigo/redis".Pool) as type *"github.com/gomodule/redigo/redis".Pool in argument to redistore.NewRediStoreWithPool
# github.com/uber/jaeger-client-go
../github.com/uber/jaeger-client-go/metrics.go:100:35: too many arguments in call to factory.Namespace
	have (string, nil)
	want (metrics.NSOptions)

echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 1s

echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 20ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 40ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 80ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 160ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 320ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 640ms
echo: http: Accept error: accept tcp [::]:8080: accept4: too many open files; retrying in 1s

pprof 中间件路由使用

  e.Pre(pprof.Serve())

添加的这个中间件,是不能够使用一下命令行的吧,

 go tool pprof http://localhost:9293/debug/pprof/profile

pprof.Index(c.Response(), c.Request()) 函数只支持以下几个路径

profiles.m = map[string]*Profile{
			"goroutine":    goroutineProfile,
			"threadcreate": threadcreateProfile,
			"heap":         heapProfile,
			"block":        blockProfile,
			"mutex":        mutexProfile,
		}

对 go tool pprof http://localhost:9293/debug/pprof/profile 命令行

应该使用这个函数

pprof.Profile(c.Response(), c.Request())

这块是不是应该针对各种pprof单独设置路由。

Steps to install/start use

Hello! I've managed to setup most of the package, but when I run build.sh I get the following message:

/home/vagrant/go/src/github.com/hobo-go/echo-web/echo/echo.go:13:2: no buildable Go source files in /home/vagrant/go/src/github.com/hobo-go/echo-web/assets /home/vagrant/go/src/github.com/hobo-go/echo-web/modules/render/render.go:19:2: no buildable Go source files in /home/vagrant/go/src/github.com/hobo-go/echo-web/templates

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.