From 52edfba2b3e46dda6dd9147e74a22e7ae176ae1d Mon Sep 17 00:00:00 2001 From: alteredCoder Date: Wed, 6 Oct 2021 18:03:24 +0200 Subject: [PATCH] add console type --- pkg/types/console.go | 14 ++++++++++++++ pkg/types/utils.go | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkg/types/console.go diff --git a/pkg/types/console.go b/pkg/types/console.go new file mode 100644 index 000000000..82a472fce --- /dev/null +++ b/pkg/types/console.go @@ -0,0 +1,14 @@ +package types + +const ( + SEND_CUSTOM_SCENARIOS = "custom" + SEND_TAINTED_SCENARIOS = "tainted" + SEND_MANUAL_SCENARIOS = "manual" + SEND_LIVE_DECISIONS = "live_decisions" +) + +var CONSOLE_CONFIGS = []string{SEND_CUSTOM_SCENARIOS, SEND_LIVE_DECISIONS, SEND_MANUAL_SCENARIOS, SEND_TAINTED_SCENARIOS} + +type ConsoleConfig struct { + ActivatedSharing []string +} diff --git a/pkg/types/utils.go b/pkg/types/utils.go index 9c5b1d1e0..e4f985726 100644 --- a/pkg/types/utils.go +++ b/pkg/types/utils.go @@ -199,3 +199,12 @@ func Int32Ptr(i int32) *int32 { func BoolPtr(b bool) *bool { return &b } + +func InSlice(str string, slice []string) bool { + for _, item := range slice { + if str == item { + return true + } + } + return false +}