Files
tailscale/ipn/ipnlocal/netmapcache/store_hooks.go
Claus Lensbøl 400247776e wip
Signed-off-by: Claus Lensbøl <[email protected]>
2026-11-23 16:39:35 -05:00

22 lines
856 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
package netmapcache
import (
"context"
"tailscale.com/feature"
"tailscale.com/types/logger"
)
// HookNewStore if set, overrides the default [FileStore]-based [NewStore]
// implementation. The hook receives the same dir argument as [NewStore] and
// must create the store if it does not already exist, as [NewStore] does.
var HookNewStore feature.Hook[func(ctx context.Context, dir string, logf logger.Logf) (Store, error)]
// HookOpenStore if set, overrides the default [FileStore]-based [OpenStore]
// implementation. The hook receives the same dir argument as [OpenStore] and
// must return (nil, nil) if no store exists at that path, as [OpenStore] does.
var HookOpenStore feature.Hook[func(ctx context.Context, dir string, logf logger.Logf) (Store, error)]