Documentation
¶
Overview ¶
Package fqdn is an experimental, early-stage hostname compliancy checker which leverages the go-comply/comply suite of RFC compliance tools.
Synopsis ¶
The intent behind go-fqdn is to offer easy facilities to verify candidate FQDN byte sequences are compliant with one or more RFC-based standards. At this time go-comply/comply only offers RFC 1034 compliance checks, with at least one more RFC planned for release someday. Thus, this package shall stay under the terms supported by go-comply/comply.
Basic Example
package main
import (
"fmt"
"github.com/subcon42/go-fqdn"
)
func main() {
// Begin crafting our potential FQDN ...
raw := fqdn.NewFQDN(fqdn.NewLabel(`www`), fqdn.NewLabel(`example`), fqdn.NewLabel(`com`))
// Evaluate compliance result
if compliant, err := fqdn.RFC1034Compliant(raw); err != nil {
fmt.Println(err)
} else {
fmt.Printf("Is your hostname RFC 1034 Compliant? %t\n", compliant)
}
}
Credit ¶
Created and maintained by Jesse Coretta (subcon42)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompliancyReport ¶
func CompliancyReport(f [][]uint8)
CompliancyReport shall query go-comply/comply's Compliance Machine instance and execute all available Imperative functions for all listed sections. It is up to the user as to whether the final results truly constitute "failure".
Note this is a print-only method, nothing is returned. If returns are needed for evaluative reasons, use the RFC<XXXX>Compliant() methods instead.
func NewFQDN ¶
NewLabel produces a new GENERIC label array (also known as a "FQDN" or "Absolute Name") in the form of an array of uint8 arrays ([][]uint8). No compliance checks are done, thus one should be highly suspect of this object as-is.
func NewLabel ¶
NewLabel produces a new GENERIC label(also known as a "domain component") in the form of a uint8 array ([]uint8). No compliance checks are done, thus one should be highly suspect of this object as-is.
func RFC1034Compliant ¶
RFC1034Compliant shall query go-comply/comply's Compliance Machine instance and execute all available Imperative functions for all listed sections pertaining to RFC 1034 specifically.
A boolean is returned indicative of compliance. An non-nil error instance is returned when compliance checks fail, or if there was an internal error that prevents evaluation.
Types ¶
This section is empty.