aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/server_example_test.go
AgeCommit message (Collapse)Author
2026-03-26lib/dns: refactoring DoT and DoH to use address instead of portShulhan
Using port makes the IP address of DoT and DoH listen on the same address with UDP. If we set ListenAddress to 0.0.0.0 and TLS termination is handled by proxy, this cause DoT and DoH will also listen on all addresses.
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2022-05-30lib/dns: move all caches operations from Server to Caches typeShulhan
Previously all caches operation are tied to the Server type. In order to separate the responsibilities between server and caches, we move all caches operations to Cache type.
2022-05-12all: rewrite all codes to use "var" instead of ":="Shulhan
Using ":=" simplify the code but we lose the type. For example, v := F() The only way we know what the type of v is by inspecting the function F. Another disadvantages of using ":=" may cause extra variables allocation where two or more variables with same type is declared inside body of function where it could be only one. While at it, we split the struct for test case into separate type.
2021-11-16lib/dns: refactoring, change signature of client LookupShulhan
Previously, Lookup() method on Client pass the question name, type, and class as parameters. This changes make those parameters into MessageQuestion.
2021-11-14lib/dns: refactoring, introduce new type RecordClassShulhan
Previously, the record class is represented by uint16 using prefix QueryClassXxx. This changes make the record class to be an independent type, to make code more strict (prevent passing invalid value), and readable.
2021-11-14lib/dns: refactoring, create type RecordType to represent type of RRShulhan
Previously, we use uint16 to represent type for ResourceRecord Type or Question type. To make the code more strict, where parameter or return value, must be expected as record type, we add new type to represent the RR type: RecordType. This changes also rename any variable name of QType or qtype to RType or rtype because QType is misleading. The type defined the ResourceRecord to be queried not only question.
2021-11-13lib/dns: use snake case for file namingShulhan
Using snake case make the file naming more readable.