aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2 daystext/diff: update comments on BytesRatioHEADmaindevShulhan
Explain the second and third return values: match and maxlen.
2 dayslib/uuid: return nil if ID is zeroShulhan
Per RFC 9562 Section 5.9, A Nil UUID value can be useful to communicate the absence of any other UUID value in situations that otherwise require or use a 128-bit UUID. A Nil UUID can express the concept "no such value here". Thus, it is reserved for such use as needed for implementation-specific situations. In case of SQL, the Value method should return nil if ID is zero.
2 dayslib/memfs: fix due to changes on [text/diff] packageShulhan
2 daystext/diff: skip writing Unified if no difference foundShulhan
2 dayslib/test: rewrite Assert to use [diff.Unified]Shulhan
Using diff Unified improve the test output readability when two large strings are not match.
3 daystext/diff: rename LevelWords to LevelChunksShulhan
Using Words seems like misleading since we capture the characters difference, not a word as in human language.
3 daystext/diff: rewrite TestText to test Files with LevelWordsShulhan
In the struct Data, we add new method WriteLineChunks to print the LineChunks data into [io.Writer] w.
3 daystext/diff: rename LineChange to LineChunkShulhan
In the struct Data we also rename field Changes to LineChunks.
3 daystext/diff: remove LineChangesShulhan
Defining []T as new type does not help on readability only make it confusing for future maintenances.
3 daystext/diff: add example for Files, Lines, Text, and UnifiedShulhan
While at it, - reorganize the order of functions alphabetically, following the order from doc. - changes the [Line.String] to print text in double quoted to help human compare the changes for non-printable characters.
3 daystext/diff: add an examples for Bytes and BytesRatioShulhan
While at it, rename the source file to reflect the content, instead of diffinterface.go name it func.go.
3 daystext/diff: stores the old and new file names for showing in WriteUnifiedShulhan
While at it, use consistent receiver "diff" for Data and return *Data from Text, Lines, Files, and Unified.
3 daystext/diff: replace IsEqual with [bytes.Equal]Shulhan
I cannot remember the use case for implementing IsEqual. Seems like the original purpose of IsEqual is to compare minimum length between two slices of bytes.
3 daystext/diff: implements unified diffShulhan
5 daystext/diff: refactoring to use local Line instead from text packageShulhan
The reason for refactoring is we will add more fields to the Line type to handle unified diff. In the ParseLines, we changes the line number to start from 1, to make it consistent with ReadLines and file line numbering. This causes a lot of changes in the expectation files in testdata.
7 dayslib/sql: remove JoinValues in favour of [slices.Concat]Shulhan
7 dayslib/sql: add method Meta to ClientShulhan
The Meta method returns new instance of [Meta] based on the current client driver and kind arugment. While at it, update comments on most methods to use adjectives.
8 dayslib/sql: refactoring the BindWhereShulhan
Changes the BindWhere parameters from two to four. The first parameter is the OR/AND logic. The second parameter is the column name. The third parameter is the operator like "=", "!=". The fourth parameter is the value.
9 dayslib/uuidv7: add tests for Equal and ValueShulhan
9 dayslib/uuidv7: add suffix Func to Now and RandShulhan
Using Func suffix to function variable is common coding styles in Go.
9 dayslib/uuidv7: remove the v7 suffix from typeShulhan
Adding suffix version to the type seems not right (and also mouthful to read) since the package already defines the version of UUID.
10 daysall: apply go fixShulhan
10 dayslib/uuidv7: add method IsEqualShulhan
This is to simplify checking for equality in if-condition.
10 dayslib/uuidv7: changes the value only when unmarshal or scan successShulhan
If the UUID value being unmarshaled or scanned is not valid, don't changes the current value.
11 daysRelease pakakeh.go v0.62.0 (2026-04-04)v0.62.0Shulhan
== cmd/httpdfs 🌱 Add option to set base path and shutdown idle duration The -base-path option set the URL prefix for serving HTTP request. The -shutdown-idle option set the duration when server will stop accepting new connections and shutting down. == lib/dns 🪵 lib/dns: refactoring DoT and DoH to use address instead of port Using port makes the IP address of DNS-over-TLS (DoT) and DNS-over-HTTPS (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 (the ports open to public). == lib/http 🌱 Add BasePath to the ServerOptions The BasePath allow server to serve HTTP from custom prefix, other than "/". Each request that server received will remove the BasePath first from the [http.Request.URL.Path] before passing to the handler. Each redirect that server sent will add the BasePath as the prefix to redirect URL. Any trailing slash in the BasePath will be removed. 🌱 Implement server auto shutdown when idle In the ServerOptions, we add option ShutdownIdleDuration when set to non-zero value it will start a timer. When the timer expired, the server will stop accepting new connection and then shutting down. This allow de-activating HTTP server when no connections received after specific duration to reduce the system resources. 🌼 lib/http: fix possible data race in SSE connection When server’s handler call Write or WriteRaw, there is possibility that the worker for keeping the connection alive also call Write at the same time, which cause the data race. == lib/paseto 🪵 Move paseto v2 under sub directory "v2" There are new versions of paseto standard: version 3 and version 4. To minimize conflicts in the future, we move the old implementation of paseto v2 to sub directory "v2" with package name "pasetov2". 🌱 lib/paseto/v4: new package that implements Paseto version 4 paseto/v4 provides a simple, ready to use, opinionated implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4 as defined in [paseto-v4]. [paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md == 🌱 lib/uuidv7 New package that implements UUID version 7. The uuidv7 package provides type UUIDv7 as the container for UUID version 7 that satisfy the [database/sql], [encoding/gob], and [encoding/json]. The implementation follow RFC 9562.
11 dayspaseto/v4: realign struct in testShulhan
This fix the following error detected by gocheck, public_mode_test.go:45:16: struct with 288 pointer bytes could be 264
11 dayslib/uuidv7: detect nil value on ScanShulhan
Column with NULL value will returns no error but zero UUID.
13 dayspaseto/v4: allow empty Footer and empty data in PayloadShulhan
If the footer is empty then the message will be unpacked with its own public key, instead of sender public key.
2026-03-31lib/paseto: move [Message.Unpack] to [v4.UnpackPublicToken]Shulhan
Unpacking v4 public protocol on parent package seems wrong. Only v4 package should know how to unpack it regarding the available fields in the Message.
2026-03-30lib/paseto: update v4 package doc and mark v2 as deprecatedShulhan
The paseto/v4 now can replace the previous paseto/v2 package.
2026-03-30lib/paseto: make the DriftSeconds changeableShulhan
This is to make user can increases or decreases the leeway during Payload Validate.
2026-03-30lib/paseto: rename the field Public and Private in PeerShulhan
2026-03-30lib/paseto: add unit tests for Payload and Message typesShulhan
2026-03-30paseto/v4: embed the Peer inside the PublicModeShulhan
This provides simple operation when working with Pack and Unpack.
2026-03-30paseto/v4: improve examples by splitting example and packageShulhan
By not using the same package name in example, we can see how the package actually used in real code. For instance, we can know that constant publicHeader should be exported so it could be used by Unpack method.
2026-03-30lib/paseto: predefines errors variablesShulhan
Instead of fixed strings, predefined the error variables so the caller can check the actual error.
2026-03-30paseto/v4: implements API to Pack and Unpack Message for PublicModeShulhan
The Pack method returns the signed [paseto.Message] as public token. The token then verified and decoded into Message using the Unpack method.
2026-03-30lib/paseto: store the time as Unix epoch inside PayloadShulhan
Previously, we use time.Time to store the value for ExpiredAt, NotBefore, and IssuedAt. Even thought this is allowed (see RFC 7519 section 2, NumericDate) but it is not a standard practices. This changes them to store Unix epoch with int64.
2026-03-29lib/paseto: move message, payload, footer, and key type from v2Shulhan
The [v2/PublicToken] has been moved and renamed as [paseto.Message]. The Data field in the Message is removed since its duplicate with [Payload.Data]. The [v2/JSONToken] has been moved and renamed as [paseto.Payload]. In the [Payload.Validate] method, we remove the validation for IssuedAt field, since its usage is to store the time the token is created. The Data field type in the Payload changes from string to any. The [v2/JSONFooter] has been moved and renamed as [paseto.Footer]. The type of Data field in Footer changes from map[string]any to any. The KID field in the Footer has been renamed to PeerID along with its json identifer. The [v2/Key] has been moved and renamed as [paseto.Peer].
2026-03-29paseto/v4: implements public protocol for paseto version 4Shulhan
paseto/v4 provides a simple, ready to use, opinionated implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4 as defined in [paseto-v4]. The public protocol contains method to sign and verify the message into/from paseto token. [paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md
2026-03-29paseto/v4: implements local protocol for paseto version 4Shulhan
paseto/v4 provides a simple, ready to use, opinionated implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4 as defined in [paseto-v4]. [paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md
2026-03-28_doc: add missing SPDX headers in changelog.cssShulhan
2026-03-28lib/paseto: move implementation to sub directory "v2"Shulhan
There are new versions of paseto standard: version 3 and version 4. To minimize conflicts in the future, we move the old implementation of paseto v2 to sub directory "v2" with package name "pasetov2". The paseto package now left with common functions, like creating pre-authentication encoding (PAE).
2026-03-27lib/ssh: set client config HostKeyAlgorithms from known_hosts filesShulhan
There is an issue with current SSH client implementation. Given a single host public key in the known_hosts file, host ssh-ed25519 key... Calling ssh.Dial(`tcp`, "host", ...) will return an error knownhosts: key mismatch from [handshakeTransport.enterKeyExchange], because only key "mlkem768x25519-sha256" is checked on the client side. This changes add DB interface for knownhosts that have two methods: - HostKeyAlgorithms: return the host key that matches in known_hosts based on the "host" name or address for [ssh.ClientConfig.HostKeyAlgorithms]. - HostKeyCallback: return the ssh.HostKeyCallback for [ssh.ClientConfig.HostKeyCallback].
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-03-26lib/uuidv7: implements method Value from [driver.Valuer]Shulhan
The Value method returns the value for sending it to the database.
2026-03-26lib/uuidv7: implement Equal method for [lib/reflect.Equaler]Shulhan
The Equal method returns nil if both receiver and parameter has the same value. This method implements [lib/reflect.Equaler] interface.
2026-03-10go.mod: set minimum Go to 1.26.0 and update all dependenciesShulhan
2026-03-10lib/uuidv7: new package that implements UUID version 7Shulhan
The uuidv7 package provides type UUIDv7 as the container for UUID version 7 that satisfy the [database/sql], [encoding/gob], and [encoding/json]. The implementation follow RFC 9562.
2026-02-15.github: set permissions contents to readShulhan
If a GitHub Actions job or workflow has no explicit permissions set, then the repository permissions are used. Repositories created under organizations inherit the organization permissions. The organizations or repositories created before February 2023 have the default permissions set to read-write. Often these permissions do not adhere to the principle of least privilege and can be reduced to read-only, leaving the write permission only to a specific types as "issues: write" or "pull-requests: write".