Pull request: websvc-config-manager

Merge in DNS/adguard-home from websvc-config-manager to master

Squashed commit of the following:

commit 2143b47c6528030dfe059172888fddf9061e42da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Oct 4 14:50:47 2022 +0300

    next: add config manager
This commit is contained in:
Ainar Garipov
2022-10-04 16:02:55 +03:00
parent c26ab190e7
commit fe8be3701f
35 changed files with 1286 additions and 279 deletions

View File

@@ -63,14 +63,6 @@ func Version() (v string) {
return version
}
// Constants defining the format of module information string.
const (
modInfoAtSep = "@"
modInfoDevSep = " "
modInfoSumLeft = " (sum: "
modInfoSumRight = ")"
)
// fmtModule returns formatted information about module. The result looks like:
//
// github.com/Username/module@v1.2.3 (sum: someHASHSUM=)
@@ -87,14 +79,16 @@ func fmtModule(m *debug.Module) (formatted string) {
stringutil.WriteToBuilder(b, m.Path)
if ver := m.Version; ver != "" {
sep := modInfoAtSep
sep := "@"
if ver == "(devel)" {
sep = modInfoDevSep
sep = " "
}
stringutil.WriteToBuilder(b, sep, ver)
}
if sum := m.Sum; sum != "" {
stringutil.WriteToBuilder(b, modInfoSumLeft, sum, modInfoSumRight)
stringutil.WriteToBuilder(b, "(sum: ", sum, ")")
}
return b.String()