forked from TykTechnologies/tyk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coprocess_dummy.go
64 lines (49 loc) · 1.38 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
// +build !coprocess
package main
import (
"net/http"
"github.com/Sirupsen/logrus"
"github.com/TykTechnologies/tyk/apidef"
"github.com/TykTechnologies/tyk/coprocess"
)
const (
EH_CoProcessHandler apidef.TykEventHandlerName = "cp_dynamic_handler"
)
type Dispatcher interface {
DispatchEvent([]byte)
LoadModules()
HandleMiddlewareCache(*apidef.BundleManifest, string)
Reload()
}
var (
GlobalDispatcher Dispatcher
EnableCoProcess = false
)
type CoProcessMiddleware struct {
*TykMiddleware
HookType coprocess.HookType
HookName string
MiddlewareDriver apidef.MiddlewareDriver
}
func (m *CoProcessMiddleware) GetName() string {
return "CoProcessMiddlewareDummy"
}
func (m *CoProcessMiddleware) New() {}
func (m *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")
}
func doCoprocessReload() {}
func newExtractor(referenceSpec *APISpec, mw *TykMiddleware) {}