<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pakakeh.go, branch v0.53.0</title>
<subtitle>Collections of packages and tools for working with Go programming language.</subtitle>
<id>http://git.kilabit.info/pakakeh.go/atom?h=v0.53.0</id>
<link rel='self' href='http://git.kilabit.info/pakakeh.go/atom?h=v0.53.0'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/'/>
<updated>2024-02-03T17:30:14Z</updated>
<entry>
<title>Release share v0.53.0 (2024-02-04)</title>
<updated>2024-02-03T17:30:14Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-02-03T07:35:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=d972ea84e709ba5b1a141be01babeb442269ae11'/>
<id>urn:sha1:d972ea84e709ba5b1a141be01babeb442269ae11</id>
<content type='text'>
===  New features

* test/mock: implement mock for crypto [rand.Reader]

  The RandReader implement [io.Reader].
  To provide predictable result, the RandReader is seeded with slice of
  bytes.
  A call to Read will fill the passed bytes with those seed.

  For example, given seed as "abc" (length is three), calling Read with
  bytes length five will return "abcab".

* lib/sql: add new type Meta

  Meta contains the DML meta data, including driver name, list of column
  names, list of column holders, and list of values.
  The Meta type replace the Row type.

* lib/path: new package to work with path

  The path package provide a new type Route, detached from "lib/http".

  A Route represent a parsed path.
  A path can have a key, or binding, that can be replaced with string
  value.
  For example, "/org/:user/:repo" have two keys "user" and "repo".

  Route handle the path in case-insensitive manner.

===  Bug fixes

* _bin/go-mod-tip: use committer timestamp instead of author timestamp

  If the tip is rebased to upstream, the author timestamp is not
  changes, but the commit timestamp changes.

===  Enhancements

* lib/totp: add method GenerateWithTime and GenerateNWithTime

  The GenerateWithTime and GenerateNWithTime accept parameter
  [time.Time] as the relative time for generated password.

* lib/http: add support for If-Modified-Since in HandleFS

  If the node modification time is less than requested time value in
  request header If-Modified-Since, server will response with
  304 Not Modified.

* lib/http: refactoring Range request, limit content served by server

  When server receive,

    GET /big
    Range: bytes=0-

  and the requested resources is quite larger, where writing all content
  of file result in i/o timeout, it is best practice [1][2] if the
  server write only partial content and let the client continue with the
  subsequent Range request.

  In the above case, the server should response with,

    HTTP/1.1 206 Partial content
    Content-Range: bytes 0-&lt;limit&gt;/&lt;size&gt;
    Content-Length: &lt;limit&gt;

  Where limit is maximum packet that is reasonable [3] for most of the
  client.
  In this server we choose 8MB as limit.

* lib/http: add method Head to Client

  The Head method send the HEAD request to path, with optional
  headers, and params in query parameters.

* lib/ini: add method Keys::

  The Keys method return sorted list of all section, subsection, and
  variables as string where each of them separated by ":", for example
  "section:sub:var".
</content>
</entry>
<entry>
<title>lib/memfs: protect internal [DirWatcher.fileWatcher] with mutex</title>
<updated>2024-02-03T17:29:34Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-02-03T11:59:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=0e5a09c952e7775f5b6e82f9f94d81eb977c2d5e'/>
<id>urn:sha1:0e5a09c952e7775f5b6e82f9f94d81eb977c2d5e</id>
<content type='text'>
This is to fix several flaky tests on ExampleDirWatcher [1].

[1] https://github.com/shuLhan/share/actions/runs/7765975142
[2] https://github.com/shuLhan/share/actions/runs/7672754239
</content>
</entry>
<entry>
<title>lib/memfs: fix flaky test on [Memfs.Get] with refresh</title>
<updated>2024-02-03T09:21:34Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-02-03T08:58:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=0bdc54f2a7a3b2d685b083675856631d967eb17b'/>
<id>urn:sha1:0bdc54f2a7a3b2d685b083675856631d967eb17b</id>
<content type='text'>
The test is flaky because we use range over map of [tdata.Input].
Since range over map will return random key, there is possibility that
the first test is writing "/dir-a/dir-b/file2" not "/dir-a/dir-b/file".
</content>
</entry>
<entry>
<title>lib/sql: refactor WhereFields to join where condition with holder as is</title>
<updated>2024-01-30T12:13:22Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-30T12:13:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=734d077775cee01f2b8b6fd53ad919e824ad6d1e'/>
<id>urn:sha1:734d077775cee01f2b8b6fd53ad919e824ad6d1e</id>
<content type='text'>
When binding parameter with BindWhere, the first parameter will be joined
with the holder. For example, BindWhere("colname&gt;=", p) will result in
"colname&gt;=$1".

While at it, set offset based on [Meta.kind].
</content>
</entry>
<entry>
<title>lib/totp: add method GenerateWithTime and GenerateNWithTime</title>
<updated>2024-01-29T16:49:25Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-29T16:49:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=ec2b46e7780a73026d822aef18bbf66525ae3c43'/>
<id>urn:sha1:ec2b46e7780a73026d822aef18bbf66525ae3c43</id>
<content type='text'>
The GenerateWithTime and GenerateNWithTime accept parameter
[time.Time] as the relative time for generated password.
</content>
</entry>
<entry>
<title>test/mock: implement mock for crypto [rand.Reader]</title>
<updated>2024-01-28T19:43:44Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-28T19:42:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=e33a335cd730748517b0bcde34c68e982205f5fa'/>
<id>urn:sha1:e33a335cd730748517b0bcde34c68e982205f5fa</id>
<content type='text'>
The RandReader implement [io.Reader].
To provide predictable result, the RandReader is seeded with slice of
bytes.
A call to Read will fill the passed bytes with those seed.

For example, given seed as "abc" (length is three), calling Read with
bytes length five will return "abcab".
</content>
</entry>
<entry>
<title>lib/sql: remove type Table</title>
<updated>2024-01-26T20:07:32Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-26T19:54:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=137d8746c608a19c14f619fc796241d4c416e812'/>
<id>urn:sha1:137d8746c608a19c14f619fc796241d4c416e812</id>
<content type='text'>
This type has never been used and the implementation is not correct.
</content>
</entry>
<entry>
<title>lib/sql: support update, bind where condition, and subquery in Meta</title>
<updated>2024-01-26T20:07:32Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-26T19:45:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=24269c23942843c8193998a75882e22111c333ac'/>
<id>urn:sha1:24269c23942843c8193998a75882e22111c333ac</id>
<content type='text'>
This changes add parameter kind to NewMeta, which define the kind of
DML to be mapped by Meta.

The method Add renamed to Bind, and AddWhere renamed to BindWhere.

New methods added to Meta,

  - Sub return the child of Meta for building subquery,
  - UpdateValues return the merged of ListValue and ListWhereValue
    for DML UPDATE
  - WhereFields return string that merge the ListWhereCond and ListHolder
    separated by "="
</content>
</entry>
<entry>
<title>lib/sql: add method WhereHolder to Meta type</title>
<updated>2024-01-25T14:09:00Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-25T14:07:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=c35eafe48695c6b8de34ebd6b64c4afa28940f34'/>
<id>urn:sha1:c35eafe48695c6b8de34ebd6b64c4afa28940f34</id>
<content type='text'>
The WhereHolder method generate string of holder, for example "$1,$2,...",
based on number of item added with [Meta.AddWhere].
Similar to method Holders but for where condition.
</content>
</entry>
<entry>
<title>lib/path: add method Keys and NKey, and export IsKeyExists</title>
<updated>2024-01-25T11:13:29Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-01-25T11:13:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=f9b7b2734bb52da14bf908a89a1c75b71d51471d'/>
<id>urn:sha1:f9b7b2734bb52da14bf908a89a1c75b71d51471d</id>
<content type='text'>
The Keys method return list of key in path.
The NKey method return the number of key in path.
The IsKeyExists return true if the key exist in Route; otherwise it
will return false.
</content>
</entry>
</feed>
