File tree Expand file tree Collapse file tree
functions-framework/golang
path-parameters-function-go Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module main.go
33go 1.17
44
55require (
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)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module main.go
33go 1.17
44
55require (
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)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module main.go
33go 1.17
44
55require (
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
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module main.go
33go 1.17
44
55require (
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
Original file line number Diff line number Diff line change 44
55require (
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)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module main.go
33go 1.17
44
55require (
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)
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module example.com/bindings
22
33go 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
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module example.com/bindings
22
33go 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module example.com/bindings
22
33go 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
You can’t perform that action at this time.
0 commit comments