mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
22 lines
856 B
Go
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)]
|