mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
14 lines
318 B
Go
14 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)
|
|
}
|
|
}
|