[PR #1458] [MERGED] code reorg part 2, the database #2134

Closed
opened 2025-12-29 03:19:54 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1458
Author: @kradalby
Created: 5/11/2023
Status: Merged
Merged: 5/26/2023
Merged by: @kradalby

Base: mainHead: codereorg-p2


📝 Commits (2)

📊 Changes

77 files changed (+8473 additions, -7927 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 cmd/headscale/cli/api_key.go (+2 -2)
📝 cmd/headscale/cli/debug.go (+2 -2)
📝 cmd/headscale/cli/nodes.go (+4 -4)
📝 cmd/headscale/cli/routes.go (+2 -2)
📝 cmd/headscale/cli/users.go (+2 -4)
📝 cmd/headscale/cli/utils.go (+7 -3)
📝 cmd/headscale/headscale_test.go (+3 -2)
hscontrol/acls_test.go (+0 -2129)
📝 hscontrol/api.go (+11 -11)
📝 hscontrol/api_common.go (+8 -6)
hscontrol/api_key.go (+0 -157)
📝 hscontrol/app.go (+103 -122)
📝 hscontrol/config.go (+8 -7)
hscontrol/db.go (+0 -404)
hscontrol/db/acls_test.go (+480 -0)
hscontrol/db/addresses.go (+99 -0)
📝 hscontrol/db/addresses_test.go (+40 -44)
hscontrol/db/api_key.go (+125 -0)
📝 hscontrol/db/api_key_test.go (+25 -17)

...and 57 more files

📄 Description

This is a massive commit that restructures the code into modules:

db/
All functions related to modifying the Database

types/
All type definitions and methods that can be exclusivly used on
these types without dependencies

policy/
All Policy related code, now without dependencies on the Database.

policy/matcher/
Dedicated code to match machines in a list of FilterRules

Signed-off-by: Kristoffer Dalby kristoffer@tailscale.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/1458 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 5/11/2023 **Status:** ✅ Merged **Merged:** 5/26/2023 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `codereorg-p2` --- ### 📝 Commits (2) - [`92a7b8e`](https://github.com/juanfont/headscale/commit/92a7b8e30ff3812d37d89605227eace705861a7b) create DB struct - [`8c4e46a`](https://github.com/juanfont/headscale/commit/8c4e46aaf73b46f3e88f9ad7ab441545affb9d61) Split code into modules ### 📊 Changes **77 files changed** (+8473 additions, -7927 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `cmd/headscale/cli/api_key.go` (+2 -2) 📝 `cmd/headscale/cli/debug.go` (+2 -2) 📝 `cmd/headscale/cli/nodes.go` (+4 -4) 📝 `cmd/headscale/cli/routes.go` (+2 -2) 📝 `cmd/headscale/cli/users.go` (+2 -4) 📝 `cmd/headscale/cli/utils.go` (+7 -3) 📝 `cmd/headscale/headscale_test.go` (+3 -2) ➖ `hscontrol/acls_test.go` (+0 -2129) 📝 `hscontrol/api.go` (+11 -11) 📝 `hscontrol/api_common.go` (+8 -6) ➖ `hscontrol/api_key.go` (+0 -157) 📝 `hscontrol/app.go` (+103 -122) 📝 `hscontrol/config.go` (+8 -7) ➖ `hscontrol/db.go` (+0 -404) ➕ `hscontrol/db/acls_test.go` (+480 -0) ➕ `hscontrol/db/addresses.go` (+99 -0) 📝 `hscontrol/db/addresses_test.go` (+40 -44) ➕ `hscontrol/db/api_key.go` (+125 -0) 📝 `hscontrol/db/api_key_test.go` (+25 -17) _...and 57 more files_ </details> ### 📄 Description This is a massive commit that restructures the code into modules: `db/` All functions related to modifying the Database `types/` All type definitions and methods that can be exclusivly used on these types without dependencies `policy/` All Policy related code, now without dependencies on the Database. `policy/matcher/` Dedicated code to match machines in a list of FilterRules Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:19:54 +01:00
adam closed this issue 2025-12-29 03:19:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2134