Skip to content

Commit 7916404

Browse files
authored
Merge pull request #92 from wrongerror/main
support dapr-proxy
2 parents 9344f28 + bf15774 commit 7916404

16 files changed

Lines changed: 68 additions & 15 deletions

File tree

functions-framework/golang/Async/bindings/with-output/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main.go
33
go 1.17
44

55
require (
6-
github.com/OpenFunction/functions-framework-go v0.4.0
6+
github.com/OpenFunction/functions-framework-go v0.5.0
77
github.com/fatih/structs v1.1.0
88
k8s.io/klog/v2 v2.40.1
99
)

functions-framework/golang/Async/bindings/without-output/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main.go
33
go 1.17
44

55
require (
6-
github.com/OpenFunction/functions-framework-go v0.4.0
6+
github.com/OpenFunction/functions-framework-go v0.5.0
77
github.com/fatih/structs v1.1.0
88
k8s.io/klog/v2 v2.40.1
99
)

functions-framework/golang/Async/pubsub/pub/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main.go
33
go 1.17
44

55
require (
6-
github.com/OpenFunction/functions-framework-go v0.4.0
6+
github.com/OpenFunction/functions-framework-go v0.5.0
77
k8s.io/klog/v2 v2.40.1
88
)
99

functions-framework/golang/Async/pubsub/sub/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main.go
33
go 1.17
44

55
require (
6-
github.com/OpenFunction/functions-framework-go v0.4.0
6+
github.com/OpenFunction/functions-framework-go v0.5.0
77
k8s.io/klog/v2 v2.40.1
88
)
99

functions-framework/golang/Knative/cloudevents/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.17
44

55
require (
66
github.com/cloudevents/sdk-go/v2 v2.4.1
7-
github.com/OpenFunction/functions-framework-go v0.4.0
7+
github.com/OpenFunction/functions-framework-go v0.5.0
88
github.com/fatih/structs v1.1.0
99
k8s.io/klog/v2 v2.30.0
1010
)

functions-framework/golang/Knative/http/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main.go
33
go 1.17
44

55
require (
6-
github.com/OpenFunction/functions-framework-go v0.4.0
6+
github.com/OpenFunction/functions-framework-go v0.5.0
77
github.com/fatih/structs v1.1.0
88
k8s.io/klog/v2 v2.30.0
99
)

functions/async/bindings/cron-input-kafka-output/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module example.com/bindings
22

33
go 1.17
44

5-
require github.com/OpenFunction/functions-framework-go v0.4.0
5+
require github.com/OpenFunction/functions-framework-go v0.5.0

functions/async/bindings/cron-input/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module example.com/bindings
22

33
go 1.17
44

5-
require github.com/OpenFunction/functions-framework-go v0.4.0
5+
require github.com/OpenFunction/functions-framework-go v0.5.0
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package plugin_custom
2+
3+
import (
4+
ofctx "github.com/OpenFunction/functions-framework-go/context"
5+
"github.com/OpenFunction/functions-framework-go/plugin"
6+
"github.com/fatih/structs"
7+
)
8+
9+
const (
10+
Name = "plugin-custom"
11+
Version = "v1"
12+
)
13+
14+
type PluginCustom struct {
15+
PluginName string
16+
PluginVersion string
17+
StateC int64
18+
}
19+
20+
var _ plugin.Plugin = &PluginCustom{}
21+
22+
func New() *PluginCustom {
23+
return &PluginCustom{
24+
StateC: int64(0),
25+
}
26+
}
27+
28+
func (p *PluginCustom) Name() string {
29+
return Name
30+
}
31+
32+
func (p *PluginCustom) Version() string {
33+
return Version
34+
}
35+
36+
func (p *PluginCustom) Init() plugin.Plugin {
37+
return New()
38+
}
39+
40+
func (p *PluginCustom) ExecPreHook(ctx ofctx.RuntimeContext, plugins map[string]plugin.Plugin) error {
41+
p.StateC++
42+
return nil
43+
}
44+
45+
func (p *PluginCustom) ExecPostHook(ctx ofctx.RuntimeContext, plugins map[string]plugin.Plugin) error {
46+
return nil
47+
}
48+
49+
func (p *PluginCustom) Get(fieldName string) (interface{}, bool) {
50+
plgMap := structs.Map(p)
51+
value, ok := plgMap[fieldName]
52+
return value, ok
53+
}

functions/async/bindings/kafka-input/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module example.com/bindings
22

33
go 1.17
44

5-
require github.com/OpenFunction/functions-framework-go v0.4.0
5+
require github.com/OpenFunction/functions-framework-go v0.5.0

0 commit comments

Comments
 (0)