Documentation
¶
Overview ¶
Package dbtest holds the application directory store's contract tests, shared by every implementation the way the trust DB's are.
Index ¶
- func MustKey(fill byte) wireguard.PublicKey
- func TestDirectoryStore(t *testing.T, open func(t *testing.T) wireguard.DirectoryStore)
- type MemStore
- func (s *MemStore) Close() error
- func (s *MemStore) DeleteHost(_ context.Context, key wireguard.PublicKey) error
- func (s *MemStore) List(context.Context) (wireguard.Directory, error)
- func (s *MemStore) Publish(_ context.Context, entry wireguard.Entry) (wireguard.Entry, error)
- func (s *MemStore) PublishHost(_ context.Context, entry wireguard.HostEntry) error
- func (s *MemStore) Seed(entry wireguard.Entry)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustKey ¶
MustKey returns the public key whose every byte is fill — the suites' stand-in for a real one.
func TestDirectoryStore ¶
TestDirectoryStore runs the contract every directory store keeps: the store assigns each publisher the first free /24 of the tailnet range by address order — unique across publishers, stable per ISD-AS across re-publications, the claimed overlay ignored — beside host entries that round-trip, a re-registration that replaces, and a deletion that removes exactly the entry its key names.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is the in-memory directory-store double the suites share: publish assigns slices the store's way, host entries record keyed by their public key and delete by it, and Seed records a node entry verbatim — the fixture form that names its own slice.
func (*MemStore) DeleteHost ¶ added in v0.0.7
DeleteHost removes the host entry keyed by the public key; an absent key deletes nothing.
func (*MemStore) Publish ¶
Publish records the entry, keyed by its ISD-AS, assigning its slice the store's way.
func (*MemStore) PublishHost ¶
PublishHost records the host entry, keyed by its public key.