netdb
provides information about TCP/IP subsystem protocols and internet
services, all this in (pure) Go. By default, it uses its built-in database
instead of consulting /etc/protocols
, /etc/services
, and /etc/ethertypes
.
If needed, it can also consult these files, please see the examples in the
documentation.
The built-in database has been auto-generated from the etc/protocols
,
etc/ethertypes
, and etc/services
files courtesy of the
netbase package of the Debian project.
This netdb
package does not even try to slavishly replicate the POSIX C API;
instead, it attempts to be Go-ish. For instance, the C type servent
has simply
become the netdb.Service
type in order to avoid arcane POSIX-rooted type
names.
Please refer to the reference documentation for usage examples.
In some sense, this netdb
package picks up the baton from the
@dominikh/go-netdb package. However, it
is not a fork but was written from scratch, considering (at least some of) the
advice in issue #1 of the
go-netdb package.
netdb
is Copyright 2021-24 Harald Albrecht, and licensed under the Apache License,
Version 2.0.