Browse Source

some docs & small improvements

tags/v0.4.6
Lunny Xiao 4 years ago
parent
commit
d236d45428
6 changed files with 10 additions and 4 deletions
  1. +1
    -0
      README.md
  2. +1
    -0
      README_CN.md
  3. +2
    -3
      logger.go
  4. +1
    -0
      response.go
  5. +4
    -0
      router.go
  6. +1
    -1
      tan.go

+ 1
- 0
README.md View File

@@ -97,6 +97,7 @@ There are already many [middlewares](https://github.com/tango-contrib) to simpli

- [Wego](https://github.com/go-tango/wego)
- [DBWeb](https://github.com/go-xorm/dbweb)
- [Godaily](http://godaily.org) - [github](https://github.com/godaily/news)
- [ABlog](https://github.com/fuxiaohei/ablog)
- [Gos](https://github.com/go-tango/gos)



+ 1
- 0
README_CN.md View File

@@ -98,6 +98,7 @@ func main() {

- [Wego](https://github.com/go-tango/wego)
- [DBWeb](https://github.com/go-xorm/dbweb)
- [Godaily](http://godaily.org) - [github](https://github.com/godaily/news)
- [ABlog](https://github.com/fuxiaohei/ablog)
- [Gos](https://github.com/go-tango/gos)



+ 2
- 3
logger.go View File

@@ -66,12 +66,11 @@ func Logging() HandlerFunc {
}

statusCode := ctx.Status()
escape := time.Now().Sub(start)

if statusCode >= 200 && statusCode < 400 {
ctx.Info(ctx.Req().Method, statusCode, escape, p)
ctx.Info(ctx.Req().Method, statusCode, time.Since(start), p)
} else {
ctx.Error(ctx.Req().Method, statusCode, escape, p, ctx.Result)
ctx.Error(ctx.Req().Method, statusCode, time.Since(start), p, ctx.Result)
}
}
}

+ 1
- 0
response.go View File

@@ -17,6 +17,7 @@ import (
type ResponseWriter interface {
http.ResponseWriter
http.Flusher
http.Hijacker
// Status returns the status code of the response or 0 if the response has not been written.
Status() int
// Written returns whether or not the ResponseWriter has been written.


+ 4
- 0
router.go View File

@@ -59,6 +59,10 @@ func NewRoute(v interface{}, t reflect.Type,
}
}

func (r *Route) Raw() interface{} {
return r.raw
}

func (r *Route) Method() reflect.Value {
return r.method
}


+ 1
- 1
tan.go View File

@@ -11,7 +11,7 @@ import (
)

func Version() string {
return "0.4.5.0428"
return "0.4.5.0504"
}

type Tango struct {


Loading…
Cancel
Save