+//iSyncStorage is an interface towards SDL SyncStorage API
+type ISyncStorage interface {
+ Get(ns string, keys []string) (map[string]interface{}, error)
+ ListKeys(ns string, pattern string) ([]string, error)
+ Set(ns string, pairs ...interface{}) error
+ Remove(ns string, keys []string) error
+}
+
+//SyncStorageCreateCb callback function type to create a new SyncStorageInterface
+type SyncStorageCreateCb func() ISyncStorage
+
+//keysArgs struct is used for keys command arguments.
+type keysArgs struct {
+ ns string
+ pattern string
+}
+
+//NewKeysArgs constructs a new keysArgs struct.
+func NewKeysArgs(ns string, pattern string) keysArgs {
+ return keysArgs{
+ ns: ns,
+ pattern: pattern,
+ }
+}
+
+//Validate command arguments in keysArgs.
+func (k keysArgs) Validate() error {
+ if strings.Contains(k.ns, "*") {
+ return fmt.Errorf("Invalid character (*) in given %s namespace argument.", k.ns)
+ }
+ return nil
+}
+
+//nsMap is a map having SDL DB cluster address as a key and namespace map of type nsKeyMap as a value
+type nsMap map[string]nsKeyMap
+
+//nsKeyMap is a map having namespace as a key and DB key count as a value
+type nsKeyMap map[string]uint32
+