dbtest

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dbtest holds the application directory store's contract tests, shared by every implementation the way the trust DB's are.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustKey

func MustKey(fill byte) wireguard.PublicKey

MustKey returns the public key whose every byte is fill — the suites' stand-in for a real one.

func TestDirectoryStore

func TestDirectoryStore(t *testing.T, open func(t *testing.T) wireguard.DirectoryStore)

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) Close

func (s *MemStore) Close() error

Close retires nothing; the double holds no resource.

func (*MemStore) DeleteHost added in v0.0.7

func (s *MemStore) DeleteHost(_ context.Context, key wireguard.PublicKey) error

DeleteHost removes the host entry keyed by the public key; an absent key deletes nothing.

func (*MemStore) List

List returns a snapshot of everything recorded.

func (*MemStore) Publish

func (s *MemStore) Publish(_ context.Context, entry wireguard.Entry) (wireguard.Entry, error)

Publish records the entry, keyed by its ISD-AS, assigning its slice the store's way.

func (*MemStore) PublishHost

func (s *MemStore) PublishHost(_ context.Context, entry wireguard.HostEntry) error

PublishHost records the host entry, keyed by its public key.

func (*MemStore) Seed

func (s *MemStore) Seed(entry wireguard.Entry)

Seed records a node entry verbatim, no assignment run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL