aboutsummaryrefslogtreecommitdiff
path: root/README.md
AgeCommit message (Collapse)Author
2026-02-08_doc: split the changelog for 2025Shulhan
While at it, use consistent title in the changelog files.
2026-02-06_doc: fix typo on RFC 4686 "Analysis of Threats Motivating DKIM"Shulhan
2026-01-25README: fix broken link and simplify license sectionShulhan
2026-01-13README: format the file using prettierShulhan
2026-01-03all: use SPDX license header formatShulhan
2025-07-02_doc: merge index.adoc into README.mdShulhan
Also, use the README as the index. This allow us to us the _doc directory to be served under https://kilabit.info/project/pakakeh.go
2025-01-25lib/hunspell: rename the package to "_hunspell"Shulhan
The hunspell is still in progress and we did not have time to continue it, so we rename it to _hunspell to prevent it being checked by linters or being imported.
2025-01-06Release pakakeh.go v0.59.0 (2025-01-06)v0.59.0Shulhan
This is the first release of pakakeh.go on the year 2025. There are many new features and cleaning up, including packages that merged into single package with help of type parameters. The first major changes is indicated by using "go 1.23.4" as minimum Go version in this module, to allow us using new packages like "slices" and "maps". In this release notes, we try new format. Instead of grouping each changes by Breaking changes, New features, Bug fixes, Enhancements, and/or Chores; we group them by package. Each paragraph in the package sections will be prefixed with tag "[BREAKING CHANGE]", "[NEW FEATURE]", "[BUG FIX]", "[ENHANCEMENT]", "[CHORE]" to indicates the type of changes. === lib/binary The "lib/binary] is new package that complement the standard binary package. [NEW FEATURE] Implement append-only binary that encode the data using [binary.Writer]. We call them "Apo" for short. [NEW FEATURE] Implement buffer for reading/writing in BigEndian. The BigEndianBuffer provides backing storage for writing (most of) Go native types into binary in big-endian order. The zero value of BigEndianBuffer is an empty buffer ready to use. The following basic types are supported for Write and Read: bool, byte, int, float, complex, and string. The slice and array are also supported as long as the slice’s element type is one of basic types. === lib/bytes [BREAKING CHANGE] In the "lib/bytes" we split the hexdump related functions to separate package, "lib/hexdump". === lib/floats64 [BREAKING CHANGE] This package has been removed, merged into "slices" package. === lib/hexdump [NEW FEATURE] Package hexdump implements reading and writing bytes from and into hexadecimal number. It support parsing output from hexdump(1) tool. === lib/http [NEW FEATURE] In the [lib/http.Client] we add new method Transport that return default HTTP Transport. The returned [http.Transport] is created after the Client instantiated. Their value can be customized by user when needed, which should affect the Transport inside the Client. === lib/ints [BREAKING CHANGE] This package has been removed, merged into "slices" package. === lib/ints64 [BREAKING CHANGE] This package has been removed, merged into "slices" package. === lib/memfs [ENHANCEMENT] In the "lib/memfs" we refactoring the Watch method to use the new "watchfs/v2" package. [BREAKING CHANGE] The old Watcher and DirWatcher types now moved to watchfs package. This changes require exporting method [memfs.MemFS.UpdateContent]. === lib/numbers [CHORE] In the package level, we remove unused README and LICENSE files. This package README has been merged into the package documentation and the LICENSE is same with the module one. We also remove some package documentation that should be in "lib/slices". === lib/play [NEW FEATURE] The [lib/play] now has function and HTTP handler to run Go test code. Since the test must run inside the directory that contains the Go file to be tested, the [HTTPHandleTest] API accept the following request format, { "goversion": <string>, "file": <string>, "body": <string>, "without_race": <boolean> } The "file" field define the path to the "_test.go" file, default to "test_test.go" if its empty. The "body" field contains the Go code that will be saved to "file". The test will run, by default, with "go test -count=1 -race $dirname" where "$dirname" is the path directory to the "file" relative to where the program is running. If "without_race" is true, the test command will not run with "-race" option. [ENHANCEMENT] On package level, the home and cache directory now initialized on package init since there are never changes when program running. If Go failed to get the home and cache it will be set to system temporary directory. [ENHANCEMENT] We also simplify running Go code by removing the field pid in the struct command that wait for process ID. Instead we execute cmd with Run directly. In the Run function, we use the UnsafeRun to store temporary directory and move the statements that writes go.mod and main.go into the method writes of Request. This remove unnecessary unsafeRun function. === lib/reflect [BREAKING CHANGE] This release changes the Equal signature from "Equal(v any) bool" to "Equal(v any) error". The reason for this changes is to force the method to return an error message that is understand-able by caller. === lib/slices [NEW FEATURE] Package "lib/ints", "lib/ints64", and "lib/floats64" are merged into "slices". Now that Go has type parameter, we can use it to use the same function that accept different types for working with slice of int, int64, and float64. === lib/ssh [ENHANCEMENT] In the lib/ssh, we implement Run with context internally. Instead of depends on fork of crypto with CL that needs proposal, we implement them in here so we can update crypto module to the latest release. === lib/watchfs The watchfs package now contains the original, v1, of the Watcher and DirWatcher types from "lib/memfs". === lib/watchfs/v2 [NEW FEATURE] The "lib/watchfs/v2" is the new package that implement new file and directory watcher, that replace the Watcher and DirWatcher in the "lib/memfs". The new implementation, FileWatcher, much more simple than what we have in [memfs.Watcher]. The new directory watcher, DirWatcher, scan the content of directory in [fs.DirWatcherOptions.Root] recursively for the files to be watched, using the [fs.DirWatcherOptions.Includes] field. A single file, [fs.DirWatcherOptions.FileWatcherOptions.FilePath], will be watched for changes that trigger re-scanning the content of Root recursively. The result of re-scanning is list of the Includes files (only files not new directory) that are changes, which send to channel C. On each [os.FileInfo] received from C, a deleted file have [os.FileInfo.Size] equal to [NodeFlagDeleted]. The channel send an empty slice if no changes. The implementation of file changes in this code is naive, using loop and comparison of mode, modification time, and size; at least it should works on most operating system.
2024-12-29all: update READMEShulhan
Add and remove missing packages under api/, program under cmd/, and library under lib/ directory.
2024-12-29all: merge package "lib/ints" and "lib/ints64" into "slices"Shulhan
Now that Go has type parameter, we can use it to use the same function that accept different types for working with slice of int, int64.
2024-12-28lib/bytes: split the hexdump related functions to separate packageShulhan
Package hexdump implements reading and writing bytes from and into hexadecimal number. It support parsing output from hexdump(1) tool.
2024-12-28lib/binary: implement append-only binary fileShulhan
The binary is new package that complement the standard binary package Currently it implement append-only binary that encode the data using [binary.Writer]. We call them "Apo" for short.
2024-12-28lib/memfs: move the old Watcher and DirWatcher to watchfsShulhan
The watchfs package now contains the original, v1, of the Watcher and DirWatcher types. This changes require exporting method [memfs.MemFS.UpdateContent].
2024-12-28watchfs/v2: implement new file watcherShulhan
The watchfs package contains new FileWatcher, more simple than what we have in [memfs.Watcher].
2024-06-18all: update the git file linksShulhan
Replace link with master branch to main branch.
2024-03-09_doc: rename the share module to "pakakeh.go"Shulhan
2024-03-09lib: move package "ssh/config" to "lib/sshconfig"Shulhan
Previously the "ssh/config" is used by the parent package "ssh" and "ssh/sftp" which is break the rule of package layer (the top package should be imported by sub package, not the other way around).
2024-03-09lib: move package "net/html" to "lib/html"Shulhan
Putting "html" under "net" package make no sense. Another reason is to make the package flat under "lib/" directory.
2024-03-02all: move the repository to "git.sr.ht/~shulhan/pakakeh.go"Shulhan
There are several reasons that why we move from github.com. First, related to the name of package. We accidentally name the package with "share" a common word in English that does not reflect the content of repository. By moving to other repository, we can rename it to better and unique name, in this "pakakeh.go". Pakakeh is Minang word for tools, and ".go" suffix indicate that the repository related to Go programming language. Second, supporting open source. The new repository is hosted under sourcehut.org, the founder is known to support open source, and all their services are licensed under AGPL, unlike GitHub that are closed sources. Third, regarding GitHub CoPilot. The GitHub Terms of Service [1], allow any public content that are hosted there granted them to parse the content. On one side, GitHub helps and flourish the open source, but on another side have an issues regarding scraping the copyleft license [2]. [1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us [2]: https://githubcopilotinvestigation.com
2023-12-13lib/io: removed, this package has been merged into lib/osShulhan
While some functions are merged to lib/os, some are not used anymore like io.Reader.
2023-12-13lib/parser: removed, this package has been merged into lib/stringsShulhan
2023-06-04all: update description of some command and in READMEShulhan
Mention that some of the commands are example of implementation of the library.
2023-05-18all: convert README from Asciidoc to MarkdownShulhan
I use two remote repositories: GitHub and SourceHut. GitHub support rendering README using asciidoc while SourceHut not. This cause the repository that use README.adoc rendered as text in SourceHut which make the repository page less readable. Also, the pkg.go.dev now render README but only support Markdown. Since we cannot control the SourceHut and go.dev, the only option is to support converting Markdown in ciigo so I can write README using Markdown and the rest of documentation using Asciidoc.
2022-08-25_doc: cleaning up the documentationShulhan
In the _doc, we remove generated HTML files. In the index, we add link to README and section about Development that include links to repository, issues, and patches. In the README, we reformat it to use AsciiDoc markup, remove the sanitizer library, add CLI for epoch, ini, and xtrk.
2021-07-12ssh/sftp: new package that implement SSH File Transport Protocol v3Shulhan
The sftp package extend the golang.org/x/crypto/ssh package by implementing "sftp" subsystem using the ssh.Client connection.
2021-05-03Release share v0.26.0 (2021-05-03)v0.26.0Shulhan
=== New features * math/big: add method Add, IsLess, IsGreater, and Scan on Int The Add method simplify addition of one value to current Int. The IsLess and IsGreater method simplify comparing Int with any value. The Scan method allow the Int to be used on sql Scan(). * math/big: add method IsZero on Int The IsZero method will return true if the current i value is zero. * big: extends the standard big.Int The standard big.Int does not implement sql/driver.Valuer interface, which make it not usable when querying or doing update/insert with database. This commit extend the big.Int and simplify creating new Int from any values using NewInt(). Also, make it support marshal/unmarshal JSON === Enhancements * sql: make the column filename on table _migration as primary key This will allow deleting the record by filename instead of requiring all columns. * http: add the Total field to EndpointResponse The Total field contains the total number of all records, while the Count fields only contains the total number of records in Data. * http: add field Page to EndpointResponse The page field contains the requested page on current response. If page is from request then the offset will be set to page times limit. While at it, move the field comment to its declaration. * big: allow creating new Rat from uint64 and *big.Int * ssh: check for empty private key file on Get and Put If the private key file is empty, skip it for being added as parameter of scp command. This is to prevent warning message on user side. === Chores * memfs: update the test ContentType for JavaScript files The latest Go set the content type for JavaScript file as "text/javascript; charset=utf-8", not "application/javascript". * paseto: replace le64() function with binary.Write() The le64() return the string representation of uint64 in little endian, which is basically binary.Write with parameter output buffer, LittleEndian, and input value.
2021-01-31lib/clise: new package that implement circular sliceShulhan
A circular slice is a slice that have fixed size. An append to slice that has reached its length will overwrite and start again from index 0. For example, a clise with size 5, c := clise.New(5) c.Push(1, 2, 3, 4, 5) fmt.Printf("%v\n", c.Slice()) // [1 2 3 4 5] If we push another item, it will overwrite the first index, c.Push(6) fmt.Printf("%v\n", c.Slice()) // [6 2 3 4 5] See the examples for usage of the package.
2020-12-23cmd: add new CLI "totp"Shulhan
The totp is a program to generate Time-based One-time Password from secret key.
2020-12-06Release share v0.21.0 (2020-12-06)v0.21.0Shulhan
=== Breaking changes * test: refactoring Assert with better error message The new Assert function use the reflect.DoEqual that return an error which describe which field have unmatched value. === New features * http: allow Endpoint to register custom error handler The new field ErrorHandler on Endpoint allow the implementor to define their own function to handler error from Endpoint.Call. If the ErrorHandler is nil it will default to DefaultErrorHandler. * totp: new package that implement TOTP protocol Package totp implement Time-Based One-Time Password Algorithm based on RFC 6238. === Bug fixes * parser: fix Line method that always return non-empty line In case of content end without new line, for example "a\nb", the Line() method always return "b, 0" on the last line. * smtp: update the expired test certificate * websocket: create buffered channel for running queue. This is to fix Stop() method waiting for running channel to be consumed. === Enhancements * big: update the latest expected error message with Go tip * http: add an example on how to write custom HTTP status code The example show how to use http.ResponseWriter.WriteHeader to write custom HTTP status code instead of relying on errors.E. * net: always return the host name or IP on ParseIPPort. Previously, if the address is an IP address the returned value is empty, for example "127.0.0.1" will return empty host but with non-nil IP and port. This changes always return the host either as host name (the same as paremeter) or valid IP address. === Chores * all: replace the tasks to serve and generate docs using ciigo as library This way, one does not need to install ciigo binary, only require Go tools.
2020-12-06README: rewrite to make it readable on pkg.go.dev and sr.htShulhan
The "Documentation" section is moved as index.adoc on _doc directory.
2018-12-17all: convert documentation to asciidoc format using asciidoctorShulhan
2018-12-17lib/errors: new package for handling error with status codeShulhan
2018-12-16Add documentation for lib/httpShulhan
2018-11-29README: update the formattingShulhan
2018-11-29README: update with latest packages in libShulhan
2018-10-01Merge package "github.com/shuLhan/gontacts"Shulhan
2018-09-03Rename package file to io (leftover from e415810d)Shulhan
2018-09-03Rename package text to stringShulhan
2018-09-01[chore] Update documentationsShulhan
2018-08-12Update list of libraries and toolsShulhan
2018-05-11README: Include "ini" and "test" librariesShulhan
2018-03-31Add command line program to convert "/**/" comment into "//"Shulhan