diff options
| author | SangTran-127 <tranquangsang12.7@gmail.com> | 2026-08-09 01:11:31 +0700 |
|---|---|---|
| committer | SangTran-127 <tranquangsang12.7@gmail.com> | 2026-08-09 01:11:31 +0700 |
| commit | 4d62f01af159fddd56585b3dce19b8a0f47369c1 (patch) | |
| tree | b7396fad1528edb048ef500d1894f78312df8233 /core/state.go | |
| parent | 0958e46c3651f2c8b6d76bcffbd8820063647d59 (diff) | |
| download | goflink-4d62f01af159fddd56585b3dce19b8a0f47369c1.tar.gz goflink-4d62f01af159fddd56585b3dce19b8a0f47369c1.zip | |
feat: implement memory state backend with key group assignment and value state interface
Diffstat (limited to 'core/state.go')
| -rw-r--r-- | core/state.go | 10 |
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 +} |