aboutsummaryrefslogtreecommitdiff
path: root/core/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/state.go')
-rw-r--r--core/state.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/state.go b/core/state.go
new file mode 100644
index 0000000..d6d7847
--- /dev/null
+++ b/core/state.go
@@ -0,0 +1,10 @@
+package core
+
+import "context"
+
+// ValueState is for client side using to update state
+type ValueState[T any] interface {
+ Value(ctx context.Context) (T, error)
+ Update(ctx context.Context, newVal T) (T, error)
+ Clear(ctx context.Context) error
+}