// VersionMiddleware : add version on header.
971205
func VersionMiddleware() gin.HandlerFunc {
	// Set out header value for each response
	return func(c *gin.Context) {
		c.Header("X-GORUSH-VERSION", version)
		c.Next()
	}
}
12886
func (pr *pythonResource) setMiddlewares() {
	for _, pm := range pr.Methods {
		for _, m := range pm.MiddlewaresArr {
			pr.addMiddleware(m)
		}
	}
}
48262
func (api *API) UseMiddleware(middleware ...HandlerFunc) {
	api.middlewares = append(api.middlewares, middleware...)
}
746823
func (item *MultiGetItem) VersionType(versionType string) *MultiGetItem {
	item.versionType = versionType
	return item
}
912682
func VersionsToApply(currentVersion uint32, versions []Version) []Version {
	// Assuming the migration versions are in increasing order, we'll apply
	// any migrations that have a version number lower than our current one.
	var upgradeVersions []Version
	for _, version := range versions {
		if version.Number > currentVersion {
			upgradeVersions = append(upgradeVersions, version)
		}
	}

	// Before returning, we'll sort the slice by its version number to
	// ensure the migrations are applied in their intended order.
	sort.Slice(upgradeVersions, func(i, j int) bool {
		return upgradeVersions[i].Number < upgradeVersions[j].Number
	})

	return upgradeVersions
}
1325060
func (api *SignerAPI) Version(ctx context.Context) (string, error) {
	return ExternalAPIVersion, nil
}
513586
func Version(url string, kvdbOptions map[string]string) (string, error) {
	return kvdb.MemVersion1, nil
}
1322341
func WrapMiddleware(m func(http.Handler) http.Handler) MiddlewareFunc {
	return func(next HandlerFunc) HandlerFunc {
		return func(c Context) (err error) {
			m(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
				c.SetRequest(r)
				err = next(c)
			})).ServeHTTP(c.Response(), c.Request())
			return
		}
	}
}
193510
func (x *XC) Version(ctx context.Context) semver.Version {
	return semver.Version{
		Patch: 1,
	}
}
154476
func (s *ServeMux) HandlerAndMiddleware(r *http.Request) (http.Handler, []Middleware, string) {
	// create a new execution so fields will live outside of this function
	ex := newExecution()
	s.getAll(r, ex)
	return ex.handler, ex.middleware, ex.pattern
}
562497
func (v *version) Middlewares() MiddlewareInformer {
	return &middlewareInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
218352
func Version() (major, minor, patch int) {
	if initVersionError != nil {
		return 0, 0, 0
	}
	var maj, min, pat C.int
	C.zmq_version(&maj, &min, &pat)
	return int(maj), int(min), int(pat)
}
281787
func (s *Store) Version(context.Context) semver.Version {
	return semver.Version{Minor: 1}
}
897019
func (fe *T) UpsertMiddleware(mwCfg engine.Middleware) {
	fe.mu.Lock()
	defer fe.mu.Unlock()

	mwKey := engine.MiddlewareKey{FrontendKey: engine.FrontendKey{Id: fe.cfg.Id}, Id: mwCfg.Id}
	fe.mwCfgs[mwKey] = mwCfg
	fe.ready = false
}
180985
func Version(buildVer, buildDate, commitHash string) Option {
	return func(o *Options) {
		BuildVersion = buildVer
		BuildDate = buildDate
		CommitHash = commitHash
	}
}
692703
func (n NextHTTP) CreateMiddleware(next ContextHandler) ContextHandler {
	return HandlerFunc(func(ctx context.Context, rw http.ResponseWriter, r *http.Request) {
		n(rw, r, http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
			next.ServeHTTPC(ctx, rw, r)
		}))
	})
}
692011
func (fe *T) DeleteMiddleware(mwKey engine.MiddlewareKey) {
	fe.mu.Lock()
	defer fe.mu.Unlock()

	if _, ok := fe.mwCfgs[mwKey]; !ok {
		return
	}
	delete(fe.mwCfgs, mwKey)
	fe.ready = false
}