Hooks
less than a minute
Hook Methods
onDNSRequestBefore(request)
Called before the DNS response is generated.
onDNSRequestAfter(request, response)
Called after the DNS response is generated.
request
: See https://pkg.go.dev/beryju.io/gravity/pkg/roles/dns/utils#DNSRequestresponse
: See https://pkg.go.dev/github.com/miekg/dns#Msg
Environment
gravity
Object
log(msg: any)
Logs a message to the stdout of the Gravity node this hook is run on.
node: string
The identifier of the node this hook is run on.
version: string
The version of Gravity on the node this hook is run on.
role
A reference to the Role instance this hook was triggered by.
net
Object
parseIP(ip: string, family: string)
Parse an IP address from the string ip
and return it as an array of bytes. family
determines if the IP should be parsed as IPv4 or IPv6.