ipn/store: make StateStore.All optional (#16409)

This method is only needed to migrate between store.FileStore and
tpm.tpmStore. We can make a runtime type assertion instead of
implementing an unused method for every platform.

Updates #15830

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
Andrew Lytvynov
2025-06-27 15:14:18 -07:00
committed by GitHub
parent 0a64e86a0d
commit 76b9afb54d
10 changed files with 45 additions and 70 deletions

View File

@@ -8,7 +8,6 @@ import (
"context"
"errors"
"fmt"
"iter"
"net"
"strconv"
)
@@ -84,11 +83,6 @@ type StateStore interface {
// instead, which only writes if the value is different from what's
// already in the store.
WriteState(id StateKey, bs []byte) error
// All returns an iterator over all StateStore keys. Using ReadState or
// WriteState is not safe while iterating and can lead to a deadlock.
// The order of keys in the iterator is not specified and may change
// between runs.
All() iter.Seq2[StateKey, []byte]
}
// WriteState is a wrapper around store.WriteState that only writes if