mirror of
https://github.com/tailscale/tailscale.git
synced 2026-02-08 01:01:53 +01:00
This commit is based on part of #17925, reworked as a separate package. Add a package that can store and load netmap.NetworkMap values in persistent storage, using a basic columnar representation. This commit includes a default storage interface based on plain files, but the interface can be implemented with more structured storage if we want to later. The tests are set up to require that all the fields of the NetworkMap are handled, except those explicitly designated as not-cached, and check that a fully-populated value can round-trip correctly through the cache. Adding or removing fields, either in the NetworkMap or in the cached representation, will trigger either build failures (e.g., for type mismatch) or test failures (e.g., for representation changes or missing fields). This isn't quite as nice as automatically updating the representation, which I also prototyped, but is much simpler to maintain and less code. This commit does not yet hook up the cache to the backend, that will be a subsequent change. Updates #12639 Change-Id: Icb48639e1d61f2aec59904ecd172c73e05ba7bf9 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
20 lines
788 B
Nix
20 lines
788 B
Nix
# This is a shell.nix file used to describe the environment that
|
|
# tailscale needs for development.
|
|
#
|
|
# For more information about this and why this file is useful, see here:
|
|
# https://nixos.org/guides/nix-pills/developing-with-nix-shell.html
|
|
#
|
|
# Also look into direnv: https://direnv.net/, this can make it so that you can
|
|
# automatically get your environment set up when you change folders into the
|
|
# project.
|
|
(import (
|
|
let
|
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
in fetchTarball {
|
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
|
sha256 = lock.nodes.flake-compat.locked.narHash; }
|
|
) {
|
|
src = ./.;
|
|
}).shellNix
|
|
# nix-direnv cache busting line: sha256-+tOYqRV8ZUA95dfVyRpjnJvwuSMobu/EhtXxq4bwvio=
|