Skip to content

Instantly share code, notes, and snippets.

@zerosign
Last active December 5, 2020 13:16
Show Gist options
  • Save zerosign/8fa66cfe80d48a32146408877efce7f6 to your computer and use it in GitHub Desktop.
Save zerosign/8fa66cfe80d48a32146408877efce7f6 to your computer and use it in GitHub Desktop.
type Hasher interface {
Compute(
context.Context,
hash Hash,
new map[string]string,
) (Hash, error)
}
type Changeset interface {
Change(
context.Context,
namespace string,
id string,
props map[string]string,
) (Hash, error)
Lookup(
context.Context,
namespace string,
id string,
) (Hash, bool, error)
}
type Collection interface {
Add(
context.Context,
namespace string,
id string,
props map[string]string,
) error
Remove(
context.Context,
namespace string,
id string,
props map[string]string,
forced bool,
) error
List(
context.Context,
namespace string,
) (map[string]map[string]string, error)
Contains(
context.Context,
namespace string,
id string,
) (bool, error)
}
type PropertyStore interface {
Change(
context.Context,
namespace,
id string,
props map[string]string,
) error
ChangeMany(
context.Context,
namespace,
id []string,
props map[string]string,
) error
Select(
context.Context,
namespace,
id string,
keys []string,
) (map[string]string, error)
SelectMany(
context.Context,
namespace,
ids []string,
keys []string,
) (map[string]map[string]string, []string, error)
Delete(
context.Context,
namespace,
ids []string,
keys []string,
) error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment