(ctx context.Context, key string, val []byte, ttl time.Duration)
| 78 | } |
| 79 | |
| 80 | func (s *SharedState) SetWithContext(ctx context.Context, key string, val []byte, ttl time.Duration) error { |
| 81 | if err := s.ensureStorage(); err != nil { |
| 82 | return err |
| 83 | } |
| 84 | |
| 85 | storageKey, ok := s.storageKey(key) |
| 86 | if !ok { |
| 87 | return nil |
| 88 | } |
| 89 | |
| 90 | return s.storage.SetWithContext(ctx, storageKey, val, ttl) |
| 91 | } |
| 92 | |
| 93 | func (s *SharedState) Get(key string) ([]byte, bool, error) { //nolint:gocritic // Keep unnamed returns for clarity. |
| 94 | return s.GetWithContext(context.Background(), key) |
no test coverage detected