From 1d5cf6a8aaec9f5dec5d4217c5a42370d0c45c87 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Thu, 12 Dec 2024 21:50:41 +0000 Subject: [PATCH] gnu: Add go-github-com-jackc-chunkreader. * gnu/packages/golang-xyz.scm (go-github-com-jackc-chunkreader, go-github-com-jackc-chunkreader-v2): New variables. Change-Id: I8a7c9a20fec268b21cd211d2ea0a259cd26ef97c --- gnu/packages/golang-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm index 87163d38dafb4c3ee1a324f9f652e0c119d90544..18b0152e72da097a6f77bb56c4870070b610e2f4 100644 --- a/gnu/packages/golang-xyz.scm +++ b/gnu/packages/golang-xyz.scm @@ -4673,6 +4673,52 @@ ABI}.") time strings.") (license license:expat))) +(define-public go-github-com-jackc-chunkreader + (package + (name "go-github-com-jackc-chunkreader") + (version "1.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jackc/chunkreader") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0zsxsd6alk51lssq1xq194sf88awj083fjiy7pk3098v2nj9m65l")))) + (build-system go-build-system) + (arguments + (list + #:import-path "github.com/jackc/chunkreader")) + (home-page "https://github.com/jackc/chunkreader") + (synopsis "Wrapper for @code{io.Reader}") + (description + "ChunkReader is a @code{io.Reader} wrapper that minimizes IO reads and +memory allocations. It allocates memory in chunks and will read as much as +will fit in the current buffer in a single call regardless of how large a read +is actually requested. The memory returned via Next is owned by the caller. +This avoids the need for an additional copy. It extracted from original +implementation in https://github.com/jackc/pgx.") + (license license:expat))) + +(define-public go-github-com-jackc-chunkreader-v2 + (package + (inherit go-github-com-jackc-chunkreader) + (name "go-github-com-jackc-chunkreader-v2") + (version "2.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jackc/chunkreader") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0fj585hp3s4cjfzncr5gmim96p0b956pqdf4nm7yan1ipfch9l1c")))) + (arguments + (list + #:import-path "github.com/jackc/chunkreader/v2")))) + (define-public go-github-com-jackc-pgio (package (name "go-github-com-jackc-pgio")