github.com/anuvu/tyk@v2.9.0-beta9-dl-apic+incompatible/gateway/mw_transform_jq_dummy.go (about)

     1  // +build !jq
     2  
     3  package gateway
     4  
     5  import (
     6  	"net/http"
     7  
     8  	"github.com/TykTechnologies/tyk/apidef"
     9  )
    10  
    11  type TransformJQMiddleware struct {
    12  	BaseMiddleware
    13  }
    14  
    15  func (t *TransformJQMiddleware) Name() string {
    16  	return "TransformJQMiddleware"
    17  }
    18  
    19  func (t *TransformJQMiddleware) EnabledForSpec() bool {
    20  	for _, version := range t.Spec.VersionData.Versions {
    21  		if len(version.ExtendedPaths.TransformJQ) > 0 {
    22  			log.Warning("JQ transform not supported.")
    23  			return false
    24  		}
    25  	}
    26  
    27  	return false
    28  }
    29  
    30  // ProcessRequest will run any checks on the request on the way through the system, return an error to have the chain fail
    31  func (t *TransformJQMiddleware) ProcessRequest(w http.ResponseWriter, r *http.Request, _ interface{}) (error, int) {
    32  	return nil, 200
    33  }
    34  
    35  type TransformJQSpec struct {
    36  	apidef.TransformJQMeta
    37  }
    38  
    39  func (a *APIDefinitionLoader) compileTransformJQPathSpec(paths []apidef.TransformJQMeta, stat URLStatus) []URLSpec {
    40  	return []URLSpec{}
    41  }