forked from TykTechnologies/tyk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coprocess_dummy.go
69 lines (50 loc) · 1.32 KB
/
coprocess_dummy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// +build !coprocess
package main
import (
"github.com/TykTechnologies/logrus"
"github.com/TykTechnologies/tyk/coprocess"
"github.com/TykTechnologies/tykcommon"
"net/http"
)
const (
EH_CoProcessHandler tykcommon.TykEventHandlerName = "cp_dynamic_handler"
)
type Dispatcher interface {
DispatchEvent([]byte)
LoadModules()
HandleMiddlewareCache(*tykcommon.BundleManifest, string)
Reload()
}
var GlobalDispatcher Dispatcher
var EnableCoProcess bool = false
type CoProcessMiddleware struct {
*TykMiddleware
HookType coprocess.HookType
HookName string
MiddlewareDriver tykcommon.MiddlewareDriver
}
func (m *CoProcessMiddleware) New() {}
func (a *CoProcessMiddleware) IsEnabledForSpec() bool {
return false
}
func (m *CoProcessMiddleware) GetConfig() (interface{}, error) {
return nil, nil
}
func (m *CoProcessMiddleware) ProcessRequest(w http.ResponseWriter, r *http.Request, configuration interface{}) (error, int) {
return nil, 200
}
type CoProcessEventHandler JSVMEventHandler
func (l CoProcessEventHandler) New(handlerConf interface{}) (TykEventHandler, error) {
return nil, nil
}
func CoProcessInit() {
log.WithFields(logrus.Fields{
"prefix": "coprocess",
}).Info("Disabled feature")
return
}
func doCoprocessReload() {
return
}
func newExtractor(referenceSpec *APISpec, mw *TykMiddleware) {
}