Andrey Smirnov c55142668f feat: migrate grpc-middleware to v2, update deps
Update removing multiple old middlewares, rework
the way data is passed through the context, logging fields, etc.

Fix minimum keepalive interval enforcement.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-03-12 18:14:14 +04:00

28 lines
456 B
Go

// Copyright (c) 2024 Sidero Labs, Inc.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
package server
import (
"regexp"
)
var vRE = regexp.MustCompile(`^(v\d+\.\d+\.\d+\-?[^-]*)(.*)$`)
func parseVersion(v string) string {
m := vRE.FindAllStringSubmatch(v, -1)
if len(m) == 1 && len(m[0]) == 3 {
res := m[0][1]
if m[0][2] != "" {
res += "-dev"
}
return res
}
return "unknown"
}