import "code.pfad.fr/rvcodns"
package rvcodns provides a Go client for Release Version Check over DNS (RVCoDNS).
Output:
Example
¶
// SPDX-FileCopyrightText: 2023 Olivier Charvin <git@olivier.pfad.fr>
// SPDX-License-Identifier: CC0-1.0
package main
import (
"fmt"
"code.pfad.fr/rvcodns"
)
var domain = "example.rvcodns.pfad.fr"
func main() {
releases, err := rvcodns.LookupReleases(domain)
if err != nil {
panic(err) // network or parsing error (to handle)
}
for _, r := range releases {
fmt.Println(r.Version) // compare with own version (to inform the user about available updates)
}
}
1.2.3
DefaultResolver is the resolver used by the package-level LookupRelease function.
DKIMQuotedPrintableEncode encodes a strings as a DKIM-Quoted-Printable (RFC 6376) string.
See Value.String for decoding.
type Release struct { Version string // decoded version string Tags []Tag // raw tags in the order they appeared }
Release represents a release record
LookupReleases looks up and parses supported releases by DNS-querying _release.{domain}
LookupReleases uses context.Background internally; to specify the context, use Resolver.LookupReleases.
Parse parses a DNS records into a Release
Resolver allows to specify the LookupTXT function to use (usually net.DefaultResolver.LookupTXT)
LookupReleases looks up and parses supported releases by querying the DNS TXT "_release.{domain}" records.
Tag represents a key-value tag pair of the DNS record
Value represents a raw DNS value. Use Value.String to get the decoded value.
String parses the value as a DKIM-Quoted-Printable (RFC 6376) string. It removes whitespaces and decodes hex-octets "=XX".
See DKIMQuotedPrintableEncode for encoding.
encoding.go parse.go rvcodns.go
Path | Synopsis |
---|---|
cmd/dkim-encode-pairs | dkim-encode-pairs endodes key-value pairs for usage in [Release Version Check over DNS (RVCoDNS)]. |
cmd/get-releases | get-releases retrieves and prints out the currently supported releases using [Release Version Check over DNS (RVCoDNS)]. |
https://codeberg.org/pfad.fr/rvcodns
git clone
https://codeberg.org/pfad.fr/rvcodns.git git@codeberg.org:pfad.fr/rvcodns.git