1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-10-10 11:14:24 +02:00
juanfont.headscale/hscontrol/db
Kristoffer Dalby 1553f0ab53 state: introduce state
this commit moves all of the read and write logic, and all different parts
of headscale that manages some sort of persistent and in memory state into
a separate package.

The goal of this is to clearly define the boundry between parts of the app
which accesses and modifies data, and where it happens. Previously, different
state (routes, policy, db and so on) was used directly, and sometime passed to
functions as pointers.

Now all access has to go through state. In the initial implementation,
most of the same functions exists and have just been moved. In the future
centralising this will allow us to optimise bottle necks with the database
(in memory state) and make the different parts talking to eachother do so
in the same way across headscale components.

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2025-06-24 07:58:54 +02:00
..
testdata hscontrol/db: add migration setting non existing pak on nodes to null (#2412) 2025-02-07 10:22:23 +01:00
api_key_test.go Replace the timestamp based state system 2023-09-19 10:20:21 -05:00
api_key.go Replace database locks with transactions (#1701) 2024-02-08 17:28:19 +01:00
db_test.go Redo route code (#2422) 2025-02-26 16:22:55 +01:00
db.go users: harden, test, and add cleaner of identifier (#2593) 2025-05-14 16:45:14 +02:00
ephemeral_garbage_collector_test.go Fix goroutine leak in EphemeralGC on node cancel (#2538) 2025-04-23 11:44:24 +02:00
ip_test.go Redo route code (#2422) 2025-02-26 16:22:55 +01:00
ip.go use tsaddr library and cleanups (#2150) 2024-10-02 09:06:09 +02:00
node_test.go policy: remove v1 code (#2600) 2025-05-20 13:57:26 +02:00
node.go state: introduce state 2025-06-24 07:58:54 +02:00
policy.go reformat code (#2019) 2024-07-22 08:56:00 +02:00
preauth_keys_test.go Return better web errors to the user (#2398) 2025-02-01 15:25:18 +01:00
preauth_keys.go Return better web errors to the user (#2398) 2025-02-01 15:25:18 +01:00
suite_test.go fix postgres migration issue with 0.24 (#2367) 2025-01-23 14:58:42 +01:00
text_serialiser.go use gorm serialiser instead of custom hooks (#2156) 2024-10-02 11:41:58 +02:00
users_test.go state: introduce state 2025-06-24 07:58:54 +02:00
users.go state: introduce state 2025-06-24 07:58:54 +02:00