Restructure database config (#1700)

This commit is contained in:
Kristoffer Dalby 2024-02-09 07:27:00 +01:00 committed by GitHub
parent 00e7550e76
commit 94b30abf56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 180 additions and 114 deletions

View file

@ -12,7 +12,11 @@ import (
"tailscale.com/tailcfg"
)
const SelfUpdateIdentifier = "self-update"
const (
SelfUpdateIdentifier = "self-update"
DatabasePostgres = "postgres"
DatabaseSqlite = "sqlite3"
)
var ErrCannotParsePrefix = errors.New("cannot parse prefix")
@ -154,7 +158,9 @@ func (su *StateUpdate) Valid() bool {
}
case StateSelfUpdate:
if su.ChangeNodes == nil || len(su.ChangeNodes) != 1 {
panic("Mandatory field ChangeNodes is not set for StateSelfUpdate or has more than one node")
panic(
"Mandatory field ChangeNodes is not set for StateSelfUpdate or has more than one node",
)
}
case StateDERPUpdated:
if su.DERPMap == nil {