Skip to content

Commit

Permalink
update meta_data and multi root and redis version
Browse files Browse the repository at this point in the history
  • Loading branch information
NortonBen committed May 11, 2024
1 parent 84ff409 commit 8ab2851
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/dipper-engine
/plugins/
/coverage.out
/examples/base/go.sum
go.sum
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ c.Hook(engine.AfterStart, func(dipper *core.DipperEngine, c *cli.Context) error

return dipper.Add(context.Background(), &data.Session{
Data: map[string]interface{}{
"default": map[string]interface{}{
"default": map[string]interface{}{
"a": 10,
"b": 20,
"d": 5,
Expand Down
1 change: 1 addition & 0 deletions data/ouput.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type OutputEngine struct {
ChanId string `json:"chan_id"`
IdNode string `json:"id_node"`
FromEngine string `json:"from_engine"`
MetaData map[string]interface{} `json:"meta_data"`
Data map[string]interface{} `json:"data"`
BranchMain string `json:"branch_main"`
Next []string `json:"next"`
Expand Down
1 change: 1 addition & 0 deletions data/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type NodeRule struct {
type Session struct {
ChanId string `json:"chan_id"`
MapNode map[string]*NodeRule `json:"map_node"`
MetaData map[string]interface{} `json:"meta_data"`
RootNode string `json:"root_node"`
Data map[string]interface{} `json:"data"`
Result map[string]*OutputEngine `json:"result"`
Expand Down
2 changes: 1 addition & 1 deletion engine/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package engine
import (
"fmt"
"github.com/dipper-iot/dipper-engine/core"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
"github.com/urfave/cli/v2"

Check failure on line 7 in engine/cli.go

View workflow job for this annotation

GitHub Actions / build

missing go.sum entry for module providing package github.com/urfave/cli/v2 (imported by github.com/dipper-iot/dipper-engine/engine); to add:
"os"
"os/signal"
Expand Down
2 changes: 1 addition & 1 deletion engine/dipper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/internal/util"
rs "github.com/dipper-iot/dipper-engine/redis"
"github.com/dipper-iot/dipper-engine/store"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"time"
Expand Down
2 changes: 1 addition & 1 deletion engine/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/dipper-iot/dipper-engine/core"
"github.com/dipper-iot/dipper-engine/data"
"github.com/dipper-iot/dipper-engine/internal/debug"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"io"
Expand Down
2 changes: 1 addition & 1 deletion examples/base/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/dipper-iot/dipper-engine v0.0.0-20221022050351-f7e9b09096a6
github.com/go-redis/redis/v9 v9.0.0-rc.1
github.com/go-redis/redis/v8 v8.11.5
github.com/sirupsen/logrus v1.9.0
github.com/urfave/cli/v2 v2.11.2
)
Expand Down
2 changes: 1 addition & 1 deletion examples/redis-queue/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/dipper-iot/dipper-engine v0.0.0-20221022050351-f7e9b09096a6
github.com/go-redis/redis/v9 v9.0.0-rc.1
github.com/go-redis/redis/v8 v8.11.5
github.com/sirupsen/logrus v1.9.0
github.com/urfave/cli/v2 v2.11.2
)
Expand Down
46 changes: 0 additions & 46 deletions examples/redis-queue/go.sum

This file was deleted.

2 changes: 1 addition & 1 deletion examples/redis-queue/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/core"
"github.com/dipper-iot/dipper-engine/data"
"github.com/dipper-iot/dipper-engine/engine"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"io"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/Knetic/govaluate v3.0.0+incompatible
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/go-redis/redis/v9 v9.0.0-rc.1
github.com/go-redis/redis/v8 v8.11.5
github.com/sirupsen/logrus v1.9.0
github.com/sony/sonyflake v1.1.0
github.com/urfave/cli/v2 v2.11.2
Expand Down
50 changes: 0 additions & 50 deletions go.sum

This file was deleted.

2 changes: 1 addition & 1 deletion internal/lock/redis_lock/try_lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package redis_lock

import (
"context"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"

Check failure on line 5 in internal/lock/redis_lock/try_lock.go

View workflow job for this annotation

GitHub Actions / build

missing go.sum entry for module providing package github.com/go-redis/redis/v8 (imported by github.com/dipper-iot/dipper-engine/engine); to add:
log "github.com/sirupsen/logrus"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion redis/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package redis
import (
"context"
"github.com/dipper-iot/dipper-engine/internal/util"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"io"
)
Expand Down
2 changes: 1 addition & 1 deletion redis/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/core"
"github.com/dipper-iot/dipper-engine/internal/util"
"github.com/dipper-iot/dipper-engine/queue"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"io"
"time"
Expand Down
2 changes: 1 addition & 1 deletion redis/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/dipper-iot/dipper-engine/internal/lock"
"github.com/dipper-iot/dipper-engine/internal/lock/redis_lock"
"github.com/dipper-iot/dipper-engine/internal/util"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion rules/common/connect_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package common

import (
"context"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
)

func ConnectRedis(ctx context.Context, option *OptionRedis) (client *redis.Client, err error) {
Expand Down
2 changes: 1 addition & 1 deletion rules/input_redis_queue/input_redis_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/errors"
"github.com/dipper-iot/dipper-engine/queue"
"github.com/dipper-iot/dipper-engine/rules/common"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"io"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion rules/input_redis_queue_extend/input_redis_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/errors"
"github.com/dipper-iot/dipper-engine/queue"
"github.com/dipper-iot/dipper-engine/rules/common"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
"io"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion rules/input_redis_queue_extend/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package input_redis_queue_extend
import (
"context"
"github.com/dipper-iot/dipper-engine/data"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
)

type OptionSession struct {
Expand Down
1 change: 0 additions & 1 deletion rules/output_redis_queue/input_redis_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/dipper-iot/dipper-engine/errors"
"github.com/dipper-iot/dipper-engine/queue"
"github.com/dipper-iot/dipper-engine/rules/common"
"github.com/go-redis/redis/v9"
log "github.com/sirupsen/logrus"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/dipper-iot/dipper-engine/errors"
"github.com/dipper-iot/dipper-engine/queue"
"github.com/dipper-iot/dipper-engine/rules/common"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
log2 "github.com/dipper-iot/dipper-engine/rules/log"
_switch "github.com/dipper-iot/dipper-engine/rules/switch"
"github.com/dipper-iot/dipper-engine/store"
"github.com/go-redis/redis/v9"
"github.com/go-redis/redis/v8"
"log"
"sync"
"testing"
Expand Down

0 comments on commit 8ab2851

Please sign in to comment.