| tag name | v0.38.0 (860496678efc889c467a5f1e92897e99a2cc0c58) |
| tag date | 2022-06-05 16:28:24 +0700 |
| tagged by | Shulhan <ms@kilabit.info> |
| tagged object | commit ceac4a8b1e... |
| download | pakakeh.go-0.38.0.tar.xz |
|---|
Release share v0.38.0 (2022-06-05)
This release update the minimum Go version to 1.17.
=== Breaking changes
* lib/dns: move all caches operations from Server to Caches type
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.
* lib/dns: change the Zone SOA field type from ResourceRecord to RDataSOA
Using the RDataSOA type directly minimize interface check and
conversion.
=== Enhancements
* lib/dns: replace Ticker with Timer on Caches’ worker
Since the worker call time.Now() inside the body, we can minimize it
by using Timer.
* lib/dns: export the Caches type and field on Server
The idea is move all server’s caches operations (methods) to this type
later.
* lib/dns: split storage between internal and external caches
Previously, the indexed caches for internal (records from hosts or zone
files) and external (records from parent name servers) are stored
inside single map.
This changes split those internal and external caches into two maps,
so any operation on one caches does not affect the other one, and vice
versa.
* lib/dns: return the removed record on caches RemoveCachesByRR
If the record being removed found on caches, it will return it;
otherwise it will return nil without error.
* lib/dns: disable JSON marshaling Zone Records field
On service that manage many zones, providing an API to fetch list of
zones only will return large payload if we include the Records field
in the response.
So, it is recommended to provide another API to fetch the records on
specific zone.
* lib/dns: print the field Value on ResourceRecord Stringer instead of rdlen
* lib/dns: export the zoneRecords type
Since the Zone type is exported and its contains exported field Records
with type zoneRecords, then that field type should also exported.
* lib/dns: return the deleted record on HostsFile RemoveRecord
Previously, the RemoveRecord method on HostsFile return a boolean true
if the record found.
This changes the return type to the ResourceRecord being deleted, to
allow the caller inspect and/or print the record.
=== Chores
* all: rewrite all codes to use "var" instead of ":="
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.
* lib/memfs: format comment in embedded Go template according to gofmt tip
In the next gofmt (Go v1.19), the comment format does not allow empty
lines "//" at the top and bottom of the comment.
This changes make the generated Go code from Embed method to match as
close as possible with output of gofmt.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEzvGqh+M3psOQ3lVQ+FB+6RSKTOMFAmKcd0IACgkQ+FB+6RSK
TOPzcQf/UngvoS5EEwSSEi08ZVdlf09iLpZvWDR5qfpDh7f4Rc1/VB+rT8QLYRt6
UPMNKc0H7WYVz6qB0/c+kRVN5QZjF3rASRuPxqTz8YlQCRyW3fFjLMAIUZL9uCAi
RMV1wiJt+J7yKeWJohxqEIhjke6xTwYAgYrmtXTSsne53DhDRGv1qzdDTNoqAUY5
TKxCOlFxnlPvSJ6TNRqpZ5kzkOP84YN5DovO7084Un5USTmIJl6aWdKo5EsXu+r/
Y87QMfX5HpLgMSl2yPg63iCFwNS0YwpAl2mFYlm4C+4n5QGP8CW2ffGHPgn4HmiN
jMmFd6OeIG+UjHKZTR0R1uk6F0iH/w==
=dyDl
-----END PGP SIGNATURE-----
