Skip to content

Commit

Permalink
feat(strm-2247): use data contract 1.5.0 (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
trietsch authored Jan 18, 2023
1 parent 45a1df1 commit 84a3bb9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var SimulateCmd = &cobra.Command{

func init() {
flags := SimulateCmd.PersistentFlags()
flags.String(random_events.SchemaFlag, "strmprivacy/example/1.3.0", "Which schema to use for creating simulated events")
flags.String(random_events.SchemaFlag, "strmprivacy/example/1.5.0", "Which schema to use for creating simulated events")
_ = SimulateCmd.RegisterFlagCompletionFunc(random_events.SchemaFlag, schemaCompletion)
SimulateCmd.AddCommand(random_events.RunCmd())
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/entity/schema_code/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ make this fully operational in your development setting (using a JDK, a Python o
### Usage`

var example = util.DedentTrim(`
strm get schema-code strmprivacy/example/1.3.0 --language=python
strm get schema-code strmprivacy/example/1.5.0 --language=python
Saved to python-avro-example-1.3.0.zip
`)
var languages = []string{"java", "typescript", "python", "rust"}
Expand Down
4 changes: 2 additions & 2 deletions pkg/entity/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
saveFlag = "save"
maskedFieldsFlag = "masked-fields"
maskedFieldsSeed = "mask-seed"
maskedFieldHelp = `-M strmprivacy/example/1.3.0:sensitiveValue,consistentValue \
maskedFieldHelp = `-M strmprivacy/example/1.5.0:sensitiveValue,consistentValue \
-M strmprivacy/clickstream/1.0.0:sessionId
Masks fields values in the output stream via hashing.
Expand Down Expand Up @@ -125,7 +125,7 @@ func create(args []string, cmd *cobra.Command) {
}

/*
-M strmprivacy/example/1.3.0:sensitiveValue,anotherOne \
-M strmprivacy/example/1.5.0:sensitiveValue,anotherOne \
-M dpg/nps_unified/v3:kiosk_v1,customer_id --masked_fields_file
*/
func parseMaskedFields(flags *pflag.FlagSet) *entities.MaskedFields {
Expand Down
4 changes: 2 additions & 2 deletions pkg/simulator/random_events/event_generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func createRandomDemoEvent(consentLevels []int32, sessionId string) StrmPrivacyE

event.StrmMeta = &demoschema.StrmMeta{
ConsentLevels: consentLevels,
EventContractRef: "strmprivacy/example/1.3.0",
EventContractRef: "strmprivacy/example/1.5.0",
}
event.ConsistentValue = sessionId
event.UniqueIdentifier = createUnionString(fmt.Sprintf("unique-%d", rand.Intn(100)))
Expand All @@ -27,7 +27,7 @@ func createRandomDemoEvent(consentLevels []int32, sessionId string) StrmPrivacyE
}

var EventGenerators = map[string]func([]int32, string) StrmPrivacyEvent{
"strmprivacy/example/1.3.0": createRandomDemoEvent,
"strmprivacy/example/1.5.0": createRandomDemoEvent,
}

func createUnionString(s string) *demoschema.UnionNullString {
Expand Down
8 changes: 4 additions & 4 deletions pkg/web_socket/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ var example = util.DedentTrim(`
# Simulate some events
strm create stream test
strm simulate random-events test
Starting to simulate random strmprivacy/example/1.3.0 events to stream test. Sending one event every 1000 ms.
Starting to simulate random strmprivacy/example/1.5.0 events to stream test. Sending one event every 1000 ms.
Sent 5 events
Sent 10 events
# And in another terminal
strm listen web-socket test
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": 1782462093, "timestamp": 1669990806395, "keyLink": "e6f...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": 1159687711, "timestamp": 1669990807404, "keyLink": "b58...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": -192240390, "timestamp": 1669990808413, "keyLink": "ba0...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": 1782462093, "timestamp": 1669990806395, "keyLink": "e6f...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": 1159687711, "timestamp": 1669990807404, "keyLink": "b58...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": -192240390, "timestamp": 1669990808413, "keyLink": "ba0...
`)

var WebSocketCmd = &cobra.Command{
Expand Down

0 comments on commit 84a3bb9

Please sign in to comment.