woodpecker/router/middleware/remote.go

15 lines
318 B
Go
Raw Normal View History

2016-05-02 19:21:25 +00:00
package middleware
import (
"github.com/drone/drone/remote"
"github.com/gin-gonic/gin"
)
// Remote is a middleware function that initializes the Remote and attaches to
// the context of every http.Request.
2017-06-28 17:21:22 +00:00
func Remote(v remote.Remote) gin.HandlerFunc {
2016-05-02 19:21:25 +00:00
return func(c *gin.Context) {
remote.ToContext(c, v)
}
}