~shulhan/pakakeh.go

v0.58.0 3 months ago

Release pakakeh.go v0.58.0 (2024-10-06)

This release update the minimum Go module to 1.22.0, the last version
supported by Go tools.

=== Breaking changes

*  lib/http: remove writing StatusNoContent on ResponseTypeNode

   To make it consistent with RequestTypeNone, the ResponseTypeNone
   should not write any response header or HTTP status code. It will be
   handled manually by [Endpoint.Call].

=== New features

*  lib/play: new package for formatting and running Go code

   Package play provides callable APIs and HTTP handlers to format and
   run Go code, similar to Go playground, but using HTTP instead of
   WebSocket.

*  lib/http: add Server method to register handler by function

   The RegisterHandleFunc register a pattern with a handler, similar to
   [http.ServeMux.HandleFunc]. The pattern follow the Go 1.22 format:

   	[METHOD] PATH

   The METHOD is optional, default to GET. The PATH must not contains
   the domain name and space. Unlike standard library, variable in PATH
   is read using ":var" not "{var}". This endpoint will accept any
   content type and return the body as is; it is up to the handler to
   read and set the content type and the response headers.

   If the METHOD and/or PATH is already registered it will panic.

*  lib/bytes: add function AppendInt64 and AppendUint64

   The AppendInt64 append an int64 value into slice of byte. The
   AppendUint64 append an uint64 value into slice of byte.