From 39aa67cdae9e3480294a92b5ffa4434418b9fd33 Mon Sep 17 00:00:00 2001 From: David Schall Date: Thu, 4 Jul 2024 08:01:49 +0000 Subject: [PATCH] Add conversion function for input type Signed-off-by: David Schall --- grpcclient/grpcclient.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/grpcclient/grpcclient.go b/grpcclient/grpcclient.go index 0998396..06b914a 100644 --- a/grpcclient/grpcclient.go +++ b/grpcclient/grpcclient.go @@ -59,6 +59,20 @@ func (s *GeneratorBase) SetMethod(method string) { s.defaultInput.Method = method } +func StringToGeneratorType(gs string) GeneratorType { + switch gs { + case "unique": + return Unique + case "linear": + return Linear + case "random": + return Random + default: + log.Error("Unknown generator type. Allowed values are: unique, linear, random.") + return Unique + } +} + func (s *GeneratorBase) Increment() int { s.count += 1 if s.count > s.upperBound {