This repository was archived by the owner on Apr 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsteptypes.go
97 lines (80 loc) · 1.78 KB
/
steptypes.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package main
import (
"github.com/Kong/go-pdk/client"
"github.com/Kong/go-pdk/entities"
"github.com/Kong/go-pdk/node"
)
type Error string
func (e Error) Error() string {
return string(e)
}
type StepErrorData struct {
EventId int
Data Error
}
func (s *PluginServer) StepError(in StepErrorData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepMultiMapData struct {
EventId int
Data map[string][]string
}
func (s *PluginServer) StepMultiMap(in StepMultiMapData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepCredentialData struct {
EventId int
Data client.AuthenticatedCredential
}
func (s *PluginServer) StepCredential(in StepCredentialData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepRouteData struct {
EventId int
Data entities.Route
}
func (s *PluginServer) StepRoute(in StepRouteData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepServiceData struct {
EventId int
Data entities.Service
}
func (s *PluginServer) StepService(in StepServiceData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepConsumerData struct {
EventId int
Data entities.Consumer
}
func (s *PluginServer) StepConsumer(in StepConsumerData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}
type StepMemoryStatsData struct {
EventId int
Data node.MemoryStats
}
func (s *PluginServer) StepMemoryStats(in StepMemoryStatsData, out *StepData) error {
return s.Step(StepData{
EventId: in.EventId,
Data: in.Data,
}, out)
}