(ctx context.Context, key string)
| 235 | } |
| 236 | |
| 237 | func (s *SharedState) HasWithContext(ctx context.Context, key string) (bool, error) { |
| 238 | if err := s.ensureStorage(); err != nil { |
| 239 | return false, err |
| 240 | } |
| 241 | |
| 242 | storageKey, ok := s.storageKey(key) |
| 243 | if !ok { |
| 244 | return false, nil |
| 245 | } |
| 246 | |
| 247 | data, err := s.storage.GetWithContext(ctx, storageKey) |
| 248 | if err != nil { |
| 249 | return false, err |
| 250 | } |
| 251 | |
| 252 | return data != nil, nil |
| 253 | } |
| 254 | |
| 255 | func (s *SharedState) Reset() error { |
| 256 | return s.ResetWithContext(context.Background()) |