Documentation
¶
Index ¶
Constants ¶
const ( EnvPrefix = "ZDNS" DefaultFilePermissions = 0644 // rw-r--r-- DefaultDNSPort = "53" DefaultHTTPSPort = "443" DefaultTLSPort = "853" InvalidPortErrorMsg = "invalid port" )
Variables ¶
This section is empty.
Functions ¶
func Concat ¶
func Concat[S ~[]E, E any](slices ...S) S
Concat returns a new slice concatenating the passed in slices.
Avoids a gotcha in Go where since append modifies the underlying memory of the input slice, doing newSlice := append(slice1, slice2) can modify slice1. See https://go.dev/doc/effective_go#append A std. library concat was added in go 1.22, but this is for backwards compatibility. https://pkg.go.dev/slices#Concat This is mostly similiar to the std. library concat, but with a few differences so it compiles on go 1.20.
func Contains ¶
func Contains[T comparable](slice []T, entity T) bool
Contains checks if a value is in a slice. Performance note: if you're going to be making multiple calls to Contains, it is much more performant to create a map of the slice to get O(1) lookups. This is for one-off lookups.
func HasCtxExpired ¶
HasCtxExpired checks if the context has expired. Common function used in various places.
func IsStringValidDomainName ¶
IsStringValidDomainName checks if the given string is a valid domain name using regex
Types ¶
This section is empty.