From ceac4a8b1ee83af6d0c29528617adf7a02907bb4 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Tue, 31 May 2022 23:05:05 +0700 Subject: Release share v0.38.0 (2022-06-05) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- CHANGELOG.adoc | 115 +++++++++++++++++++++++++++++++ _doc/CHANGELOG.html | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 304 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index f4148a35..fa2ee594 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -1,11 +1,126 @@ = CHANGELOG Shulhan +31 May 2022 :toc: :sectanchors: :sectlinks: This library is released every month, usually at the first week of month. +[#v0_38_0] +== 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. +-- + +[#v0_38_0_enhancements] +=== 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. +-- + +[#v0_38_0_chores] +=== 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. +-- + + [#v0_37_0] == share v0.37.0 (2022-05-09) diff --git a/_doc/CHANGELOG.html b/_doc/CHANGELOG.html index 26506ef6..bb15b863 100644 --- a/_doc/CHANGELOG.html +++ b/_doc/CHANGELOG.html @@ -240,10 +240,18 @@ dd {
Shulhan

+31 May 2022
+

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.

    +
    +
    +
    +
  • +
+
+
+
+
+

share v0.37.0 (2022-05-09)

@@ -6247,7 +6435,7 @@ and several libraries.

-- cgit v1.3