1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/router/middleware/remote.go
2017-06-28 13:21:22 -04:00

15 lines
318 B
Go

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.
func Remote(v remote.Remote) gin.HandlerFunc {
return func(c *gin.Context) {
remote.ToContext(c, v)
}
}