summaryrefslogtreecommitdiff
path: root/system/api/push.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/api/push.go')
-rw-r--r--system/api/push.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/system/api/push.go b/system/api/push.go
index 2b68d5b..f7755e5 100644
--- a/system/api/push.go
+++ b/system/api/push.go
@@ -10,12 +10,16 @@ import (
"golang.org/x/net/http2"
)
-func push(res http.ResponseWriter, req *http.Request, pt func() interface{}, data []byte) {
+func push(res http.ResponseWriter, req *http.Request, pt interface{}, data []byte) {
// Push(target string, opts *PushOptions) error
if pusher, ok := res.(http.Pusher); ok {
- if p, ok := pt().(item.Pushable); ok {
+ if p, ok := pt.(item.Pushable); ok {
// get fields to pull values from data
- fields := p.Push()
+ fields, err := p.Push(res, req)
+ if err != nil {
+ log.Println("[Pushable] error:", err)
+ return
+ }
// parse values from data to push
values := gjson.GetManyBytes(data, fields...)