-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
655 additions
and
937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/dipper-iot/dipper-engine/core" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
var configMap = map[string]interface{}{ | ||
"rules": map[string]interface{}{ | ||
"log-core": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"arithmetic": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"fork": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"switch": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"conditional": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"input-redis-queue": map[string]interface{}{ | ||
"enable": false, | ||
"worker": 1, | ||
"options": map[string]interface{}{ | ||
"redis_address": "127.0.0.1:6379", | ||
"redis_db": 0, | ||
}, | ||
}, | ||
"input-redis-queue-extend": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
"output-redis-queue": map[string]interface{}{ | ||
"enable": false, | ||
"worker": 1, | ||
"options": map[string]interface{}{ | ||
"redis_address": "127.0.0.1:6379", | ||
"redis_db": 0, | ||
}, | ||
}, | ||
"output-redis-queue-extend": map[string]interface{}{ | ||
"enable": true, | ||
"worker": 1, | ||
}, | ||
}, | ||
"log": map[string]interface{}{ | ||
"level": "info", | ||
"out": "console", | ||
"file_name": "dipper-engine.log", | ||
}, | ||
"timeout_session": 30, | ||
"plugins": []string{}, | ||
} | ||
|
||
func getConfig() *core.ConfigEngine { | ||
var config core.ConfigEngine | ||
data, err := json.Marshal(configMap) | ||
if err != nil { | ||
log.Println(err) | ||
} | ||
err = json.Unmarshal(data, &config) | ||
if err != nil { | ||
log.Println(err) | ||
} | ||
return &config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module github.com/dipper-iot/dipper-engine/examples/base | ||
|
||
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/sirupsen/logrus v1.9.0 | ||
github.com/urfave/cli/v2 v2.11.2 | ||
) | ||
|
||
require ( | ||
github.com/Knetic/govaluate v3.0.0+incompatible // indirect | ||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect | ||
github.com/cespare/xxhash/v2 v2.1.2 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect | ||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/sony/sonyflake v1.1.0 // indirect | ||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect | ||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect | ||
) | ||
|
||
replace github.com/dipper-iot/dipper-engine => ../../ |
Oops, something went wrong.