From 0e66a23bf228b25c14a75b2a09725e03dee9dee5 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Thu, 7 Nov 2024 14:43:11 +0100 Subject: [PATCH] chore: update lubs --- flake.lock | 6 +- source/go.mod | 29 +- source/go.sum | 56 +- .../charmbracelet/lipgloss/.golangci-soft.yml | 8 +- .../charmbracelet/lipgloss/.golangci.yml | 2 - .../charmbracelet/lipgloss/README.md | 224 +++++- .../charmbracelet/lipgloss/color.go | 2 +- .../github.com/charmbracelet/lipgloss/set.go | 8 +- .../charmbracelet/lipgloss/style.go | 13 +- .../charmbracelet/lipgloss/unset.go | 8 + .../charmbracelet/x/ansi/background.go | 17 + .../github.com/charmbracelet/x/ansi/cursor.go | 79 +- .../github.com/charmbracelet/x/ansi/kitty.go | 36 +- .../github.com/charmbracelet/x/ansi/mode.go | 65 ++ .../charmbracelet/x/ansi/notification.go | 13 + .../github.com/charmbracelet/x/ansi/parser.go | 98 +-- .../x/ansi/parser/transition_table.go | 16 +- .../charmbracelet/x/ansi/parser_decode.go | 450 +++++++++++ .../charmbracelet/x/ansi/parser_sync.go | 26 + .../github.com/charmbracelet/x/ansi/screen.go | 13 +- .../github.com/charmbracelet/x/ansi/style.go | 348 +++++++-- .../charmbracelet/x/ansi/truncate.go | 69 +- .../github.com/charmbracelet/x/ansi/width.go | 52 +- .../github.com/charmbracelet/x/ansi/wrap.go | 182 +++-- .../github.com/charmbracelet/x/ansi/xterm.go | 17 + .../mattn/go-runewidth/runewidth_table.go | 323 ++++---- .../github.com/tdewolff/parse/v2/binary.go | 309 ++++++++ .../tdewolff/parse/v2/binary_unix.go | 91 +++ .../tdewolff/parse/v2/buffer/lexer.go | 5 +- .../github.com/tdewolff/parse/v2/common.go | 10 +- .../github.com/tdewolff/parse/v2/input.go | 5 +- .../libraries/go/application/xflags/.envrc | 5 +- .../go/application/xflags/.gitignore | 17 +- .../go/application/xflags/.gitlab-ci.yml | 60 +- .../go/application/xflags/devenv.lock | 62 +- .../go/application/xflags/devenv.nix | 6 +- .../go/application/xflags/devenv.yaml | 2 +- .../go/application/xflags/flake.lock | 181 +++++ .../libraries/go/application/xflags/flake.nix | 158 ++++ .../go/application/xflags/xflags.iml | 10 - .../libraries/go/utilities/data.git/.envrc | 2 + .../go/utilities/data.git/.gitignore | 389 +--------- .../go/utilities/data.git/.gitlab-ci.yml | 43 ++ .../go/utilities/data.git/CHANGELOG.md | 8 - .../go/utilities/data.git/CONTRIBUTING.md | 58 ++ .../libraries/go/utilities/data.git/LICENSE | 17 +- .../libraries/go/utilities/data.git/Makefile | 102 --- .../go/utilities/data.git/flake.lock | 181 +++++ .../libraries/go/utilities/data.git/flake.nix | 158 ++++ .../libraries/go/utilities/data.git/mem.prof | Bin 5525 -> 0 bytes .../libraries/go/utilities/data.git/parser.go | 3 + .../go/utilities/data.git/project.mk | 4 - .../go/utilities/data.git/release.json | 1 - .../go/utilities/data.git/transformer.go | 11 +- .../libraries/go/utilities/data.git/util.go | 19 +- .../go/utilities/pathfinder.git/.envrc | 2 + .../go/utilities/pathfinder.git/.gitignore | 155 ++++ .../utilities/pathfinder.git/.gitlab-ci.yml | 43 ++ .../utilities/pathfinder.git/CONTRIBUTING.md | 58 ++ .../go/utilities/pathfinder.git/LICENSE | 14 + .../go/utilities/pathfinder.git/README.md | 69 ++ .../go/utilities/pathfinder.git/error.go | 39 + .../go/utilities/pathfinder.git/find.go | 51 ++ .../go/utilities/pathfinder.git/flake.lock | 181 +++++ .../go/utilities/pathfinder.git/flake.nix | 158 ++++ .../go/utilities/pathfinder.git/get.go | 74 ++ .../utilities/pathfinder.git/pathfinder.iml | 12 + .../go/utilities/pathfinder.git/release.json | 1 + .../go/utilities/pathfinder.git/set.go | 293 +++++++ .../libraries/go/utilities/pathfinder/.envrc | 5 +- .../go/utilities/pathfinder/.gitlab-ci.yml | 60 +- .../go/utilities/pathfinder/devenv.lock | 190 ----- .../go/utilities/pathfinder/devenv.nix | 715 ------------------ .../go/utilities/pathfinder/devenv.yaml | 7 - .../libraries/go/utilities/pathfinder/find.go | 3 + .../go/utilities/pathfinder/flake.lock | 181 +++++ .../go/utilities/pathfinder/flake.nix | 158 ++++ .../libraries/go/utilities/pathfinder/get.go | 2 +- .../libraries/go/utilities/pathfinder/set.go | 2 +- source/vendor/golang.org/x/crypto/LICENSE | 4 +- source/vendor/golang.org/x/exp/LICENSE | 4 +- source/vendor/golang.org/x/net/LICENSE | 4 +- source/vendor/golang.org/x/sys/LICENSE | 4 +- source/vendor/golang.org/x/sys/unix/README.md | 2 +- .../vendor/golang.org/x/sys/unix/mkerrors.sh | 6 +- .../golang.org/x/sys/unix/syscall_aix.go | 2 +- .../golang.org/x/sys/unix/syscall_darwin.go | 49 ++ .../golang.org/x/sys/unix/syscall_hurd.go | 1 + .../golang.org/x/sys/unix/syscall_linux.go | 64 +- .../x/sys/unix/syscall_linux_arm64.go | 2 + .../x/sys/unix/syscall_linux_loong64.go | 2 + .../x/sys/unix/syscall_linux_riscv64.go | 2 + .../golang.org/x/sys/unix/syscall_openbsd.go | 1 + .../golang.org/x/sys/unix/vgetrandom_linux.go | 13 + .../x/sys/unix/vgetrandom_unsupported.go | 11 + .../x/sys/unix/zerrors_darwin_amd64.go | 12 + .../x/sys/unix/zerrors_darwin_arm64.go | 12 + .../golang.org/x/sys/unix/zerrors_linux.go | 51 +- .../x/sys/unix/zerrors_linux_386.go | 7 + .../x/sys/unix/zerrors_linux_amd64.go | 7 + .../x/sys/unix/zerrors_linux_arm.go | 7 + .../x/sys/unix/zerrors_linux_arm64.go | 7 + .../x/sys/unix/zerrors_linux_loong64.go | 7 + .../x/sys/unix/zerrors_linux_mips.go | 7 + .../x/sys/unix/zerrors_linux_mips64.go | 7 + .../x/sys/unix/zerrors_linux_mips64le.go | 7 + .../x/sys/unix/zerrors_linux_mipsle.go | 7 + .../x/sys/unix/zerrors_linux_ppc.go | 7 + .../x/sys/unix/zerrors_linux_ppc64.go | 7 + .../x/sys/unix/zerrors_linux_ppc64le.go | 7 + .../x/sys/unix/zerrors_linux_riscv64.go | 7 + .../x/sys/unix/zerrors_linux_s390x.go | 7 + .../x/sys/unix/zerrors_linux_sparc64.go | 7 + .../x/sys/unix/zerrors_zos_s390x.go | 2 + .../x/sys/unix/zsyscall_darwin_amd64.go | 68 ++ .../x/sys/unix/zsyscall_darwin_amd64.s | 15 + .../x/sys/unix/zsyscall_darwin_arm64.go | 68 ++ .../x/sys/unix/zsyscall_darwin_arm64.s | 15 + .../golang.org/x/sys/unix/zsyscall_linux.go | 33 +- .../x/sys/unix/zsyscall_openbsd_386.go | 24 + .../x/sys/unix/zsyscall_openbsd_386.s | 5 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 24 + .../x/sys/unix/zsyscall_openbsd_amd64.s | 5 + .../x/sys/unix/zsyscall_openbsd_arm.go | 24 + .../x/sys/unix/zsyscall_openbsd_arm.s | 5 + .../x/sys/unix/zsyscall_openbsd_arm64.go | 24 + .../x/sys/unix/zsyscall_openbsd_arm64.s | 5 + .../x/sys/unix/zsyscall_openbsd_mips64.go | 24 + .../x/sys/unix/zsyscall_openbsd_mips64.s | 5 + .../x/sys/unix/zsyscall_openbsd_ppc64.go | 24 + .../x/sys/unix/zsyscall_openbsd_ppc64.s | 6 + .../x/sys/unix/zsyscall_openbsd_riscv64.go | 24 + .../x/sys/unix/zsyscall_openbsd_riscv64.s | 5 + .../x/sys/unix/zsysnum_linux_386.go | 1 + .../x/sys/unix/zsysnum_linux_amd64.go | 2 + .../x/sys/unix/zsysnum_linux_arm.go | 1 + .../x/sys/unix/zsysnum_linux_arm64.go | 3 +- .../x/sys/unix/zsysnum_linux_loong64.go | 3 + .../x/sys/unix/zsysnum_linux_mips.go | 1 + .../x/sys/unix/zsysnum_linux_mips64.go | 1 + .../x/sys/unix/zsysnum_linux_mips64le.go | 1 + .../x/sys/unix/zsysnum_linux_mipsle.go | 1 + .../x/sys/unix/zsysnum_linux_ppc.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 1 + .../x/sys/unix/zsysnum_linux_riscv64.go | 3 +- .../x/sys/unix/zsysnum_linux_s390x.go | 1 + .../x/sys/unix/zsysnum_linux_sparc64.go | 1 + .../x/sys/unix/ztypes_darwin_amd64.go | 13 + .../x/sys/unix/ztypes_darwin_arm64.go | 13 + .../x/sys/unix/ztypes_freebsd_386.go | 1 + .../x/sys/unix/ztypes_freebsd_amd64.go | 1 + .../x/sys/unix/ztypes_freebsd_arm.go | 1 + .../x/sys/unix/ztypes_freebsd_arm64.go | 1 + .../x/sys/unix/ztypes_freebsd_riscv64.go | 1 + .../golang.org/x/sys/unix/ztypes_linux.go | 96 ++- .../x/sys/unix/ztypes_linux_riscv64.go | 33 + .../golang.org/x/sys/windows/dll_windows.go | 2 +- .../x/sys/windows/security_windows.go | 2 +- .../x/sys/windows/syscall_windows.go | 16 +- .../golang.org/x/sys/windows/types_windows.go | 72 +- .../x/sys/windows/zsyscall_windows.go | 87 ++- source/vendor/modules.txt | 37 +- 163 files changed, 5536 insertions(+), 2168 deletions(-) create mode 100644 source/vendor/github.com/charmbracelet/x/ansi/notification.go create mode 100644 source/vendor/github.com/charmbracelet/x/ansi/parser_decode.go create mode 100644 source/vendor/github.com/charmbracelet/x/ansi/parser_sync.go create mode 100644 source/vendor/github.com/tdewolff/parse/v2/binary_unix.go create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.lock create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.nix delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/xflags.iml create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.envrc create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitlab-ci.yml delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CHANGELOG.md create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CONTRIBUTING.md delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/Makefile create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.lock create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.nix delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/mem.prof delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/project.mk delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/release.json create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.envrc create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitignore create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitlab-ci.yml create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/CONTRIBUTING.md create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/LICENSE create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/README.md create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/error.go create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/find.go create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.lock create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.nix create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/get.go create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/pathfinder.iml create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/release.json create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/set.go delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.lock delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.nix delete mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.yaml create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.lock create mode 100644 source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.nix create mode 100644 source/vendor/golang.org/x/sys/unix/vgetrandom_linux.go create mode 100644 source/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go diff --git a/flake.lock b/flake.lock index 873b599..ec97ba0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1719426051, - "narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=", + "lastModified": 1730883749, + "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd", + "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", "type": "github" }, "original": { diff --git a/source/go.mod b/source/go.mod index bb423c5..1492ff2 100644 --- a/source/go.mod +++ b/source/go.mod @@ -1,33 +1,36 @@ module gitlab.schukai.com/oss/bob -go 1.21 +go 1.22.0 + +toolchain go1.22.4 require ( github.com/andybalholm/cascadia v1.3.2 github.com/charmbracelet/log v0.4.0 - github.com/tdewolff/parse/v2 v2.7.15 - gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.2 - gitlab.schukai.com/oss/libraries/go/markup/html v0.4.2 - golang.org/x/crypto v0.25.0 - golang.org/x/net v0.27.0 + github.com/tdewolff/parse/v2 v2.7.19 + gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.3 + gitlab.schukai.com/oss/libraries/go/markup/html v0.4.6 + golang.org/x/crypto v0.28.0 + golang.org/x/net v0.30.0 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/lipgloss v0.11.0 // indirect - github.com/charmbracelet/x/ansi v0.1.2 // indirect + github.com/charmbracelet/lipgloss v1.0.0 // indirect + github.com/charmbracelet/x/ansi v0.4.5 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/muesli/termenv v0.15.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/volker-schukai/tokenizer v1.0.0 // indirect - gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.0 // indirect - gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.2 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/sys v0.22.0 // indirect + gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.2 // indirect + gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.4 // indirect + gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git v0.9.5 // indirect + golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect + golang.org/x/sys v0.26.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/source/go.sum b/source/go.sum index 0e6076f..c1fc4fb 100644 --- a/source/go.sum +++ b/source/go.sum @@ -2,12 +2,12 @@ github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsVi github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/lipgloss v0.11.0 h1:UoAcbQ6Qml8hDwSWs0Y1cB5TEQuZkDPH/ZqwWWYTG4g= -github.com/charmbracelet/lipgloss v0.11.0/go.mod h1:1UdRTH9gYgpcdNN5oBtjbu/IzNKtzVtb7sqN1t9LNn8= +github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= +github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= github.com/charmbracelet/log v0.4.0 h1:G9bQAcx8rWA2T3pWvx7YtPTPwgqpk7D68BX21IRW8ZM= github.com/charmbracelet/log v0.4.0/go.mod h1:63bXt/djrizTec0l11H20t8FDSvA4CRZJ1KH22MdptM= -github.com/charmbracelet/x/ansi v0.1.2 h1:6+LR39uG8DE6zAmbu023YlqjJHkYXDF1z36ZwzO4xZY= -github.com/charmbracelet/x/ansi v0.1.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM= +github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -28,8 +28,8 @@ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69 github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -43,29 +43,29 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tdewolff/parse/v2 v2.7.15 h1:hysDXtdGZIRF5UZXwpfn3ZWRbm+ru4l53/ajBRGpCTw= -github.com/tdewolff/parse/v2 v2.7.15/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= +github.com/tdewolff/parse/v2 v2.7.19 h1:7Ljh26yj+gdLFEq/7q9LT4SYyKtwQX4ocNrj45UCePg= +github.com/tdewolff/parse/v2 v2.7.19/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52 h1:gAQliwn+zJrkjAHVcBEYW/RFvd2St4yYimisvozAYlA= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/volker-schukai/tokenizer v1.0.0 h1:wF4haFoCodq7lgAk8c+th/DZmpFpL2WVD8wDzAGU1mA= github.com/volker-schukai/tokenizer v1.0.0/go.mod h1:LPw7lLIxUnZgeg96818N7IvwLE1x8ya31J/Aa0aCq9M= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.2 h1:kriz76Z/wK4nrsjGFQQUfVL9PaPalG7EXqkhIBF4jaE= -gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.2/go.mod h1:XanOu43r2J41lDIUviS4Qlxy5W3G9aNgWgvPs4EusUE= -gitlab.schukai.com/oss/libraries/go/markup/html v0.4.2 h1:yZlZwzGQ/C4x578Of/JCkt5iw75GGs+O7l3CPdpM738= -gitlab.schukai.com/oss/libraries/go/markup/html v0.4.2/go.mod h1:TLlQfudIY8EDdIWcGftoANI4K+vbF4M5fdVm6y5P/w8= -gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.0 h1:JVxMHiA8zFVjJDhNl65XeYrhdMkzB+5dyrBUEZ982WU= -gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.0/go.mod h1:BsR4Y9jsvISplkW6UoLFRGxQX69/AUmP1SXRwWhx31o= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.2 h1:cbrnohA6SyqH6NGvYDyIFcrh3lH4DcwLcGUbmaSKWlY= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.2/go.mod h1:MqCBFv7DXKoBE2rZDc51LGvl2QI7Kz0D+XkQ0izj+ws= +gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.3 h1:IWRCQOsZZPkoh/vIzjsF8BnqT4VVbOlCtfeuaYV5qEQ= +gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.3/go.mod h1:e+uFr/73kXoSozlAewBBqKsAUCIichlcvNDyj/0fj9Q= +gitlab.schukai.com/oss/libraries/go/markup/html v0.4.6 h1:eMold9Nl6ZkygVF1K1lTA3ROGz/mlEIcPt9aUUJC33c= +gitlab.schukai.com/oss/libraries/go/markup/html v0.4.6/go.mod h1:FAzz3QWPCqQG54ou0zLnF6j3/ZQgGSTGsTHLShc3UFU= +gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.2 h1:jRlVTikl73AL1y9OfYxdZ4OYG8Hkbl/8ezbwd9r5l44= +gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.2/go.mod h1:Vl5kzzMjpy1LGe+RUi2pTnZvZFP53Th4JChP9dbkOVk= +gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.4 h1:/+fgcPeXqz5tRrT+EZXA2vGV+OWV9R+5hEBpRJUpp80= +gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.4/go.mod h1:36psT3WHelpcXWXVp8D33IXvUIpaAXEtrQYYOODUbjE= +gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git v0.9.5 h1:PiDmw3O3UDubKILC+t7fKs+m9670a+b8SkrHq5Rkk9M= +gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git v0.9.5/go.mod h1:HwXjaFUAxLv+qTN63xrPBO5DEVGuZNF859t29bhTsFQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -73,10 +73,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -88,10 +86,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/source/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml b/source/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml index 1b6824b..8783713 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml +++ b/source/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml @@ -14,16 +14,13 @@ issues: linters: enable: - # - dupl - exhaustive - # - exhaustivestruct - goconst - godot - godox - - gomnd + - mnd - gomoddirectives - goprintffuncname - # - lll - misspell - nakedret - nestif @@ -34,13 +31,10 @@ linters: # disable default linters, they are already enabled in .golangci.yml disable: - - deadcode - errcheck - gosimple - govet - ineffassign - staticcheck - - structcheck - typecheck - unused - - varcheck diff --git a/source/vendor/github.com/charmbracelet/lipgloss/.golangci.yml b/source/vendor/github.com/charmbracelet/lipgloss/.golangci.yml index 3affce9..d6789e0 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/.golangci.yml +++ b/source/vendor/github.com/charmbracelet/lipgloss/.golangci.yml @@ -15,12 +15,10 @@ issues: linters: enable: - bodyclose - - exportloopref - gofumpt - goimports - gosec - nilerr - - predeclared - revive - rowserrcheck - sqlclosecheck diff --git a/source/vendor/github.com/charmbracelet/lipgloss/README.md b/source/vendor/github.com/charmbracelet/lipgloss/README.md index 1376c7c..f171e7d 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/README.md +++ b/source/vendor/github.com/charmbracelet/lipgloss/README.md @@ -10,7 +10,7 @@ Style definitions for nice terminal layouts. Built with TUIs in mind. - + Lip Gloss takes an expressive, declarative approach to terminal rendering. Users familiar with CSS will feel at home with Lip Gloss. @@ -77,11 +77,11 @@ appropriate color will be chosen at runtime. ### Complete Colors -CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color +CompleteColor specifies exact values for True Color, ANSI256, and ANSI color profiles. ```go -lipgloss.CompleteColor{True: "#0000FF", ANSI256: "86", ANSI: "5"} +lipgloss.CompleteColor{TrueColor: "#0000FF", ANSI256: "86", ANSI: "5"} ``` Automatic color degradation will not be performed in this case and it will be @@ -89,7 +89,7 @@ based on the color specified. ### Complete Adaptive Colors -You can use CompleteColor with AdaptiveColor to specify the exact values for +You can use `CompleteColor` with `AdaptiveColor` to specify the exact values for light and dark backgrounds without automatic color degradation. ```go @@ -402,7 +402,7 @@ block := lipgloss.Place(30, 80, lipgloss.Right, lipgloss.Bottom, fancyStyledPara You can also style the whitespace. For details, see [the docs][docs]. -### Rendering Tables +## Rendering Tables Lip Gloss ships with a table rendering sub-package. @@ -455,6 +455,214 @@ fmt.Println(t) For more on tables see [the docs](https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc) and [examples](https://github.com/charmbracelet/lipgloss/tree/master/examples/table). +## Rendering Lists + +Lip Gloss ships with a list rendering sub-package. + +```go +import "github.com/charmbracelet/lipgloss/list" +``` + +Define a new list. + +```go +l := list.New("A", "B", "C") +``` + +Print the list. + +```go +fmt.Println(l) + +// • A +// • B +// • C +``` + +Lists have the ability to nest. + +```go +l := list.New( + "A", list.New("Artichoke"), + "B", list.New("Baking Flour", "Bananas", "Barley", "Bean Sprouts"), + "C", list.New("Cashew Apple", "Cashews", "Coconut Milk", "Curry Paste", "Currywurst"), + "D", list.New("Dill", "Dragonfruit", "Dried Shrimp"), + "E", list.New("Eggs"), + "F", list.New("Fish Cake", "Furikake"), + "J", list.New("Jicama"), + "K", list.New("Kohlrabi"), + "L", list.New("Leeks", "Lentils", "Licorice Root"), +) +``` + +Print the list. + +```go +fmt.Println(l) +``` + +<p align="center"> +<img width="600" alt="image" src="https://github.com/charmbracelet/lipgloss/assets/42545625/0dc9f440-0748-4151-a3b0-7dcf29dfcdb0"> +</p> + +Lists can be customized via their enumeration function as well as using +`lipgloss.Style`s. + +```go +enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("99")).MarginRight(1) +itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")).MarginRight(1) + +l := list.New( + "Glossier", + "Claire’s Boutique", + "Nyx", + "Mac", + "Milk", + ). + Enumerator(list.Roman). + EnumeratorStyle(enumeratorStyle). + ItemStyle(itemStyle) +``` + +Print the list. + +<p align="center"> +<img width="600" alt="List example" src="https://github.com/charmbracelet/lipgloss/assets/42545625/360494f1-57fb-4e13-bc19-0006efe01561"> +</p> + +In addition to the predefined enumerators (`Arabic`, `Alphabet`, `Roman`, `Bullet`, `Tree`), +you may also define your own custom enumerator: + +```go +l := list.New("Duck", "Duck", "Duck", "Duck", "Goose", "Duck", "Duck") + +func DuckDuckGooseEnumerator(l list.Items, i int) string { + if l.At(i).Value() == "Goose" { + return "Honk →" + } + return "" +} + +l = l.Enumerator(DuckDuckGooseEnumerator) +``` + +Print the list: + +<p align="center"> +<img width="600" alt="image" src="https://github.com/charmbracelet/lipgloss/assets/42545625/157aaf30-140d-4948-9bb4-dfba46e5b87e"> +</p> + +If you need, you can also build lists incrementally: + +```go +l := list.New() + +for i := 0; i < repeat; i++ { + l.Item("Lip Gloss") +} +``` + +## Rendering Trees + +Lip Gloss ships with a tree rendering sub-package. + +```go +import "github.com/charmbracelet/lipgloss/tree" +``` + +Define a new tree. + +```go +t := tree.Root("."). + Child("A", "B", "C") +``` + +Print the tree. + +```go +fmt.Println(t) + +// . +// ├── A +// ├── B +// └── C +``` + +Trees have the ability to nest. + +```go +t := tree.Root("."). + Child("macOS"). + Child( + tree.New(). + Root("Linux"). + Child("NixOS"). + Child("Arch Linux (btw)"). + Child("Void Linux"), + ). + Child( + tree.New(). + Root("BSD"). + Child("FreeBSD"). + Child("OpenBSD"), + ) +``` + +Print the tree. + +```go +fmt.Println(t) +``` + +<p align="center"> +<img width="663" alt="Tree Example (simple)" src="https://github.com/user-attachments/assets/5ef14eb8-a5d4-4f94-8834-e15d1e714f89"> +</p> + +Trees can be customized via their enumeration function as well as using +`lipgloss.Style`s. + +```go +enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).MarginRight(1) +rootStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("35")) +itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")) + +t := tree. + Root("⁜ Makeup"). + Child( + "Glossier", + "Fenty Beauty", + tree.New().Child( + "Gloss Bomb Universal Lip Luminizer", + "Hot Cheeks Velour Blushlighter", + ), + "Nyx", + "Mac", + "Milk", + ). + Enumerator(tree.RoundedEnumerator). + EnumeratorStyle(enumeratorStyle). + RootStyle(rootStyle). + ItemStyle(itemStyle) +``` + +Print the tree. + +<p align="center"> +<img width="663" alt="Tree Example (makeup)" src="https://github.com/user-attachments/assets/06d12d87-744a-4c89-bd98-45de9094a97e"> +</p> + +The predefined enumerators for trees are `DefaultEnumerator` and `RoundedEnumerator`. + +If you need, you can also build trees incrementally: + +```go +t := tree.New() + +for i := 0; i < repeat; i++ { + t.Child("Lip Gloss") +} +``` + --- ## FAQ @@ -526,6 +734,12 @@ the stylesheet-based Markdown renderer. [glamour]: https://github.com/charmbracelet/glamour +## Contributing + +See [contributing][contribute]. + +[contribute]: https://github.com/charmbracelet/lipgloss/contribute + ## Feedback We’d love to hear your thoughts on this project. Feel free to drop us a note! diff --git a/source/vendor/github.com/charmbracelet/lipgloss/color.go b/source/vendor/github.com/charmbracelet/lipgloss/color.go index 43f5b43..5dfb3cf 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/color.go +++ b/source/vendor/github.com/charmbracelet/lipgloss/color.go @@ -20,7 +20,7 @@ var noColor = NoColor{} // // Example usage: // -// var style = someStyle.Copy().Background(lipgloss.NoColor{}) +// var style = someStyle.Background(lipgloss.NoColor{}) type NoColor struct{} func (NoColor) color(*Renderer) termenv.Color { diff --git a/source/vendor/github.com/charmbracelet/lipgloss/set.go b/source/vendor/github.com/charmbracelet/lipgloss/set.go index 6f8b082..ed6e272 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/set.go +++ b/source/vendor/github.com/charmbracelet/lipgloss/set.go @@ -321,6 +321,8 @@ func (s Style) PaddingBottom(i int) Style { // applied to the padding. This is true by default as it's more than likely the // desired and expected behavior, but it can be disabled for certain graphic // effects. +// +// Deprecated: Just use margins and padding. func (s Style) ColorWhitespace(v bool) Style { s.set(colorWhitespaceKey, v) return s @@ -603,7 +605,7 @@ func (s Style) BorderLeftBackground(c TerminalColor) Style { // var userStyle = text.Style{ /* ... */ } // fmt.Println(userStyle.Inline(true).Render(userInput)) func (s Style) Inline(v bool) Style { - o := s.Copy() + o := s // copy o.set(inlineKey, v) return o } @@ -621,7 +623,7 @@ func (s Style) Inline(v bool) Style { // var userStyle = text.Style{ /* ... */ } // fmt.Println(userStyle.MaxWidth(16).Render(userInput)) func (s Style) MaxWidth(n int) Style { - o := s.Copy() + o := s // copy o.set(maxWidthKey, n) return o } @@ -633,7 +635,7 @@ func (s Style) MaxWidth(n int) Style { // Because this in intended to be used at the time of render, this method will // not mutate the style and instead returns a copy. func (s Style) MaxHeight(n int) Style { - o := s.Copy() + o := s // copy o.set(maxHeightKey, n) return o } diff --git a/source/vendor/github.com/charmbracelet/lipgloss/style.go b/source/vendor/github.com/charmbracelet/lipgloss/style.go index 846b92f..0eb5c01 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/style.go +++ b/source/vendor/github.com/charmbracelet/lipgloss/style.go @@ -189,7 +189,8 @@ func (s Style) String() string { // Copy returns a copy of this style, including any underlying string values. // -// Deprecated: to copy just use assignment (i.e. a := b). All methods also return a new style. +// Deprecated: to copy just use assignment (i.e. a := b). All methods also +// return a new style. func (s Style) Copy() Style { return s } @@ -306,9 +307,7 @@ func (s Style) Render(strs ...string) string { te = te.Underline() } if reverse { - if reverse { - teWhitespace = teWhitespace.Reverse() - } + teWhitespace = teWhitespace.Reverse() te = te.Reverse() } if blink { @@ -354,6 +353,8 @@ func (s Style) Render(strs ...string) string { // Potentially convert tabs to spaces str = s.maybeConvertTabs(str) + // carriage returns can cause strange behaviour when rendering. + str = strings.ReplaceAll(str, "\r\n", "\n") // Strip newlines in single line mode if inline { @@ -563,14 +564,14 @@ func pad(str string, n int, style *termenv.Style) string { return b.String() } -func max(a, b int) int { //nolint:unparam +func max(a, b int) int { //nolint:unparam,predeclared if a > b { return a } return b } -func min(a, b int) int { +func min(a, b int) int { //nolint:predeclared if a < b { return a } diff --git a/source/vendor/github.com/charmbracelet/lipgloss/unset.go b/source/vendor/github.com/charmbracelet/lipgloss/unset.go index 19d9337..1086e72 100644 --- a/source/vendor/github.com/charmbracelet/lipgloss/unset.go +++ b/source/vendor/github.com/charmbracelet/lipgloss/unset.go @@ -249,7 +249,15 @@ func (s Style) UnsetBorderBackground() Style { // UnsetBorderTopBackgroundColor removes the top border background color rule, // if set. +// +// Deprecated: This function simply calls Style.UnsetBorderTopBackground. func (s Style) UnsetBorderTopBackgroundColor() Style { + return s.UnsetBorderTopBackground() +} + +// UnsetBorderTopBackground removes the top border background color rule, +// if set. +func (s Style) UnsetBorderTopBackground() Style { s.unset(borderTopBackgroundKey) return s } diff --git a/source/vendor/github.com/charmbracelet/x/ansi/background.go b/source/vendor/github.com/charmbracelet/x/ansi/background.go index f519af0..6c66e62 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/background.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/background.go @@ -23,6 +23,12 @@ func SetForegroundColor(c color.Color) string { // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestForegroundColor = "\x1b]10;?\x07" +// ResetForegroundColor is a sequence that resets the default terminal +// foreground color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetForegroundColor = "\x1b]110\x07" + // SetBackgroundColor returns a sequence that sets the default terminal // background color. // @@ -42,6 +48,12 @@ func SetBackgroundColor(c color.Color) string { // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestBackgroundColor = "\x1b]11;?\x07" +// ResetBackgroundColor is a sequence that resets the default terminal +// background color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetBackgroundColor = "\x1b]111\x07" + // SetCursorColor returns a sequence that sets the terminal cursor color. // // OSC 12 ; color ST @@ -59,3 +71,8 @@ func SetCursorColor(c color.Color) string { // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestCursorColor = "\x1b]12;?\x07" + +// ResetCursorColor is a sequence that resets the terminal cursor color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetCursorColor = "\x1b]112\x07" diff --git a/source/vendor/github.com/charmbracelet/x/ansi/cursor.go b/source/vendor/github.com/charmbracelet/x/ansi/cursor.go index 5f010fd..da144b9 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/cursor.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/cursor.go @@ -147,13 +147,13 @@ func CursorPreviousLine(n int) string { return "\x1b[" + s + "F" } -// MoveCursor (CUP) returns a sequence for moving the cursor to the given row -// and column. +// SetCursorPosition (CUP) returns a sequence for setting the cursor to the +// given row and column. // // CSI n ; m H // // See: https://vt100.net/docs/vt510-rm/CUP.html -func MoveCursor(row, col int) string { +func SetCursorPosition(col, row int) string { if row < 0 { row = 0 } @@ -163,9 +163,33 @@ func MoveCursor(row, col int) string { return "\x1b[" + strconv.Itoa(row) + ";" + strconv.Itoa(col) + "H" } +// HomeCursorPosition is a sequence for moving the cursor to the upper left +// corner of the scrolling region. This is equivalent to `SetCursorPosition(1, 1)`. +const HomeCursorPosition = "\x1b[H" + +// MoveCursor (CUP) returns a sequence for setting the cursor to the +// given row and column. +// +// CSI n ; m H +// +// See: https://vt100.net/docs/vt510-rm/CUP.html +// +// Deprecated: use SetCursorPosition instead. +func MoveCursor(col, row int) string { + return SetCursorPosition(col, row) +} + +// CursorOrigin is a sequence for moving the cursor to the upper left corner of +// the display. This is equivalent to `SetCursorPosition(1, 1)`. +// +// Deprecated: use [HomeCursorPosition] instead. +const CursorOrigin = "\x1b[1;1H" + // MoveCursorOrigin is a sequence for moving the cursor to the upper left -// corner of the screen. This is equivalent to MoveCursor(1, 1). -const MoveCursorOrigin = "\x1b[1;1H" +// corner of the display. This is equivalent to `SetCursorPosition(1, 1)`. +// +// Deprecated: use CursorOrigin instead. +const MoveCursorOrigin = CursorOrigin // SaveCursorPosition (SCP or SCOSC) is a sequence for saving the cursor // position. @@ -188,3 +212,48 @@ const SaveCursorPosition = "\x1b[s" // // See: https://vt100.net/docs/vt510-rm/SCORC.html const RestoreCursorPosition = "\x1b[u" + +// SetCursorStyle (DECSCUSR) returns a sequence for changing the cursor style. +// +// CSI Ps SP q +// +// Where Ps is the cursor style: +// +// 0: Blinking block +// 1: Blinking block (default) +// 2: Steady block +// 3: Blinking underline +// 4: Steady underline +// 5: Blinking bar (xterm) +// 6: Steady bar (xterm) +// +// See: https://vt100.net/docs/vt510-rm/DECSCUSR.html +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81 +func SetCursorStyle(style int) string { + if style < 0 { + style = 0 + } + return "\x1b[" + strconv.Itoa(style) + " q" +} + +// SetPointerShape returns a sequence for changing the mouse pointer cursor +// shape. Use "default" for the default pointer shape. +// +// OSC 22 ; Pt ST +// OSC 22 ; Pt BEL +// +// Where Pt is the pointer shape name. The name can be anything that the +// operating system can understand. Some common names are: +// +// - copy +// - crosshair +// - default +// - ew-resize +// - n-resize +// - text +// - wait +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands +func SetPointerShape(shape string) string { + return "\x1b]22;" + shape + "\x07" +} diff --git a/source/vendor/github.com/charmbracelet/x/ansi/kitty.go b/source/vendor/github.com/charmbracelet/x/ansi/kitty.go index 5bf8981..c56d8d1 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/kitty.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/kitty.go @@ -8,11 +8,11 @@ const ( KittyDisambiguateEscapeCodes = 1 << iota KittyReportEventTypes KittyReportAlternateKeys - KittyReportAllKeys + KittyReportAllKeysAsEscapeCodes KittyReportAssociatedKeys KittyAllFlags = KittyDisambiguateEscapeCodes | KittyReportEventTypes | - KittyReportAlternateKeys | KittyReportAllKeys | KittyReportAssociatedKeys + KittyReportAlternateKeys | KittyReportAllKeysAsEscapeCodes | KittyReportAssociatedKeys ) // RequestKittyKeyboard is a sequence to request the terminal Kitty keyboard @@ -21,9 +21,41 @@ const ( // See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ const RequestKittyKeyboard = "\x1b[?u" +// KittyKeyboard returns a sequence to request keyboard enhancements from the terminal. +// The flags argument is a bitmask of the Kitty keyboard protocol flags. While +// mode specifies how the flags should be interpreted. +// +// Possible values for flags mask: +// +// 1: Disambiguate escape codes +// 2: Report event types +// 4: Report alternate keys +// 8: Report all keys as escape codes +// 16: Report associated text +// +// Possible values for mode: +// +// 1: Set given flags and unset all others +// 2: Set given flags and keep existing flags unchanged +// 3: Unset given flags and keep existing flags unchanged +// +// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement +func KittyKeyboard(flags, mode int) string { + return "\x1b[=" + strconv.Itoa(flags) + ";" + strconv.Itoa(mode) + "u" +} + // PushKittyKeyboard returns a sequence to push the given flags to the terminal // Kitty Keyboard stack. // +// Possible values for flags mask: +// +// 0: Disable all features +// 1: Disambiguate escape codes +// 2: Report event types +// 4: Report alternate keys +// 8: Report all keys as escape codes +// 16: Report associated text +// // CSI > flags u // // See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement diff --git a/source/vendor/github.com/charmbracelet/x/ansi/mode.go b/source/vendor/github.com/charmbracelet/x/ansi/mode.go index 4c39e78..10dfcf5 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/mode.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/mode.go @@ -1,5 +1,7 @@ package ansi +import "strconv" + // This file define uses multiple sequences to set (SM), reset (RM), and request // (DECRQM) different ANSI and DEC modes. // @@ -21,11 +23,29 @@ package ansi // Where Pa is the mode number, and Ps is the mode value. // See: https://vt100.net/docs/vt510-rm/DECRPM.html +// Mode represents an ANSI terminal mode. +type Mode int + +// String returns the mode as a string. +func (m Mode) String() string { + return strconv.Itoa(int(m)) +} + +// PrivateMode represents a private DEC terminal mode. +type PrivateMode int + +// String returns the private mode as a string. +func (m PrivateMode) String() string { + return "?" + strconv.Itoa(int(m)) +} + // Application Cursor Keys (DECCKM) is a mode that determines whether the // cursor keys send ANSI cursor sequences or application sequences. // // See: https://vt100.net/docs/vt510-rm/DECCKM.html const ( + CursorKeysMode = PrivateMode(1) + EnableCursorKeys = "\x1b[?1h" DisableCursorKeys = "\x1b[?1l" RequestCursorKeys = "\x1b[?1$p" @@ -35,6 +55,8 @@ const ( // // See: https://vt100.net/docs/vt510-rm/DECTCEM.html const ( + CursorEnableMode = PrivateMode(25) + ShowCursor = "\x1b[?25h" HideCursor = "\x1b[?25l" RequestCursorVisibility = "\x1b[?25$p" @@ -45,6 +67,8 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( + MouseMode = PrivateMode(1000) + EnableMouse = "\x1b[?1000h" DisableMouse = "\x1b[?1000l" RequestMouse = "\x1b[?1000$p" @@ -55,6 +79,8 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( + MouseHiliteMode = PrivateMode(1001) + EnableMouseHilite = "\x1b[?1001h" DisableMouseHilite = "\x1b[?1001l" RequestMouseHilite = "\x1b[?1001$p" @@ -65,6 +91,8 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( + MouseCellMotionMode = PrivateMode(1002) + EnableMouseCellMotion = "\x1b[?1002h" DisableMouseCellMotion = "\x1b[?1002l" RequestMouseCellMotion = "\x1b[?1002$p" @@ -75,16 +103,31 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( + MouseAllMotionMode = PrivateMode(1003) + EnableMouseAllMotion = "\x1b[?1003h" DisableMouseAllMotion = "\x1b[?1003l" RequestMouseAllMotion = "\x1b[?1003$p" ) +// Report Focus is a mode that makes the terminal report focus-in and focus-out events. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut +const ( + ReportFocusMode = PrivateMode(1004) + + EnableReportFocus = "\x1b[?1004h" + DisableReportFocus = "\x1b[?1004l" + RequestReportFocus = "\x1b[?1004$p" +) + // SGR Mouse Extension is a mode that determines whether the mouse reports events // formatted with SGR parameters. // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( + MouseSgrExtMode = PrivateMode(1006) + EnableMouseSgrExt = "\x1b[?1006h" DisableMouseSgrExt = "\x1b[?1006l" RequestMouseSgrExt = "\x1b[?1006$p" @@ -95,6 +138,8 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer const ( + AltScreenBufferMode = PrivateMode(1049) + EnableAltScreenBuffer = "\x1b[?1049h" DisableAltScreenBuffer = "\x1b[?1049l" RequestAltScreenBuffer = "\x1b[?1049$p" @@ -106,6 +151,8 @@ const ( // See: https://cirw.in/blog/bracketed-paste // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode const ( + BracketedPasteMode = PrivateMode(2004) + EnableBracketedPaste = "\x1b[?2004h" DisableBracketedPaste = "\x1b[?2004l" RequestBracketedPaste = "\x1b[?2004$p" @@ -116,16 +163,34 @@ const ( // // See: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 const ( + SyncdOutputMode = PrivateMode(2026) + EnableSyncdOutput = "\x1b[?2026h" DisableSyncdOutput = "\x1b[?2026l" RequestSyncdOutput = "\x1b[?2026$p" ) +// Grapheme Clustering Mode is a mode that determines whether the terminal +// should look for grapheme clusters instead of single runes in the rendered +// text. This makes the terminal properly render combining characters such as +// emojis. +// +// See: https://github.com/contour-terminal/terminal-unicode-core +const ( + GraphemeClusteringMode = PrivateMode(2027) + + EnableGraphemeClustering = "\x1b[?2027h" + DisableGraphemeClustering = "\x1b[?2027l" + RequestGraphemeClustering = "\x1b[?2027$p" +) + // Win32Input is a mode that determines whether input is processed by the // Win32 console and Conpty. // // See: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md const ( + Win32InputMode = PrivateMode(9001) + EnableWin32Input = "\x1b[?9001h" DisableWin32Input = "\x1b[?9001l" RequestWin32Input = "\x1b[?9001$p" diff --git a/source/vendor/github.com/charmbracelet/x/ansi/notification.go b/source/vendor/github.com/charmbracelet/x/ansi/notification.go new file mode 100644 index 0000000..4943366 --- /dev/null +++ b/source/vendor/github.com/charmbracelet/x/ansi/notification.go @@ -0,0 +1,13 @@ +package ansi + +// Notify sends a desktop notification using iTerm's OSC 9. +// +// OSC 9 ; Mc ST +// OSC 9 ; Mc BEL +// +// Where Mc is the notification body. +// +// See: https://iterm2.com/documentation-escape-codes.html +func Notify(s string) string { + return "\x1b]9;" + s + "\x07" +} diff --git a/source/vendor/github.com/charmbracelet/x/ansi/parser.go b/source/vendor/github.com/charmbracelet/x/ansi/parser.go index 4595b51..e1a09df 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/parser.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/parser.go @@ -2,6 +2,7 @@ package ansi import ( "unicode/utf8" + "unsafe" "github.com/charmbracelet/x/ansi/parser" ) @@ -34,20 +35,20 @@ type Parser struct { // ParamsLen keeps track of the number of parameters. // This is limited by the size of the Params buffer. + // + // This is also used when collecting UTF-8 runes to keep track of the + // number of rune bytes collected. ParamsLen int // Cmd contains the raw command along with the private marker and // intermediate bytes of the sequence. // The first lower byte contains the command byte, the next byte contains // the private marker, and the next byte contains the intermediate byte. + // + // This is also used when collecting UTF-8 runes treating it as a slice of + // 4 bytes. Cmd int - // RuneLen keeps track of the number of bytes collected for a UTF-8 rune. - RuneLen int - - // RuneBuf contains the bytes collected for a UTF-8 rune. - RuneBuf [utf8.MaxRune]byte - // State is the current state of the parser. State byte } @@ -56,13 +57,13 @@ type Parser struct { // If dataSize is zero, the underlying data buffer will be unlimited and will // grow as needed. func NewParser(paramsSize, dataSize int) *Parser { - s := &Parser{ - Params: make([]int, paramsSize), - Data: make([]byte, dataSize), - } + s := new(Parser) if dataSize <= 0 { + dataSize = 0 s.DataLen = -1 } + s.Params = make([]int, paramsSize) + s.Data = make([]byte, dataSize) return s } @@ -79,7 +80,6 @@ func (p *Parser) clear() { } p.ParamsLen = 0 p.Cmd = 0 - p.RuneLen = 0 } // StateName returns the name of the current state. @@ -106,37 +106,40 @@ func (p *Parser) Advance(dispatcher ParserDispatcher, b byte, more bool) parser. } func (p *Parser) collectRune(b byte) { - if p.RuneLen < utf8.UTFMax { - p.RuneBuf[p.RuneLen] = b - p.RuneLen++ + if p.ParamsLen >= utf8.UTFMax { + return } + + shift := p.ParamsLen * 8 + p.Cmd &^= 0xff << shift + p.Cmd |= int(b) << shift + p.ParamsLen++ } func (p *Parser) advanceUtf8(dispatcher ParserDispatcher, b byte) parser.Action { // Collect UTF-8 rune bytes. p.collectRune(b) - rw := utf8ByteLen(p.RuneBuf[0]) + rw := utf8ByteLen(byte(p.Cmd & 0xff)) if rw == -1 { // We panic here because the first byte comes from the state machine, // if this panics, it means there is a bug in the state machine! panic("invalid rune") // unreachable } - if p.RuneLen < rw { - return parser.NoneAction + if p.ParamsLen < rw { + return parser.CollectAction } - // We have enough bytes to decode the rune - bts := p.RuneBuf[:rw] - r, _ := utf8.DecodeRune(bts) + // We have enough bytes to decode the rune using unsafe + r, _ := utf8.DecodeRune((*[utf8.UTFMax]byte)(unsafe.Pointer(&p.Cmd))[:rw]) if dispatcher != nil { dispatcher(Rune(r)) } p.State = parser.GroundState - p.RuneLen = 0 + p.ParamsLen = 0 - return parser.NoneAction + return parser.PrintAction } func (p *Parser) advance(d ParserDispatcher, b byte, more bool) parser.Action { @@ -149,16 +152,15 @@ func (p *Parser) advance(d ParserDispatcher, b byte, more bool) parser.Action { // EscapeState. However, the parser state is not cleared in this case and // we need to clear it here before dispatching the esc sequence. if p.State != state { - switch p.State { - case parser.EscapeState: - p.performAction(d, parser.ClearAction, b) + if p.State == parser.EscapeState { + p.performAction(d, parser.ClearAction, state, b) } if action == parser.PutAction && p.State == parser.DcsEntryState && state == parser.DcsStringState { // XXX: This is a special case where we need to start collecting // non-string parameterized data i.e. doesn't follow the ECMA-48 § // 5.4.1 string parameters format. - p.performAction(d, parser.StartAction, 0) + p.performAction(d, parser.StartAction, state, 0) } } @@ -166,34 +168,34 @@ func (p *Parser) advance(d ParserDispatcher, b byte, more bool) parser.Action { switch { case b == ESC && p.State == parser.EscapeState: // Two ESCs in a row - p.performAction(d, parser.ExecuteAction, b) + p.performAction(d, parser.ExecuteAction, state, b) if !more { // Two ESCs at the end of the buffer - p.performAction(d, parser.ExecuteAction, b) + p.performAction(d, parser.ExecuteAction, state, b) } case b == ESC && !more: // Last byte is an ESC - p.performAction(d, parser.ExecuteAction, b) + p.performAction(d, parser.ExecuteAction, state, b) case p.State == parser.EscapeState && b == 'P' && !more: // ESC P (DCS) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) case p.State == parser.EscapeState && b == 'X' && !more: // ESC X (SOS) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) case p.State == parser.EscapeState && b == '[' && !more: // ESC [ (CSI) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) case p.State == parser.EscapeState && b == ']' && !more: // ESC ] (OSC) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) case p.State == parser.EscapeState && b == '^' && !more: // ESC ^ (PM) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) case p.State == parser.EscapeState && b == '_' && !more: // ESC _ (APC) at the end of the buffer - p.performAction(d, parser.DispatchAction, b) + p.performAction(d, parser.DispatchAction, state, b) default: - p.performAction(d, action, b) + p.performAction(d, action, state, b) } p.State = state @@ -201,7 +203,7 @@ func (p *Parser) advance(d ParserDispatcher, b byte, more bool) parser.Action { return action } -func (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action, b byte) { +func (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action, state parser.State, b byte) { switch action { case parser.IgnoreAction: break @@ -210,9 +212,7 @@ func (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action p.clear() case parser.PrintAction: - if utf8ByteLen(b) > 1 { - p.collectRune(b) - } else if dispatcher != nil { + if dispatcher != nil { dispatcher(Rune(b)) } @@ -228,10 +228,16 @@ func (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action p.Cmd |= int(b) << parser.MarkerShift case parser.CollectAction: - // Collect intermediate bytes - // we only store the last intermediate byte - p.Cmd &^= 0xff << parser.IntermedShift - p.Cmd |= int(b) << parser.IntermedShift + if state == parser.Utf8State { + // Reset the UTF-8 counter + p.ParamsLen = 0 + p.collectRune(b) + } else { + // Collect intermediate bytes + // we only store the last intermediate byte + p.Cmd &^= 0xff << parser.IntermedShift + p.Cmd |= int(b) << parser.IntermedShift + } case parser.ParamAction: // Collect parameters @@ -260,8 +266,8 @@ func (p *Parser) performAction(dispatcher ParserDispatcher, action parser.Action } case parser.StartAction: - if p.DataLen < 0 { - p.Data = make([]byte, 0) + if p.DataLen < 0 && p.Data != nil { + p.Data = p.Data[:0] } else { p.DataLen = 0 } diff --git a/source/vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go b/source/vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go index febde15..5d368eb 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go @@ -81,6 +81,9 @@ func r(start, end byte) []byte { // - We don't ignore 0x3A (':') when building Csi and Dcs parameters and // instead use it to denote sub-parameters. // - Support dispatching SosPmApc sequences. +// - The DEL (0x7F) character is executed in the Ground state. +// - The DEL (0x7F) character is collected in the DcsPassthrough string state. +// - The ST C1 control character (0x9C) is executed and not ignored. func GenerateTransitionTable() TransitionTable { table := NewTransitionTable(DefaultTableSize) table.SetDefault(NoneAction, GroundState) @@ -91,7 +94,7 @@ func GenerateTransitionTable() TransitionTable { table.AddMany([]byte{0x18, 0x1a, 0x99, 0x9a}, state, ExecuteAction, GroundState) table.AddRange(0x80, 0x8F, state, ExecuteAction, GroundState) table.AddRange(0x90, 0x97, state, ExecuteAction, GroundState) - table.AddOne(0x9C, state, IgnoreAction, GroundState) + table.AddOne(0x9C, state, ExecuteAction, GroundState) // Anywhere -> Escape table.AddOne(0x1B, state, ClearAction, EscapeState) // Anywhere -> SosStringState @@ -107,16 +110,17 @@ func GenerateTransitionTable() TransitionTable { // Anywhere -> OscString table.AddOne(0x9D, state, StartAction, OscStringState) // Anywhere -> Utf8 - table.AddRange(0xC2, 0xDF, state, PrintAction, Utf8State) // UTF8 2 byte sequence - table.AddRange(0xE0, 0xEF, state, PrintAction, Utf8State) // UTF8 3 byte sequence - table.AddRange(0xF0, 0xF4, state, PrintAction, Utf8State) // UTF8 4 byte sequence + table.AddRange(0xC2, 0xDF, state, CollectAction, Utf8State) // UTF8 2 byte sequence + table.AddRange(0xE0, 0xEF, state, CollectAction, Utf8State) // UTF8 3 byte sequence + table.AddRange(0xF0, 0xF4, state, CollectAction, Utf8State) // UTF8 4 byte sequence } // Ground table.AddRange(0x00, 0x17, GroundState, ExecuteAction, GroundState) table.AddOne(0x19, GroundState, ExecuteAction, GroundState) table.AddRange(0x1C, 0x1F, GroundState, ExecuteAction, GroundState) - table.AddRange(0x20, 0x7F, GroundState, PrintAction, GroundState) + table.AddRange(0x20, 0x7E, GroundState, PrintAction, GroundState) + table.AddOne(0x7F, GroundState, ExecuteAction, GroundState) // EscapeIntermediate table.AddRange(0x00, 0x17, EscapeIntermediateState, ExecuteAction, EscapeIntermediateState) @@ -209,7 +213,7 @@ func GenerateTransitionTable() TransitionTable { table.AddOne(0x19, DcsStringState, PutAction, DcsStringState) table.AddRange(0x1C, 0x1F, DcsStringState, PutAction, DcsStringState) table.AddRange(0x20, 0x7E, DcsStringState, PutAction, DcsStringState) - table.AddOne(0x7F, DcsStringState, IgnoreAction, DcsStringState) + table.AddOne(0x7F, DcsStringState, PutAction, DcsStringState) table.AddRange(0x80, 0xFF, DcsStringState, PutAction, DcsStringState) // Allow Utf8 characters by extending the printable range from 0x7F to 0xFF // ST, CAN, SUB, and ESC terminate the sequence table.AddOne(0x1B, DcsStringState, DispatchAction, EscapeState) diff --git a/source/vendor/github.com/charmbracelet/x/ansi/parser_decode.go b/source/vendor/github.com/charmbracelet/x/ansi/parser_decode.go new file mode 100644 index 0000000..0ed802c --- /dev/null +++ b/source/vendor/github.com/charmbracelet/x/ansi/parser_decode.go @@ -0,0 +1,450 @@ +package ansi + +import ( + "bytes" + "strings" + "unicode/utf8" + + "github.com/charmbracelet/x/ansi/parser" + "github.com/rivo/uniseg" +) + +// State represents the state of the ANSI escape sequence parser used by +// [DecodeSequence]. +type State = byte + +// ANSI escape sequence states used by [DecodeSequence]. +const ( + NormalState State = iota + MarkerState + ParamsState + IntermedState + EscapeState + StringState +) + +// DecodeSequence decodes the first ANSI escape sequence or a printable +// grapheme from the given data. It returns the sequence slice, the number of +// bytes read, the cell width for each sequence, and the new state. +// +// The cell width will always be 0 for control and escape sequences, 1 for +// ASCII printable characters, and the number of cells other Unicode characters +// occupy. It uses the uniseg package to calculate the width of Unicode +// graphemes and characters. This means it will always do grapheme clustering +// (mode 2027). +// +// Passing a non-nil [*Parser] as the last argument will allow the decoder to +// collect sequence parameters, data, and commands. The parser cmd will have +// the packed command value that contains intermediate and marker characters. +// In the case of a OSC sequence, the cmd will be the OSC command number. Use +// [Cmd] and [Param] types to unpack command intermediates and markers as well +// as parameters. +// +// Zero [Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover, checking the +// validity of other data sequences, OSC, DCS, etc, will require checking for +// the returned sequence terminator bytes such as ST (ESC \\) and BEL). +// +// We store the command byte in [Cmd] in the most significant byte, the +// marker byte in the next byte, and the intermediate byte in the least +// significant byte. This is done to avoid using a struct to store the command +// and its intermediates and markers. The command byte is always the least +// significant byte i.e. [Cmd & 0xff]. Use the [Cmd] type to unpack the +// command, intermediate, and marker bytes. Note that we only collect the last +// marker character and intermediate byte. +// +// The [p.Params] slice will contain the parameters of the sequence. Any +// sub-parameter will have the [parser.HasMoreFlag] set. Use the [Param] type +// to unpack the parameters. +// +// Example: +// +// var state byte // the initial state is always zero [NormalState] +// p := NewParser(32, 1024) // create a new parser with a 32 params buffer and 1024 data buffer (optional) +// input := []byte("\x1b[31mHello, World!\x1b[0m") +// for len(input) > 0 { +// seq, width, n, newState := DecodeSequence(input, state, p) +// log.Printf("seq: %q, width: %d", seq, width) +// state = newState +// input = input[n:] +// } +func DecodeSequence[T string | []byte](b T, state byte, p *Parser) (seq T, width int, n int, newState byte) { + for i := 0; i < len(b); i++ { + c := b[i] + + switch state { + case NormalState: + switch c { + case ESC: + if p != nil { + if len(p.Params) > 0 { + p.Params[0] = parser.MissingParam + } + p.Cmd = 0 + p.ParamsLen = 0 + p.DataLen = 0 + } + state = EscapeState + continue + case CSI, DCS: + if p != nil { + if len(p.Params) > 0 { + p.Params[0] = parser.MissingParam + } + p.Cmd = 0 + p.ParamsLen = 0 + p.DataLen = 0 + } + state = MarkerState + continue + case OSC, APC, SOS, PM: + if p != nil { + p.Cmd = parser.MissingCommand + p.DataLen = 0 + } + state = StringState + continue + } + + if p != nil { + p.DataLen = 0 + p.ParamsLen = 0 + p.Cmd = 0 + } + if c > US && c < DEL { + // ASCII printable characters + return b[i : i+1], 1, 1, NormalState + } + + if c <= US || c == DEL || c < 0xC0 { + // C0 & C1 control characters & DEL + return b[i : i+1], 0, 1, NormalState + } + + if utf8.RuneStart(c) { + seq, _, width, _ = FirstGraphemeCluster(b, -1) + i += len(seq) + return b[:i], width, i, NormalState + } + + // Invalid UTF-8 sequence + return b[:i], 0, i, NormalState + case MarkerState: + if c >= '<' && c <= '?' { + if p != nil { + // We only collect the last marker character. + p.Cmd &^= 0xff << parser.MarkerShift + p.Cmd |= int(c) << parser.MarkerShift + } + break + } + + state = ParamsState + fallthrough + case ParamsState: + if c >= '0' && c <= '9' { + if p != nil { + if p.Params[p.ParamsLen] == parser.MissingParam { + p.Params[p.ParamsLen] = 0 + } + + p.Params[p.ParamsLen] *= 10 + p.Params[p.ParamsLen] += int(c - '0') + } + break + } + + if c == ':' { + if p != nil { + p.Params[p.ParamsLen] |= parser.HasMoreFlag + } + } + + if c == ';' || c == ':' { + if p != nil { + p.ParamsLen++ + if p.ParamsLen < len(p.Params) { + p.Params[p.ParamsLen] = parser.MissingParam + } + } + break + } + + state = IntermedState + fallthrough + case IntermedState: + if c >= ' ' && c <= '/' { + if p != nil { + p.Cmd &^= 0xff << parser.IntermedShift + p.Cmd |= int(c) << parser.IntermedShift + } + break + } + + state = NormalState + if c >= '@' && c <= '~' { + if p != nil { + // Increment the last parameter + if p.ParamsLen > 0 && p.ParamsLen < len(p.Params)-1 || + p.ParamsLen == 0 && len(p.Params) > 0 && p.Params[0] != parser.MissingParam { + p.ParamsLen++ + } + + p.Cmd &^= 0xff + p.Cmd |= int(c) + } + + if HasDcsPrefix(b) { + // Continue to collect DCS data + if p != nil { + p.DataLen = 0 + } + state = StringState + continue + } + + return b[:i+1], 0, i + 1, state + } + + // Invalid CSI/DCS sequence + return b[:i], 0, i, NormalState + case EscapeState: + switch c { + case '[', 'P': + if p != nil { + if len(p.Params) > 0 { + p.Params[0] = parser.MissingParam + } + p.ParamsLen = 0 + p.Cmd = 0 + } + state = MarkerState + continue + case ']', 'X', '^', '_': + if p != nil { + p.Cmd = parser.MissingCommand + p.DataLen = 0 + } + state = StringState + continue + } + + if c >= ' ' && c <= '/' { + if p != nil { + p.Cmd &^= 0xff << parser.IntermedShift + p.Cmd |= int(c) << parser.IntermedShift + } + continue + } else if c >= '0' && c <= '~' { + if p != nil { + p.Cmd &^= 0xff + p.Cmd |= int(c) + } + return b[:i+1], 0, i + 1, NormalState + } + + // Invalid escape sequence + return b[:i], 0, i, NormalState + case StringState: + switch c { + case BEL: + if HasOscPrefix(b) { + parseOscCmd(p) + return b[:i+1], 0, i + 1, NormalState + } + case CAN, SUB: + if HasOscPrefix(b) { + // Ensure we parse the OSC command number + parseOscCmd(p) + } + + // Cancel the sequence + return b[:i], 0, i, NormalState + case ST: + if HasOscPrefix(b) { + // Ensure we parse the OSC command number + parseOscCmd(p) + } + + return b[:i+1], 0, i + 1, NormalState + case ESC: + if HasStPrefix(b[i:]) { + if HasOscPrefix(b) { + // Ensure we parse the OSC command number + parseOscCmd(p) + } + + // End of string 7-bit (ST) + return b[:i+2], 0, i + 2, NormalState + } + + // Otherwise, cancel the sequence + return b[:i], 0, i, NormalState + } + + if p != nil && p.DataLen < len(p.Data) { + p.Data[p.DataLen] = c + p.DataLen++ + + // Parse the OSC command number + if c == ';' && HasOscPrefix(b) { + parseOscCmd(p) + } + } + } + } + + return b, 0, len(b), state +} + +func parseOscCmd(p *Parser) { + if p == nil || p.Cmd != parser.MissingCommand { + return + } + for j := 0; j < p.DataLen; j++ { + d := p.Data[j] + if d < '0' || d > '9' { + break + } + if p.Cmd == parser.MissingCommand { + p.Cmd = 0 + } + p.Cmd *= 10 + p.Cmd += int(d - '0') + } +} + +// Index returns the index of the first occurrence of the given byte slice in +// the data. It returns -1 if the byte slice is not found. +func Index[T string | []byte](data, b T) int { + switch data := any(data).(type) { + case string: + return strings.Index(data, string(b)) + case []byte: + return bytes.Index(data, []byte(b)) + } + panic("unreachable") +} + +// Equal returns true if the given byte slices are equal. +func Equal[T string | []byte](a, b T) bool { + return string(a) == string(b) +} + +// HasPrefix returns true if the given byte slice has prefix. +func HasPrefix[T string | []byte](b, prefix T) bool { + return len(b) >= len(prefix) && Equal(b[0:len(prefix)], prefix) +} + +// HasSuffix returns true if the given byte slice has suffix. +func HasSuffix[T string | []byte](b, suffix T) bool { + return len(b) >= len(suffix) && Equal(b[len(b)-len(suffix):], suffix) +} + +// HasCsiPrefix returns true if the given byte slice has a CSI prefix. +func HasCsiPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == CSI) || + (len(b) > 1 && b[0] == ESC && b[1] == '[') +} + +// HasOscPrefix returns true if the given byte slice has an OSC prefix. +func HasOscPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == OSC) || + (len(b) > 1 && b[0] == ESC && b[1] == ']') +} + +// HasApcPrefix returns true if the given byte slice has an APC prefix. +func HasApcPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == APC) || + (len(b) > 1 && b[0] == ESC && b[1] == '_') +} + +// HasDcsPrefix returns true if the given byte slice has a DCS prefix. +func HasDcsPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == DCS) || + (len(b) > 1 && b[0] == ESC && b[1] == 'P') +} + +// HasSosPrefix returns true if the given byte slice has a SOS prefix. +func HasSosPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == SOS) || + (len(b) > 1 && b[0] == ESC && b[1] == 'X') +} + +// HasPmPrefix returns true if the given byte slice has a PM prefix. +func HasPmPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == PM) || + (len(b) > 1 && b[0] == ESC && b[1] == '^') +} + +// HasStPrefix returns true if the given byte slice has a ST prefix. +func HasStPrefix[T string | []byte](b T) bool { + return (len(b) > 0 && b[0] == ST) || + (len(b) > 1 && b[0] == ESC && b[1] == '\\') +} + +// HasEscPrefix returns true if the given byte slice has an ESC prefix. +func HasEscPrefix[T string | []byte](b T) bool { + return len(b) > 0 && b[0] == ESC +} + +// FirstGraphemeCluster returns the first grapheme cluster in the given string or byte slice. +// This is a syntactic sugar function that wraps +// uniseg.FirstGraphemeClusterInString and uniseg.FirstGraphemeCluster. +func FirstGraphemeCluster[T string | []byte](b T, state int) (T, T, int, int) { + switch b := any(b).(type) { + case string: + cluster, rest, width, newState := uniseg.FirstGraphemeClusterInString(b, state) + return T(cluster), T(rest), width, newState + case []byte: + cluster, rest, width, newState := uniseg.FirstGraphemeCluster(b, state) + return T(cluster), T(rest), width, newState + } + panic("unreachable") +} + +// Cmd represents a sequence command. This is used to pack/unpack a sequence +// command with its intermediate and marker characters. Those are commonly +// found in CSI and DCS sequences. +type Cmd int + +// Marker returns the marker byte of the CSI sequence. +// This is always gonna be one of the following '<' '=' '>' '?' and in the +// range of 0x3C-0x3F. +// Zero is returned if the sequence does not have a marker. +func (c Cmd) Marker() int { + return parser.Marker(int(c)) +} + +// Intermediate returns the intermediate byte of the CSI sequence. +// An intermediate byte is in the range of 0x20-0x2F. This includes these +// characters from ' ', '!', '"', '#', '$', '%', '&', ”', '(', ')', '*', '+', +// ',', '-', '.', '/'. +// Zero is returned if the sequence does not have an intermediate byte. +func (c Cmd) Intermediate() int { + return parser.Intermediate(int(c)) +} + +// Command returns the command byte of the CSI sequence. +func (c Cmd) Command() int { + return parser.Command(int(c)) +} + +// Param represents a sequence parameter. Sequence parameters with +// sub-parameters are packed with the HasMoreFlag set. This is used to unpack +// the parameters from a CSI and DCS sequences. +type Param int + +// Param returns the parameter at the given index. +// It returns -1 if the parameter does not exist. +func (s Param) Param() int { + p := int(s) & parser.ParamMask + if p == parser.MissingParam { + return -1 + } + return p +} + +// HasMore returns true if the parameter has more sub-parameters. +func (s Param) HasMore() bool { + return int(s)&parser.HasMoreFlag != 0 +} diff --git a/source/vendor/github.com/charmbracelet/x/ansi/parser_sync.go b/source/vendor/github.com/charmbracelet/x/ansi/parser_sync.go new file mode 100644 index 0000000..c6f24d3 --- /dev/null +++ b/source/vendor/github.com/charmbracelet/x/ansi/parser_sync.go @@ -0,0 +1,26 @@ +package ansi + +import ( + "sync" + + "github.com/charmbracelet/x/ansi/parser" +) + +var parserPool = sync.Pool{ + New: func() any { + return NewParser(parser.MaxParamsSize, 1024*1024*4) // 4MB of data buffer + }, +} + +// GetParser returns a parser from a sync pool. +func GetParser() *Parser { + return parserPool.Get().(*Parser) +} + +// PutParser returns a parser to a sync pool. The parser is reset +// automatically. +func PutParser(p *Parser) { + p.Reset() + p.DataLen = 0 + parserPool.Put(p) +} diff --git a/source/vendor/github.com/charmbracelet/x/ansi/screen.go b/source/vendor/github.com/charmbracelet/x/ansi/screen.go index 4909cf0..a37eed7 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/screen.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/screen.go @@ -2,12 +2,14 @@ package ansi import "strconv" -// EraseDisplay (ED) clears the screen or parts of the screen. Possible values: +// EraseDisplay (ED) clears the display or parts of the display. A screen is +// the shown part of the terminal display excluding the scrollback buffer. +// Possible values: // // 0: Clear from cursor to end of screen. // 1: Clear from cursor to beginning of the screen. // 2: Clear entire screen (and moves cursor to upper left on DOS). -// 3: Clear entire screen and delete all lines saved in the scrollback buffer. +// 3: Clear entire display which delete all lines saved in the scrollback buffer (xterm). // // CSI <n> J // @@ -22,9 +24,10 @@ func EraseDisplay(n int) string { // EraseDisplay constants. // These are the possible values for the EraseDisplay function. const ( - EraseDisplayRight = "\x1b[0J" - EraseDisplayLeft = "\x1b[1J" - EraseEntireDisplay = "\x1b[2J" + EraseScreenBelow = "\x1b[0J" + EraseScreenAbove = "\x1b[1J" + EraseEntireScreen = "\x1b[2J" + EraseEntireDisplay = "\x1b[3J" ) // EraseLine (EL) clears the current line or parts of the line. Possible values: diff --git a/source/vendor/github.com/charmbracelet/x/ansi/style.go b/source/vendor/github.com/charmbracelet/x/ansi/style.go index 96e3c53..5ab3dd4 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/style.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/style.go @@ -12,10 +12,10 @@ import ( const ResetStyle = "\x1b[m" // Attr is a SGR (Select Graphic Rendition) style attribute. -type Attr = string +type Attr = int // Style represents an ANSI SGR (Select Graphic Rendition) style. -type Style []Attr +type Style []string // String returns the ANSI SGR (Select Graphic Rendition) style sequence for // the given style. @@ -36,186 +36,357 @@ func (s Style) Styled(str string) string { // Reset appends the reset style attribute to the style. func (s Style) Reset() Style { - return append(s, ResetAttr) + return append(s, resetAttr) } // Bold appends the bold style attribute to the style. func (s Style) Bold() Style { - return append(s, BoldAttr) + return append(s, boldAttr) } // Faint appends the faint style attribute to the style. func (s Style) Faint() Style { - return append(s, FaintAttr) + return append(s, faintAttr) } // Italic appends the italic style attribute to the style. func (s Style) Italic() Style { - return append(s, ItalicAttr) + return append(s, italicAttr) } // Underline appends the underline style attribute to the style. func (s Style) Underline() Style { - return append(s, UnderlineAttr) + return append(s, underlineAttr) +} + +// UnderlineStyle appends the underline style attribute to the style. +func (s Style) UnderlineStyle(u UnderlineStyle) Style { + switch u { + case NoUnderlineStyle: + return s.NoUnderline() + case SingleUnderlineStyle: + return s.Underline() + case DoubleUnderlineStyle: + return append(s, doubleUnderlineStyle) + case CurlyUnderlineStyle: + return append(s, curlyUnderlineStyle) + case DottedUnderlineStyle: + return append(s, dottedUnderlineStyle) + case DashedUnderlineStyle: + return append(s, dashedUnderlineStyle) + } + return s } // DoubleUnderline appends the double underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DoubleUnderlineStyle). func (s Style) DoubleUnderline() Style { - return append(s, DoubleUnderlineAttr) + return s.UnderlineStyle(DoubleUnderlineStyle) } // CurlyUnderline appends the curly underline style attribute to the style. +// This is a convenience method for UnderlineStyle(CurlyUnderlineStyle). func (s Style) CurlyUnderline() Style { - return append(s, CurlyUnderlineAttr) + return s.UnderlineStyle(CurlyUnderlineStyle) } // DottedUnderline appends the dotted underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DottedUnderlineStyle). func (s Style) DottedUnderline() Style { - return append(s, DottedUnderlineAttr) + return s.UnderlineStyle(DottedUnderlineStyle) } // DashedUnderline appends the dashed underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DashedUnderlineStyle). func (s Style) DashedUnderline() Style { - return append(s, DashedUnderlineAttr) + return s.UnderlineStyle(DashedUnderlineStyle) } // SlowBlink appends the slow blink style attribute to the style. func (s Style) SlowBlink() Style { - return append(s, SlowBlinkAttr) + return append(s, slowBlinkAttr) } // RapidBlink appends the rapid blink style attribute to the style. func (s Style) RapidBlink() Style { - return append(s, RapidBlinkAttr) + return append(s, rapidBlinkAttr) } // Reverse appends the reverse style attribute to the style. func (s Style) Reverse() Style { - return append(s, ReverseAttr) + return append(s, reverseAttr) } // Conceal appends the conceal style attribute to the style. func (s Style) Conceal() Style { - return append(s, ConcealAttr) + return append(s, concealAttr) } // Strikethrough appends the strikethrough style attribute to the style. func (s Style) Strikethrough() Style { - return append(s, StrikethroughAttr) + return append(s, strikethroughAttr) } // NoBold appends the no bold style attribute to the style. func (s Style) NoBold() Style { - return append(s, NoBoldAttr) + return append(s, noBoldAttr) } // NormalIntensity appends the normal intensity style attribute to the style. func (s Style) NormalIntensity() Style { - return append(s, NormalIntensityAttr) + return append(s, normalIntensityAttr) } // NoItalic appends the no italic style attribute to the style. func (s Style) NoItalic() Style { - return append(s, NoItalicAttr) + return append(s, noItalicAttr) } // NoUnderline appends the no underline style attribute to the style. func (s Style) NoUnderline() Style { - return append(s, NoUnderlineAttr) + return append(s, noUnderlineAttr) } // NoBlink appends the no blink style attribute to the style. func (s Style) NoBlink() Style { - return append(s, NoBlinkAttr) + return append(s, noBlinkAttr) } // NoReverse appends the no reverse style attribute to the style. func (s Style) NoReverse() Style { - return append(s, NoReverseAttr) + return append(s, noReverseAttr) } // NoConceal appends the no conceal style attribute to the style. func (s Style) NoConceal() Style { - return append(s, NoConcealAttr) + return append(s, noConcealAttr) } // NoStrikethrough appends the no strikethrough style attribute to the style. func (s Style) NoStrikethrough() Style { - return append(s, NoStrikethroughAttr) + return append(s, noStrikethroughAttr) } // DefaultForegroundColor appends the default foreground color style attribute to the style. func (s Style) DefaultForegroundColor() Style { - return append(s, DefaultForegroundColorAttr) + return append(s, defaultForegroundColorAttr) } // DefaultBackgroundColor appends the default background color style attribute to the style. func (s Style) DefaultBackgroundColor() Style { - return append(s, DefaultBackgroundColorAttr) + return append(s, defaultBackgroundColorAttr) } // DefaultUnderlineColor appends the default underline color style attribute to the style. func (s Style) DefaultUnderlineColor() Style { - return append(s, DefaultUnderlineColorAttr) + return append(s, defaultUnderlineColorAttr) } // ForegroundColor appends the foreground color style attribute to the style. func (s Style) ForegroundColor(c Color) Style { - return append(s, ForegroundColorAttr(c)) + return append(s, foregroundColorString(c)) } // BackgroundColor appends the background color style attribute to the style. func (s Style) BackgroundColor(c Color) Style { - return append(s, BackgroundColorAttr(c)) + return append(s, backgroundColorString(c)) } // UnderlineColor appends the underline color style attribute to the style. func (s Style) UnderlineColor(c Color) Style { - return append(s, UnderlineColorAttr(c)) + return append(s, underlineColorString(c)) } +// UnderlineStyle represents an ANSI SGR (Select Graphic Rendition) underline +// style. +type UnderlineStyle = int + +const ( + doubleUnderlineStyle = "4:2" + curlyUnderlineStyle = "4:3" + dottedUnderlineStyle = "4:4" + dashedUnderlineStyle = "4:5" +) + +const ( + // NoUnderlineStyle is the default underline style. + NoUnderlineStyle UnderlineStyle = iota + // SingleUnderlineStyle is a single underline style. + SingleUnderlineStyle + // DoubleUnderlineStyle is a double underline style. + DoubleUnderlineStyle + // CurlyUnderlineStyle is a curly underline style. + CurlyUnderlineStyle + // DottedUnderlineStyle is a dotted underline style. + DottedUnderlineStyle + // DashedUnderlineStyle is a dashed underline style. + DashedUnderlineStyle +) + // SGR (Select Graphic Rendition) style attributes. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters const ( - ResetAttr Attr = "0" - BoldAttr Attr = "1" - FaintAttr Attr = "2" - ItalicAttr Attr = "3" - UnderlineAttr Attr = "4" - DoubleUnderlineAttr Attr = "4:2" - CurlyUnderlineAttr Attr = "4:3" - DottedUnderlineAttr Attr = "4:4" - DashedUnderlineAttr Attr = "4:5" - SlowBlinkAttr Attr = "5" - RapidBlinkAttr Attr = "6" - ReverseAttr Attr = "7" - ConcealAttr Attr = "8" - StrikethroughAttr Attr = "9" - NoBoldAttr Attr = "21" // Some terminals treat this as double underline. - NormalIntensityAttr Attr = "22" - NoItalicAttr Attr = "23" - NoUnderlineAttr Attr = "24" - NoBlinkAttr Attr = "25" - NoReverseAttr Attr = "27" - NoConcealAttr Attr = "28" - NoStrikethroughAttr Attr = "29" - DefaultForegroundColorAttr Attr = "39" - DefaultBackgroundColorAttr Attr = "49" - DefaultUnderlineColorAttr Attr = "59" + ResetAttr Attr = 0 + BoldAttr Attr = 1 + FaintAttr Attr = 2 + ItalicAttr Attr = 3 + UnderlineAttr Attr = 4 + SlowBlinkAttr Attr = 5 + RapidBlinkAttr Attr = 6 + ReverseAttr Attr = 7 + ConcealAttr Attr = 8 + StrikethroughAttr Attr = 9 + NoBoldAttr Attr = 21 // Some terminals treat this as double underline. + NormalIntensityAttr Attr = 22 + NoItalicAttr Attr = 23 + NoUnderlineAttr Attr = 24 + NoBlinkAttr Attr = 25 + NoReverseAttr Attr = 27 + NoConcealAttr Attr = 28 + NoStrikethroughAttr Attr = 29 + BlackForegroundColorAttr Attr = 30 + RedForegroundColorAttr Attr = 31 + GreenForegroundColorAttr Attr = 32 + YellowForegroundColorAttr Attr = 33 + BlueForegroundColorAttr Attr = 34 + MagentaForegroundColorAttr Attr = 35 + CyanForegroundColorAttr Attr = 36 + WhiteForegroundColorAttr Attr = 37 + ExtendedForegroundColorAttr Attr = 38 + DefaultForegroundColorAttr Attr = 39 + BlackBackgroundColorAttr Attr = 40 + RedBackgroundColorAttr Attr = 41 + GreenBackgroundColorAttr Attr = 42 + YellowBackgroundColorAttr Attr = 43 + BlueBackgroundColorAttr Attr = 44 + MagentaBackgroundColorAttr Attr = 45 + CyanBackgroundColorAttr Attr = 46 + WhiteBackgroundColorAttr Attr = 47 + ExtendedBackgroundColorAttr Attr = 48 + DefaultBackgroundColorAttr Attr = 49 + ExtendedUnderlineColorAttr Attr = 58 + DefaultUnderlineColorAttr Attr = 59 + BrightBlackForegroundColorAttr Attr = 90 + BrightRedForegroundColorAttr Attr = 91 + BrightGreenForegroundColorAttr Attr = 92 + BrightYellowForegroundColorAttr Attr = 93 + BrightBlueForegroundColorAttr Attr = 94 + BrightMagentaForegroundColorAttr Attr = 95 + BrightCyanForegroundColorAttr Attr = 96 + BrightWhiteForegroundColorAttr Attr = 97 + BrightBlackBackgroundColorAttr Attr = 100 + BrightRedBackgroundColorAttr Attr = 101 + BrightGreenBackgroundColorAttr Attr = 102 + BrightYellowBackgroundColorAttr Attr = 103 + BrightBlueBackgroundColorAttr Attr = 104 + BrightMagentaBackgroundColorAttr Attr = 105 + BrightCyanBackgroundColorAttr Attr = 106 + BrightWhiteBackgroundColorAttr Attr = 107 + + RGBColorIntroducerAttr Attr = 2 + ExtendedColorIntroducerAttr Attr = 5 ) -// ForegroundColorAttr returns the style SGR attribute for the given foreground -// color. +const ( + resetAttr = "0" + boldAttr = "1" + faintAttr = "2" + italicAttr = "3" + underlineAttr = "4" + slowBlinkAttr = "5" + rapidBlinkAttr = "6" + reverseAttr = "7" + concealAttr = "8" + strikethroughAttr = "9" + noBoldAttr = "21" + normalIntensityAttr = "22" + noItalicAttr = "23" + noUnderlineAttr = "24" + noBlinkAttr = "25" + noReverseAttr = "27" + noConcealAttr = "28" + noStrikethroughAttr = "29" + blackForegroundColorAttr = "30" + redForegroundColorAttr = "31" + greenForegroundColorAttr = "32" + yellowForegroundColorAttr = "33" + blueForegroundColorAttr = "34" + magentaForegroundColorAttr = "35" + cyanForegroundColorAttr = "36" + whiteForegroundColorAttr = "37" + extendedForegroundColorAttr = "38" + defaultForegroundColorAttr = "39" + blackBackgroundColorAttr = "40" + redBackgroundColorAttr = "41" + greenBackgroundColorAttr = "42" + yellowBackgroundColorAttr = "43" + blueBackgroundColorAttr = "44" + magentaBackgroundColorAttr = "45" + cyanBackgroundColorAttr = "46" + whiteBackgroundColorAttr = "47" + extendedBackgroundColorAttr = "48" + defaultBackgroundColorAttr = "49" + extendedUnderlineColorAttr = "58" + defaultUnderlineColorAttr = "59" + brightBlackForegroundColorAttr = "90" + brightRedForegroundColorAttr = "91" + brightGreenForegroundColorAttr = "92" + brightYellowForegroundColorAttr = "93" + brightBlueForegroundColorAttr = "94" + brightMagentaForegroundColorAttr = "95" + brightCyanForegroundColorAttr = "96" + brightWhiteForegroundColorAttr = "97" + brightBlackBackgroundColorAttr = "100" + brightRedBackgroundColorAttr = "101" + brightGreenBackgroundColorAttr = "102" + brightYellowBackgroundColorAttr = "103" + brightBlueBackgroundColorAttr = "104" + brightMagentaBackgroundColorAttr = "105" + brightCyanBackgroundColorAttr = "106" + brightWhiteBackgroundColorAttr = "107" +) + +// foregroundColorString returns the style SGR attribute for the given +// foreground color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func ForegroundColorAttr(c Color) Attr { +func foregroundColorString(c Color) string { switch c := c.(type) { case BasicColor: // 3-bit or 4-bit ANSI foreground // "3<n>" or "9<n>" where n is the color number from 0 to 7 - if c < 8 { - return "3" + string('0'+c) - } else if c < 16 { - return "9" + string('0'+c-8) + switch c { + case Black: + return blackForegroundColorAttr + case Red: + return redForegroundColorAttr + case Green: + return greenForegroundColorAttr + case Yellow: + return yellowForegroundColorAttr + case Blue: + return blueForegroundColorAttr + case Magenta: + return magentaForegroundColorAttr + case Cyan: + return cyanForegroundColorAttr + case White: + return whiteForegroundColorAttr + case BrightBlack: + return brightBlackForegroundColorAttr + case BrightRed: + return brightRedForegroundColorAttr + case BrightGreen: + return brightGreenForegroundColorAttr + case BrightYellow: + return brightYellowForegroundColorAttr + case BrightBlue: + return brightBlueForegroundColorAttr + case BrightMagenta: + return brightMagentaForegroundColorAttr + case BrightCyan: + return brightCyanForegroundColorAttr + case BrightWhite: + return brightWhiteForegroundColorAttr } case ExtendedColor: // 256-color ANSI foreground @@ -230,21 +401,50 @@ func ForegroundColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultForegroundColorAttr + return defaultForegroundColorAttr } -// BackgroundColorAttr returns the style SGR attribute for the given background -// color. +// backgroundColorString returns the style SGR attribute for the given +// background color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func BackgroundColorAttr(c Color) Attr { +func backgroundColorString(c Color) string { switch c := c.(type) { case BasicColor: // 3-bit or 4-bit ANSI foreground // "4<n>" or "10<n>" where n is the color number from 0 to 7 - if c < 8 { - return "4" + string('0'+c) - } else { - return "10" + string('0'+c-8) + switch c { + case Black: + return blackBackgroundColorAttr + case Red: + return redBackgroundColorAttr + case Green: + return greenBackgroundColorAttr + case Yellow: + return yellowBackgroundColorAttr + case Blue: + return blueBackgroundColorAttr + case Magenta: + return magentaBackgroundColorAttr + case Cyan: + return cyanBackgroundColorAttr + case White: + return whiteBackgroundColorAttr + case BrightBlack: + return brightBlackBackgroundColorAttr + case BrightRed: + return brightRedBackgroundColorAttr + case BrightGreen: + return brightGreenBackgroundColorAttr + case BrightYellow: + return brightYellowBackgroundColorAttr + case BrightBlue: + return brightBlueBackgroundColorAttr + case BrightMagenta: + return brightMagentaBackgroundColorAttr + case BrightCyan: + return brightCyanBackgroundColorAttr + case BrightWhite: + return brightWhiteBackgroundColorAttr } case ExtendedColor: // 256-color ANSI foreground @@ -259,13 +459,13 @@ func BackgroundColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultBackgroundColorAttr + return defaultBackgroundColorAttr } -// UnderlineColorAttr returns the style SGR attribute for the given underline +// underlineColorString returns the style SGR attribute for the given underline // color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func UnderlineColorAttr(c Color) Attr { +func underlineColorString(c Color) string { switch c := c.(type) { // NOTE: we can't use 3-bit and 4-bit ANSI color codes with underline // color, use 256-color instead. @@ -285,7 +485,7 @@ func UnderlineColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultUnderlineColorAttr + return defaultUnderlineColorAttr } func shift(v uint32) uint32 { diff --git a/source/vendor/github.com/charmbracelet/x/ansi/truncate.go b/source/vendor/github.com/charmbracelet/x/ansi/truncate.go index 03d0a12..db0782c 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/truncate.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/truncate.go @@ -12,6 +12,10 @@ import ( // This function is aware of ANSI escape codes and will not break them, and // accounts for wide-characters (such as East Asians and emojis). func Truncate(s string, length int, tail string) string { + if sw := StringWidth(s); sw <= length { + return s + } + tw := StringWidth(tail) length -= tw if length < 0 { @@ -22,7 +26,6 @@ func Truncate(s string, length int, tail string) string { var buf bytes.Buffer curWidth := 0 ignoring := false - gstate := -1 pstate := parser.GroundState // initial state b := []byte(s) i := 0 @@ -34,44 +37,40 @@ func Truncate(s string, length int, tail string) string { // collect ANSI escape codes until we reach the end of string. for i < len(b) { state, action := parser.Table.Transition(pstate, b[i]) + if state == parser.Utf8State { + // This action happens when we transition to the Utf8State. + var width int + cluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1) - switch action { - case parser.PrintAction: - if utf8ByteLen(b[i]) > 1 { - // This action happens when we transition to the Utf8State. - var width int - cluster, _, width, gstate = uniseg.FirstGraphemeCluster(b[i:], gstate) - - // increment the index by the length of the cluster - i += len(cluster) - - // Are we ignoring? Skip to the next byte - if ignoring { - continue - } - - // Is this gonna be too wide? - // If so write the tail and stop collecting. - if curWidth+width > length && !ignoring { - ignoring = true - buf.WriteString(tail) - } - - if curWidth+width > length { - continue - } - - curWidth += width - for _, r := range cluster { - buf.WriteByte(r) - } - - gstate = -1 // reset grapheme state otherwise, width calculation might be off - // Done collecting, now we're back in the ground state. - pstate = parser.GroundState + // increment the index by the length of the cluster + i += len(cluster) + + // Are we ignoring? Skip to the next byte + if ignoring { + continue + } + + // Is this gonna be too wide? + // If so write the tail and stop collecting. + if curWidth+width > length && !ignoring { + ignoring = true + buf.WriteString(tail) + } + + if curWidth+width > length { continue } + curWidth += width + buf.Write(cluster) + + // Done collecting, now we're back in the ground state. + pstate = parser.GroundState + continue + } + + switch action { + case parser.PrintAction: // Is this gonna be too wide? // If so write the tail and stop collecting. if curWidth >= length && !ignoring { diff --git a/source/vendor/github.com/charmbracelet/x/ansi/width.go b/source/vendor/github.com/charmbracelet/x/ansi/width.go index 4da3959..80890e4 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/width.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/width.go @@ -19,13 +19,7 @@ func Strip(s string) string { // This implements a subset of the Parser to only collect runes and // printable characters. for i := 0; i < len(s); i++ { - var state, action byte - if pstate != parser.Utf8State { - state, action = parser.Table.Transition(pstate, s[i]) - } - - switch { - case pstate == parser.Utf8State: + if pstate == parser.Utf8State { // During this state, collect rw bytes to form a valid rune in the // buffer. After getting all the rune bytes into the buffer, // transition to GroundState and reset the counters. @@ -37,16 +31,19 @@ func Strip(s string) string { pstate = parser.GroundState ri = 0 rw = 0 - case action == parser.PrintAction: - // This action happens when we transition to the Utf8State. - if w := utf8ByteLen(s[i]); w > 1 { - rw = w + continue + } + + state, action := parser.Table.Transition(pstate, s[i]) + switch action { + case parser.CollectAction: + if state == parser.Utf8State { + // This action happens when we transition to the Utf8State. + rw = utf8ByteLen(s[i]) buf.WriteByte(s[i]) ri++ - break } - fallthrough - case action == parser.ExecuteAction: + case parser.PrintAction, parser.ExecuteAction: // collects printable ASCII and non-printable characters buf.WriteByte(s[i]) } @@ -69,5 +66,30 @@ func StringWidth(s string) int { if s == "" { return 0 } - return uniseg.StringWidth(Strip(s)) + + var ( + pstate = parser.GroundState // initial state + cluster string + width int + ) + + for i := 0; i < len(s); i++ { + state, action := parser.Table.Transition(pstate, s[i]) + if state == parser.Utf8State { + var w int + cluster, _, w, _ = uniseg.FirstGraphemeClusterInString(s[i:], -1) + width += w + i += len(cluster) - 1 + pstate = parser.GroundState + continue + } + + if action == parser.PrintAction { + width++ + } + + pstate = state + } + + return width } diff --git a/source/vendor/github.com/charmbracelet/x/ansi/wrap.go b/source/vendor/github.com/charmbracelet/x/ansi/wrap.go index 9aa9b64..77d239a 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/wrap.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/wrap.go @@ -27,7 +27,6 @@ func Hardwrap(s string, limit int, preserveSpace bool) string { buf bytes.Buffer curWidth int forceNewline bool - gstate = -1 pstate = parser.GroundState // initial state b = []byte(s) ) @@ -40,33 +39,30 @@ func Hardwrap(s string, limit int, preserveSpace bool) string { i := 0 for i < len(b) { state, action := parser.Table.Transition(pstate, b[i]) + if state == parser.Utf8State { + var width int + cluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1) + i += len(cluster) - switch action { - case parser.PrintAction: - if utf8ByteLen(b[i]) > 1 { - var width int - cluster, _, width, gstate = uniseg.FirstGraphemeCluster(b[i:], gstate) - i += len(cluster) - - if curWidth+width > limit { - addNewline() - } - if !preserveSpace && curWidth == 0 && len(cluster) <= 4 { - // Skip spaces at the beginning of a line - if r, _ := utf8.DecodeRune(cluster); r != utf8.RuneError && unicode.IsSpace(r) { - pstate = parser.GroundState - continue - } + if curWidth+width > limit { + addNewline() + } + if !preserveSpace && curWidth == 0 && len(cluster) <= 4 { + // Skip spaces at the beginning of a line + if r, _ := utf8.DecodeRune(cluster); r != utf8.RuneError && unicode.IsSpace(r) { + pstate = parser.GroundState + continue } - - buf.Write(cluster) - curWidth += width - gstate = -1 // reset grapheme state otherwise, width calculation might be off - pstate = parser.GroundState - continue } - fallthrough - case parser.ExecuteAction: + + buf.Write(cluster) + curWidth += width + pstate = parser.GroundState + continue + } + + switch action { + case parser.PrintAction, parser.ExecuteAction: if b[i] == '\n' { addNewline() forceNewline = false @@ -87,7 +83,9 @@ func Hardwrap(s string, limit int, preserveSpace bool) string { } buf.WriteByte(b[i]) - curWidth++ + if action == parser.PrintAction { + curWidth++ + } default: buf.WriteByte(b[i]) } @@ -122,7 +120,6 @@ func Wordwrap(s string, limit int, breakpoints string) string { space bytes.Buffer curWidth int wordLen int - gstate = -1 pstate = parser.GroundState // initial state b = []byte(s) ) @@ -154,37 +151,35 @@ func Wordwrap(s string, limit int, breakpoints string) string { i := 0 for i < len(b) { state, action := parser.Table.Transition(pstate, b[i]) + if state == parser.Utf8State { + var width int + cluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1) + i += len(cluster) - switch action { - case parser.PrintAction: - if utf8ByteLen(b[i]) > 1 { - var width int - cluster, _, width, gstate = uniseg.FirstGraphemeCluster(b[i:], gstate) - i += len(cluster) - - r, _ := utf8.DecodeRune(cluster) - if r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp { - addWord() - space.WriteRune(r) - } else if bytes.ContainsAny(cluster, breakpoints) { - addSpace() - addWord() - buf.Write(cluster) - curWidth++ - } else { - word.Write(cluster) - wordLen += width - if curWidth+space.Len()+wordLen > limit && - wordLen < limit { - addNewline() - } + r, _ := utf8.DecodeRune(cluster) + if r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp { + addWord() + space.WriteRune(r) + } else if bytes.ContainsAny(cluster, breakpoints) { + addSpace() + addWord() + buf.Write(cluster) + curWidth++ + } else { + word.Write(cluster) + wordLen += width + if curWidth+space.Len()+wordLen > limit && + wordLen < limit { + addNewline() } - - pstate = parser.GroundState - continue } - fallthrough - case parser.ExecuteAction: + + pstate = parser.GroundState + continue + } + + switch action { + case parser.PrintAction, parser.ExecuteAction: r := rune(b[i]) switch { case r == '\n': @@ -251,9 +246,8 @@ func Wrap(s string, limit int, breakpoints string) string { buf bytes.Buffer word bytes.Buffer space bytes.Buffer - curWidth int // written width of the line - wordLen int // word buffer len without ANSI escape codes - gstate = -1 + curWidth int // written width of the line + wordLen int // word buffer len without ANSI escape codes pstate = parser.GroundState // initial state b = []byte(s) ) @@ -285,49 +279,46 @@ func Wrap(s string, limit int, breakpoints string) string { i := 0 for i < len(b) { state, action := parser.Table.Transition(pstate, b[i]) + if state == parser.Utf8State { + var width int + cluster, _, width, _ = uniseg.FirstGraphemeCluster(b[i:], -1) + i += len(cluster) - switch action { - case parser.PrintAction: - if utf8ByteLen(b[i]) > 1 { - var width int - cluster, _, width, gstate = uniseg.FirstGraphemeCluster(b[i:], gstate) - i += len(cluster) - - r, _ := utf8.DecodeRune(cluster) - switch { - case r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp: // nbsp is a non-breaking space - addWord() - space.WriteRune(r) - case bytes.ContainsAny(cluster, breakpoints): - addSpace() - if curWidth+wordLen+width > limit { - word.Write(cluster) - wordLen += width - } else { - addWord() - buf.Write(cluster) - curWidth += width - } - default: - if wordLen+width > limit { - // Hardwrap the word if it's too long - addWord() - } - + r, _ := utf8.DecodeRune(cluster) + switch { + case r != utf8.RuneError && unicode.IsSpace(r) && r != nbsp: // nbsp is a non-breaking space + addWord() + space.WriteRune(r) + case bytes.ContainsAny(cluster, breakpoints): + addSpace() + if curWidth+wordLen+width > limit { word.Write(cluster) wordLen += width - - if curWidth+wordLen+space.Len() > limit { - addNewline() - } + } else { + addWord() + buf.Write(cluster) + curWidth += width + } + default: + if wordLen+width > limit { + // Hardwrap the word if it's too long + addWord() } - pstate = parser.GroundState - continue + word.Write(cluster) + wordLen += width + + if curWidth+wordLen+space.Len() > limit { + addNewline() + } } - fallthrough - case parser.ExecuteAction: + pstate = parser.GroundState + continue + } + + switch action { + case parser.PrintAction, parser.ExecuteAction: switch r := rune(b[i]); { case r == '\n': if wordLen == 0 { @@ -360,6 +351,9 @@ func Wrap(s string, limit int, breakpoints string) string { curWidth++ } default: + if curWidth == limit { + addNewline() + } word.WriteRune(r) wordLen++ diff --git a/source/vendor/github.com/charmbracelet/x/ansi/xterm.go b/source/vendor/github.com/charmbracelet/x/ansi/xterm.go index e2eb10a..f87712a 100644 --- a/source/vendor/github.com/charmbracelet/x/ansi/xterm.go +++ b/source/vendor/github.com/charmbracelet/x/ansi/xterm.go @@ -1,5 +1,22 @@ package ansi +import "strconv" + +// ModifyOtherKeys returns a sequence that sets XTerm modifyOtherKeys mode. +// The mode argument specifies the mode to set. +// +// 0: Disable modifyOtherKeys mode. +// 1: Enable modifyOtherKeys mode 1. +// 2: Enable modifyOtherKeys mode 2. +// +// CSI > 4 ; mode m +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_ +// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys +func ModifyOtherKeys(mode int) string { + return "\x1b[>4;" + strconv.Itoa(mode) + "m" +} + // DisableModifyOtherKeys disables the modifyOtherKeys mode. // // CSI > 4 ; 0 m diff --git a/source/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/source/vendor/github.com/mattn/go-runewidth/runewidth_table.go index e5d890c..ad025ad 100644 --- a/source/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ b/source/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -4,20 +4,21 @@ package runewidth var combining = table{ {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, - {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01}, - {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1AC0}, - {0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF}, + {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0CF3, 0x0CF3}, + {0x0D00, 0x0D01}, {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, + {0x1AB0, 0x1ACE}, {0x1B6B, 0x1B73}, {0x1DC0, 0x1DFF}, {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A}, - {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, {0x11300, 0x11301}, - {0x1133B, 0x1133C}, {0x11366, 0x1136C}, {0x11370, 0x11374}, - {0x16AF0, 0x16AF4}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, + {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, {0x10F82, 0x10F85}, + {0x11300, 0x11301}, {0x1133B, 0x1133C}, {0x11366, 0x1136C}, + {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, - {0x1E8D0, 0x1E8D6}, + {0x1E08F, 0x1E08F}, {0x1E8D0, 0x1E8D6}, } var doublewidth = table{ @@ -33,33 +34,34 @@ var doublewidth = table{ {0x2753, 0x2755}, {0x2757, 0x2757}, {0x2795, 0x2797}, {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, {0x2B1B, 0x2B1C}, {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99}, - {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB}, - {0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF}, - {0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E3}, - {0x31F0, 0x321E}, {0x3220, 0x3247}, {0x3250, 0x4DBF}, - {0x4E00, 0xA48C}, {0xA490, 0xA4C6}, {0xA960, 0xA97C}, - {0xAC00, 0xD7A3}, {0xF900, 0xFAFF}, {0xFE10, 0xFE19}, - {0xFE30, 0xFE52}, {0xFE54, 0xFE66}, {0xFE68, 0xFE6B}, - {0xFF01, 0xFF60}, {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE4}, - {0x16FF0, 0x16FF1}, {0x17000, 0x187F7}, {0x18800, 0x18CD5}, - {0x18D00, 0x18D08}, {0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, - {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1F004, 0x1F004}, - {0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, - {0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, - {0x1F250, 0x1F251}, {0x1F260, 0x1F265}, {0x1F300, 0x1F320}, - {0x1F32D, 0x1F335}, {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, - {0x1F3A0, 0x1F3CA}, {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, - {0x1F3F4, 0x1F3F4}, {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, - {0x1F442, 0x1F4FC}, {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, - {0x1F550, 0x1F567}, {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, - {0x1F5A4, 0x1F5A4}, {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, - {0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D7}, - {0x1F6EB, 0x1F6EC}, {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB}, - {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1F978}, - {0x1F97A, 0x1F9CB}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA74}, - {0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA86}, {0x1FA90, 0x1FAA8}, - {0x1FAB0, 0x1FAB6}, {0x1FAC0, 0x1FAC2}, {0x1FAD0, 0x1FAD6}, - {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, + {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x303E}, + {0x3041, 0x3096}, {0x3099, 0x30FF}, {0x3105, 0x312F}, + {0x3131, 0x318E}, {0x3190, 0x31E3}, {0x31EF, 0x321E}, + {0x3220, 0x3247}, {0x3250, 0x4DBF}, {0x4E00, 0xA48C}, + {0xA490, 0xA4C6}, {0xA960, 0xA97C}, {0xAC00, 0xD7A3}, + {0xF900, 0xFAFF}, {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, + {0xFE54, 0xFE66}, {0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, + {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE4}, {0x16FF0, 0x16FF1}, + {0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08}, + {0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, {0x1B132, 0x1B132}, {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, + {0x1F004, 0x1F004}, {0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, + {0x1F191, 0x1F19A}, {0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, + {0x1F240, 0x1F248}, {0x1F250, 0x1F251}, {0x1F260, 0x1F265}, + {0x1F300, 0x1F320}, {0x1F32D, 0x1F335}, {0x1F337, 0x1F37C}, + {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA}, {0x1F3CF, 0x1F3D3}, + {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4}, {0x1F3F8, 0x1F43E}, + {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC}, {0x1F4FF, 0x1F53D}, + {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567}, {0x1F57A, 0x1F57A}, + {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4}, {0x1F5FB, 0x1F64F}, + {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, + {0x1F6D5, 0x1F6D7}, {0x1F6DC, 0x1F6DF}, {0x1F6EB, 0x1F6EC}, + {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB}, {0x1F7F0, 0x1F7F0}, + {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1F9FF}, + {0x1FA70, 0x1FA7C}, {0x1FA80, 0x1FA88}, {0x1FA90, 0x1FABD}, + {0x1FABF, 0x1FAC5}, {0x1FACE, 0x1FADB}, {0x1FAE0, 0x1FAE8}, + {0x1FAF0, 0x1FAF8}, {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, } var ambiguous = table{ @@ -154,43 +156,43 @@ var neutral = table{ {0x0402, 0x040F}, {0x0450, 0x0450}, {0x0452, 0x052F}, {0x0531, 0x0556}, {0x0559, 0x058A}, {0x058D, 0x058F}, {0x0591, 0x05C7}, {0x05D0, 0x05EA}, {0x05EF, 0x05F4}, - {0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A}, - {0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D}, - {0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E}, - {0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08C7}, - {0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990}, - {0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, - {0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, - {0x09CB, 0x09CE}, {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, - {0x09DF, 0x09E3}, {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, - {0x0A05, 0x0A0A}, {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, - {0x0A2A, 0x0A30}, {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, - {0x0A38, 0x0A39}, {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, - {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, - {0x0A59, 0x0A5C}, {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, - {0x0A81, 0x0A83}, {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, - {0x0A93, 0x0AA8}, {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, - {0x0AB5, 0x0AB9}, {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, - {0x0ACB, 0x0ACD}, {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, - {0x0AE6, 0x0AF1}, {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, - {0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, - {0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, - {0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, - {0x0B55, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, - {0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, - {0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, - {0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, - {0x0BA8, 0x0BAA}, {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, - {0x0BC6, 0x0BC8}, {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, - {0x0BD7, 0x0BD7}, {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, - {0x0C0E, 0x0C10}, {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, - {0x0C3D, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, - {0x0C55, 0x0C56}, {0x0C58, 0x0C5A}, {0x0C60, 0x0C63}, + {0x0600, 0x070D}, {0x070F, 0x074A}, {0x074D, 0x07B1}, + {0x07C0, 0x07FA}, {0x07FD, 0x082D}, {0x0830, 0x083E}, + {0x0840, 0x085B}, {0x085E, 0x085E}, {0x0860, 0x086A}, + {0x0870, 0x088E}, {0x0890, 0x0891}, {0x0898, 0x0983}, + {0x0985, 0x098C}, {0x098F, 0x0990}, {0x0993, 0x09A8}, + {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, {0x09B6, 0x09B9}, + {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, {0x09CB, 0x09CE}, + {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, {0x09DF, 0x09E3}, + {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, {0x0A05, 0x0A0A}, + {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, {0x0A2A, 0x0A30}, + {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, {0x0A38, 0x0A39}, + {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, {0x0A47, 0x0A48}, + {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, {0x0A59, 0x0A5C}, + {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, {0x0A81, 0x0A83}, + {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, {0x0A93, 0x0AA8}, + {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, {0x0AB5, 0x0AB9}, + {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, {0x0ACB, 0x0ACD}, + {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, {0x0AE6, 0x0AF1}, + {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, {0x0B05, 0x0B0C}, + {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, {0x0B2A, 0x0B30}, + {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, {0x0B3C, 0x0B44}, + {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, {0x0B55, 0x0B57}, + {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, {0x0B66, 0x0B77}, + {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, {0x0B8E, 0x0B90}, + {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, {0x0B9C, 0x0B9C}, + {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, {0x0BA8, 0x0BAA}, + {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, {0x0BC6, 0x0BC8}, + {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, {0x0BD7, 0x0BD7}, + {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, {0x0C0E, 0x0C10}, + {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, {0x0C3C, 0x0C44}, + {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, + {0x0C58, 0x0C5A}, {0x0C5D, 0x0C5D}, {0x0C60, 0x0C63}, {0x0C66, 0x0C6F}, {0x0C77, 0x0C8C}, {0x0C8E, 0x0C90}, {0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9}, {0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, - {0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3}, - {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D0C}, + {0x0CD5, 0x0CD6}, {0x0CDD, 0x0CDE}, {0x0CE0, 0x0CE3}, + {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF3}, {0x0D00, 0x0D0C}, {0x0D0E, 0x0D10}, {0x0D12, 0x0D44}, {0x0D46, 0x0D48}, {0x0D4A, 0x0D4F}, {0x0D54, 0x0D63}, {0x0D66, 0x0D7F}, {0x0D81, 0x0D83}, {0x0D85, 0x0D96}, {0x0D9A, 0x0DB1}, @@ -200,7 +202,7 @@ var neutral = table{ {0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B}, {0x0E81, 0x0E82}, {0x0E84, 0x0E84}, {0x0E86, 0x0E8A}, {0x0E8C, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD}, {0x0EC0, 0x0EC4}, - {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD}, {0x0ED0, 0x0ED9}, + {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECE}, {0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, {0x0F00, 0x0F47}, {0x0F49, 0x0F6C}, {0x0F71, 0x0F97}, {0x0F99, 0x0FBC}, {0x0FBE, 0x0FCC}, {0x0FCE, 0x0FDA}, {0x1000, 0x10C5}, {0x10C7, 0x10C7}, @@ -212,20 +214,19 @@ var neutral = table{ {0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A}, {0x135D, 0x137C}, {0x1380, 0x1399}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x169C}, {0x16A0, 0x16F8}, - {0x1700, 0x170C}, {0x170E, 0x1714}, {0x1720, 0x1736}, - {0x1740, 0x1753}, {0x1760, 0x176C}, {0x176E, 0x1770}, - {0x1772, 0x1773}, {0x1780, 0x17DD}, {0x17E0, 0x17E9}, - {0x17F0, 0x17F9}, {0x1800, 0x180E}, {0x1810, 0x1819}, - {0x1820, 0x1878}, {0x1880, 0x18AA}, {0x18B0, 0x18F5}, - {0x1900, 0x191E}, {0x1920, 0x192B}, {0x1930, 0x193B}, - {0x1940, 0x1940}, {0x1944, 0x196D}, {0x1970, 0x1974}, - {0x1980, 0x19AB}, {0x19B0, 0x19C9}, {0x19D0, 0x19DA}, - {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, {0x1A60, 0x1A7C}, - {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, {0x1AA0, 0x1AAD}, - {0x1AB0, 0x1AC0}, {0x1B00, 0x1B4B}, {0x1B50, 0x1B7C}, - {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, {0x1C3B, 0x1C49}, - {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, {0x1CBD, 0x1CC7}, - {0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, {0x1DFB, 0x1F15}, + {0x1700, 0x1715}, {0x171F, 0x1736}, {0x1740, 0x1753}, + {0x1760, 0x176C}, {0x176E, 0x1770}, {0x1772, 0x1773}, + {0x1780, 0x17DD}, {0x17E0, 0x17E9}, {0x17F0, 0x17F9}, + {0x1800, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B}, + {0x1930, 0x193B}, {0x1940, 0x1940}, {0x1944, 0x196D}, + {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, + {0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, + {0x1AA0, 0x1AAD}, {0x1AB0, 0x1ACE}, {0x1B00, 0x1B4C}, + {0x1B50, 0x1B7E}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, + {0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F59, 0x1F59}, {0x1F5B, 0x1F5B}, {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4}, @@ -237,7 +238,7 @@ var neutral = table{ {0x2036, 0x203A}, {0x203C, 0x203D}, {0x203F, 0x2064}, {0x2066, 0x2071}, {0x2075, 0x207E}, {0x2080, 0x2080}, {0x2085, 0x208E}, {0x2090, 0x209C}, {0x20A0, 0x20A8}, - {0x20AA, 0x20AB}, {0x20AD, 0x20BF}, {0x20D0, 0x20F0}, + {0x20AA, 0x20AB}, {0x20AD, 0x20C0}, {0x20D0, 0x20F0}, {0x2100, 0x2102}, {0x2104, 0x2104}, {0x2106, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2115}, {0x2117, 0x2120}, {0x2123, 0x2125}, {0x2127, 0x212A}, {0x212C, 0x2152}, @@ -275,15 +276,15 @@ var neutral = table{ {0x2780, 0x2794}, {0x2798, 0x27AF}, {0x27B1, 0x27BE}, {0x27C0, 0x27E5}, {0x27EE, 0x2984}, {0x2987, 0x2B1A}, {0x2B1D, 0x2B4F}, {0x2B51, 0x2B54}, {0x2B5A, 0x2B73}, - {0x2B76, 0x2B95}, {0x2B97, 0x2C2E}, {0x2C30, 0x2C5E}, - {0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, {0x2D27, 0x2D27}, - {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, {0x2D6F, 0x2D70}, - {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE}, - {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6}, - {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE}, - {0x2DE0, 0x2E52}, {0x303F, 0x303F}, {0x4DC0, 0x4DFF}, - {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, {0xA700, 0xA7BF}, - {0xA7C2, 0xA7CA}, {0xA7F5, 0xA82C}, {0xA830, 0xA839}, + {0x2B76, 0x2B95}, {0x2B97, 0x2CF3}, {0x2CF9, 0x2D25}, + {0x2D27, 0x2D27}, {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, + {0x2D6F, 0x2D70}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, {0x2DE0, 0x2E5D}, {0x303F, 0x303F}, + {0x4DC0, 0x4DFF}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, + {0xA700, 0xA7CA}, {0xA7D0, 0xA7D1}, {0xA7D3, 0xA7D3}, + {0xA7D5, 0xA7D9}, {0xA7F2, 0xA82C}, {0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5}, {0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA95F}, {0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, {0xAA00, 0xAA36}, @@ -294,8 +295,8 @@ var neutral = table{ {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, {0xD800, 0xDFFF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, {0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, {0xFB40, 0xFB41}, - {0xFB43, 0xFB44}, {0xFB46, 0xFBC1}, {0xFBD3, 0xFD3F}, - {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, {0xFDF0, 0xFDFD}, + {0xFB43, 0xFB44}, {0xFB46, 0xFBC2}, {0xFBD3, 0xFD8F}, + {0xFD92, 0xFDC7}, {0xFDCF, 0xFDCF}, {0xFDF0, 0xFDFF}, {0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC}, {0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, {0x1003C, 0x1003D}, @@ -307,44 +308,48 @@ var neutral = table{ {0x10380, 0x1039D}, {0x1039F, 0x103C3}, {0x103C8, 0x103D5}, {0x10400, 0x1049D}, {0x104A0, 0x104A9}, {0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527}, {0x10530, 0x10563}, - {0x1056F, 0x1056F}, {0x10600, 0x10736}, {0x10740, 0x10755}, - {0x10760, 0x10767}, {0x10800, 0x10805}, {0x10808, 0x10808}, - {0x1080A, 0x10835}, {0x10837, 0x10838}, {0x1083C, 0x1083C}, - {0x1083F, 0x10855}, {0x10857, 0x1089E}, {0x108A7, 0x108AF}, - {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, {0x108FB, 0x1091B}, - {0x1091F, 0x10939}, {0x1093F, 0x1093F}, {0x10980, 0x109B7}, - {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, {0x10A05, 0x10A06}, - {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35}, - {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, {0x10A50, 0x10A58}, - {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, {0x10AEB, 0x10AF6}, - {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, {0x10B58, 0x10B72}, - {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF}, - {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, - {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, {0x10E60, 0x10E7E}, - {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, {0x10EB0, 0x10EB1}, - {0x10F00, 0x10F27}, {0x10F30, 0x10F59}, {0x10FB0, 0x10FCB}, - {0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F}, - {0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, - {0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11147}, - {0x11150, 0x11176}, {0x11180, 0x111DF}, {0x111E1, 0x111F4}, - {0x11200, 0x11211}, {0x11213, 0x1123E}, {0x11280, 0x11286}, - {0x11288, 0x11288}, {0x1128A, 0x1128D}, {0x1128F, 0x1129D}, - {0x1129F, 0x112A9}, {0x112B0, 0x112EA}, {0x112F0, 0x112F9}, - {0x11300, 0x11303}, {0x11305, 0x1130C}, {0x1130F, 0x11310}, - {0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11332, 0x11333}, - {0x11335, 0x11339}, {0x1133B, 0x11344}, {0x11347, 0x11348}, - {0x1134B, 0x1134D}, {0x11350, 0x11350}, {0x11357, 0x11357}, - {0x1135D, 0x11363}, {0x11366, 0x1136C}, {0x11370, 0x11374}, - {0x11400, 0x1145B}, {0x1145D, 0x11461}, {0x11480, 0x114C7}, - {0x114D0, 0x114D9}, {0x11580, 0x115B5}, {0x115B8, 0x115DD}, - {0x11600, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166C}, - {0x11680, 0x116B8}, {0x116C0, 0x116C9}, {0x11700, 0x1171A}, - {0x1171D, 0x1172B}, {0x11730, 0x1173F}, {0x11800, 0x1183B}, - {0x118A0, 0x118F2}, {0x118FF, 0x11906}, {0x11909, 0x11909}, - {0x1190C, 0x11913}, {0x11915, 0x11916}, {0x11918, 0x11935}, - {0x11937, 0x11938}, {0x1193B, 0x11946}, {0x11950, 0x11959}, - {0x119A0, 0x119A7}, {0x119AA, 0x119D7}, {0x119DA, 0x119E4}, - {0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, {0x11AC0, 0x11AF8}, + {0x1056F, 0x1057A}, {0x1057C, 0x1058A}, {0x1058C, 0x10592}, + {0x10594, 0x10595}, {0x10597, 0x105A1}, {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, {0x105BB, 0x105BC}, {0x10600, 0x10736}, + {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10780, 0x10785}, + {0x10787, 0x107B0}, {0x107B2, 0x107BA}, {0x10800, 0x10805}, + {0x10808, 0x10808}, {0x1080A, 0x10835}, {0x10837, 0x10838}, + {0x1083C, 0x1083C}, {0x1083F, 0x10855}, {0x10857, 0x1089E}, + {0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, + {0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x1093F}, + {0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, + {0x10A05, 0x10A06}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, + {0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, + {0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, + {0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, + {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, + {0x10E60, 0x10E7E}, {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, + {0x10EB0, 0x10EB1}, {0x10EFD, 0x10F27}, {0x10F30, 0x10F59}, + {0x10F70, 0x10F89}, {0x10FB0, 0x10FCB}, {0x10FE0, 0x10FF6}, + {0x11000, 0x1104D}, {0x11052, 0x11075}, {0x1107F, 0x110C2}, + {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, {0x110F0, 0x110F9}, + {0x11100, 0x11134}, {0x11136, 0x11147}, {0x11150, 0x11176}, + {0x11180, 0x111DF}, {0x111E1, 0x111F4}, {0x11200, 0x11211}, + {0x11213, 0x11241}, {0x11280, 0x11286}, {0x11288, 0x11288}, + {0x1128A, 0x1128D}, {0x1128F, 0x1129D}, {0x1129F, 0x112A9}, + {0x112B0, 0x112EA}, {0x112F0, 0x112F9}, {0x11300, 0x11303}, + {0x11305, 0x1130C}, {0x1130F, 0x11310}, {0x11313, 0x11328}, + {0x1132A, 0x11330}, {0x11332, 0x11333}, {0x11335, 0x11339}, + {0x1133B, 0x11344}, {0x11347, 0x11348}, {0x1134B, 0x1134D}, + {0x11350, 0x11350}, {0x11357, 0x11357}, {0x1135D, 0x11363}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x11400, 0x1145B}, + {0x1145D, 0x11461}, {0x11480, 0x114C7}, {0x114D0, 0x114D9}, + {0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644}, + {0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B9}, + {0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B}, + {0x11730, 0x11746}, {0x11800, 0x1183B}, {0x118A0, 0x118F2}, + {0x118FF, 0x11906}, {0x11909, 0x11909}, {0x1190C, 0x11913}, + {0x11915, 0x11916}, {0x11918, 0x11935}, {0x11937, 0x11938}, + {0x1193B, 0x11946}, {0x11950, 0x11959}, {0x119A0, 0x119A7}, + {0x119AA, 0x119D7}, {0x119DA, 0x119E4}, {0x11A00, 0x11A47}, + {0x11A50, 0x11AA2}, {0x11AB0, 0x11AF8}, {0x11B00, 0x11B09}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, {0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, {0x11D08, 0x11D09}, @@ -352,30 +357,36 @@ var neutral = table{ {0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, {0x11D60, 0x11D65}, {0x11D67, 0x11D68}, {0x11D6A, 0x11D8E}, {0x11D90, 0x11D91}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, {0x11EE0, 0x11EF8}, + {0x11F00, 0x11F10}, {0x11F12, 0x11F3A}, {0x11F3E, 0x11F59}, {0x11FB0, 0x11FB0}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399}, {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, - {0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646}, + {0x12F90, 0x12FF2}, {0x13000, 0x13455}, {0x14400, 0x14646}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, - {0x16A6E, 0x16A6F}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, - {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, - {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16E40, 0x16E9A}, - {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F}, - {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, - {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, {0x1D000, 0x1D0F5}, - {0x1D100, 0x1D126}, {0x1D129, 0x1D1E8}, {0x1D200, 0x1D245}, - {0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, - {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, - {0x1D4A2, 0x1D4A2}, {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, - {0x1D4AE, 0x1D4B9}, {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, - {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, - {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, - {0x1D540, 0x1D544}, {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, - {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, - {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, - {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E2C0, 0x1E2F9}, - {0x1E2FF, 0x1E2FF}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, + {0x16A6E, 0x16ABE}, {0x16AC0, 0x16AC9}, {0x16AD0, 0x16AED}, + {0x16AF0, 0x16AF5}, {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, + {0x16B5B, 0x16B61}, {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, + {0x16E40, 0x16E9A}, {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, + {0x16F8F, 0x16F9F}, {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, + {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1CF50, 0x1CFC3}, + {0x1D000, 0x1D0F5}, {0x1D100, 0x1D126}, {0x1D129, 0x1D1EA}, + {0x1D200, 0x1D245}, {0x1D2C0, 0x1D2D3}, {0x1D2E0, 0x1D2F3}, + {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, {0x1DF00, 0x1DF1E}, {0x1DF25, 0x1DF2A}, + {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, + {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E290, 0x1E2AE}, + {0x1E2C0, 0x1E2F9}, {0x1E2FF, 0x1E2FF}, {0x1E4D0, 0x1E4F9}, + {0x1E7E0, 0x1E7E6}, {0x1E7E8, 0x1E7EB}, {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, {0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1E95E, 0x1E95F}, {0x1EC71, 0x1ECB4}, {0x1ED01, 0x1ED3D}, {0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE21, 0x1EE22}, {0x1EE24, 0x1EE24}, @@ -400,8 +411,8 @@ var neutral = table{ {0x1F54F, 0x1F54F}, {0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, {0x1F597, 0x1F5A3}, {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, {0x1F6C6, 0x1F6CB}, {0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4}, - {0x1F6E0, 0x1F6EA}, {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, - {0x1F780, 0x1F7D8}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, + {0x1F6E0, 0x1F6EA}, {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F776}, + {0x1F77B, 0x1F7D9}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F8B0, 0x1F8B1}, {0x1F900, 0x1F90B}, {0x1F93B, 0x1F93B}, {0x1F946, 0x1F946}, {0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D}, diff --git a/source/vendor/github.com/tdewolff/parse/v2/binary.go b/source/vendor/github.com/tdewolff/parse/v2/binary.go index 83c08d7..0b2dd8d 100644 --- a/source/vendor/github.com/tdewolff/parse/v2/binary.go +++ b/source/vendor/github.com/tdewolff/parse/v2/binary.go @@ -2,12 +2,15 @@ package parse import ( "encoding/binary" + "errors" "fmt" "io" "math" "os" ) +const PageSize = 4096 + // BinaryReader is a binary big endian file format reader. type BinaryReader struct { Endianness binary.ByteOrder @@ -330,6 +333,312 @@ func (r *BinaryFileReader) ReadInt64() int64 { return int64(r.ReadUint64()) } +type IBinaryReader interface { + Close() error + Len() int + Bytes(int, int64) ([]byte, error) +} + +type binaryReaderFile struct { + f *os.File + size int64 +} + +func newBinaryReaderFile(filename string) (*binaryReaderFile, error) { + f, err := os.Open(filename) + if err != nil { + return nil, err + } + fi, err := f.Stat() + if err != nil { + f.Close() + return nil, err + } + return &binaryReaderFile{f, fi.Size()}, nil +} + +// Close closes the reader. +func (r *binaryReaderFile) Close() error { + return r.f.Close() +} + +// Len returns the length of the underlying memory-mapped file. +func (r *binaryReaderFile) Len() int { + return int(r.size) +} + +func (r *binaryReaderFile) Bytes(n int, off int64) ([]byte, error) { + if _, err := r.f.Seek(off, 0); err != nil { + return nil, err + } + + b := make([]byte, n) + m, err := r.f.Read(b) + if err != nil { + return nil, err + } else if m != n { + return nil, errors.New("file: could not read all bytes") + } + return b, nil +} + +type binaryReaderBytes struct { + data []byte +} + +func newBinaryReaderBytes(data []byte) (*binaryReaderBytes, error) { + return &binaryReaderBytes{data}, nil +} + +// Close closes the reader. +func (r *binaryReaderBytes) Close() error { + return nil +} + +// Len returns the length of the underlying memory-mapped file. +func (r *binaryReaderBytes) Len() int { + return len(r.data) +} + +func (r *binaryReaderBytes) Bytes(n int, off int64) ([]byte, error) { + if off < 0 || int64(len(r.data)) < off { + return nil, fmt.Errorf("bytes: invalid offset %d", off) + } + return r.data[off : off+int64(n) : off+int64(n)], nil +} + +type binaryReaderReader struct { + r io.Reader + n int64 + readerAt bool + seeker bool +} + +func newBinaryReaderReader(r io.Reader, n int64) (*binaryReaderReader, error) { + _, readerAt := r.(io.ReaderAt) + _, seeker := r.(io.Seeker) + return &binaryReaderReader{r, n, readerAt, seeker}, nil +} + +// Close closes the reader. +func (r *binaryReaderReader) Close() error { + if closer, ok := r.r.(io.Closer); ok { + return closer.Close() + } + return nil +} + +// Len returns the length of the underlying memory-mapped file. +func (r *binaryReaderReader) Len() int { + return int(r.n) +} + +func (r *binaryReaderReader) Bytes(n int, off int64) ([]byte, error) { + // seeker seems faster than readerAt by 10% + if r.seeker { + if _, err := r.r.(io.Seeker).Seek(off, 0); err != nil { + return nil, err + } + + b := make([]byte, n) + m, err := r.r.Read(b) + if err != nil { + return nil, err + } else if m != n { + return nil, errors.New("file: could not read all bytes") + } + return b, nil + } else if r.readerAt { + b := make([]byte, n) + m, err := r.r.(io.ReaderAt).ReadAt(b, off) + if err != nil { + return nil, err + } else if m != n { + return nil, errors.New("file: could not read all bytes") + } + return b, nil + } + return nil, errors.New("io.Seeker and io.ReaderAt not implemented") +} + +type BinaryReader2 struct { + f IBinaryReader + pos int64 + err error + + Endian binary.ByteOrder +} + +func NewBinaryReader2(f IBinaryReader) *BinaryReader2 { + return &BinaryReader2{ + f: f, + Endian: binary.BigEndian, + } +} + +func NewBinaryReader2Reader(r io.Reader, n int64) (*BinaryReader2, error) { + _, isReaderAt := r.(io.ReaderAt) + _, isSeeker := r.(io.Seeker) + + var f IBinaryReader + if isReaderAt || isSeeker { + var err error + f, err = newBinaryReaderReader(r, n) + if err != nil { + return nil, err + } + } else { + b := make([]byte, n) + if _, err := io.ReadFull(r, b); err != nil { + return nil, err + } + f, _ = newBinaryReaderBytes(b) + } + return NewBinaryReader2(f), nil +} + +func NewBinaryReader2Bytes(data []byte) (*BinaryReader2, error) { + f, _ := newBinaryReaderBytes(data) + return NewBinaryReader2(f), nil +} + +func NewBinaryReader2File(filename string) (*BinaryReader2, error) { + f, err := newBinaryReaderFile(filename) + if err != nil { + return nil, err + } + return NewBinaryReader2(f), nil +} + +func (r *BinaryReader2) Err() error { + return r.err +} + +func (r *BinaryReader2) Close() error { + if err := r.f.Close(); err != nil { + return err + } + return r.err +} + +// InPageCache returns true if the range is already in the page cache (for mmap). +func (r *BinaryReader2) InPageCache(start, end int64) bool { + index := int64(r.Pos()) / PageSize + return start/PageSize == index && end/PageSize == index +} + +// Free frees all previously read bytes, you cannot seek from before this position (for reader). +func (r *BinaryReader2) Free() { +} + +// Pos returns the reader's position. +func (r *BinaryReader2) Pos() int64 { + return r.pos +} + +// Len returns the remaining length of the buffer. +func (r *BinaryReader2) Len() int { + return int(int64(r.f.Len()) - int64(r.pos)) +} + +func (r *BinaryReader2) Seek(pos int64) { + r.pos = pos +} + +// Read complies with io.Reader. +func (r *BinaryReader2) Read(b []byte) (int, error) { + data, err := r.f.Bytes(len(b), r.pos) + if err != nil && err != io.EOF { + return 0, err + } + n := copy(b, data) + r.pos += int64(len(b)) + return n, err +} + +// ReadBytes reads n bytes. +func (r *BinaryReader2) ReadBytes(n int) []byte { + data, err := r.f.Bytes(n, r.pos) + if err != nil { + r.err = err + return nil + } + r.pos += int64(n) + return data +} + +// ReadString reads a string of length n. +func (r *BinaryReader2) ReadString(n int) string { + return string(r.ReadBytes(n)) +} + +// ReadByte reads a single byte. +func (r *BinaryReader2) ReadByte() byte { + data := r.ReadBytes(1) + if data == nil { + return 0 + } + return data[0] +} + +// ReadUint8 reads a uint8. +func (r *BinaryReader2) ReadUint8() uint8 { + return r.ReadByte() +} + +// ReadUint16 reads a uint16. +func (r *BinaryReader2) ReadUint16() uint16 { + data := r.ReadBytes(2) + if data == nil { + return 0 + } else if r.Endian == binary.LittleEndian { + return uint16(data[1])<<8 | uint16(data[0]) + } + return uint16(data[0])<<8 | uint16(data[1]) +} + +// ReadUint32 reads a uint32. +func (r *BinaryReader2) ReadUint32() uint32 { + data := r.ReadBytes(4) + if data == nil { + return 0 + } else if r.Endian == binary.LittleEndian { + return uint32(data[3])<<24 | uint32(data[2])<<16 | uint32(data[1])<<8 | uint32(data[0]) + } + return uint32(data[0])<<24 | uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) +} + +// ReadUint64 reads a uint64. +func (r *BinaryReader2) ReadUint64() uint64 { + data := r.ReadBytes(8) + if data == nil { + return 0 + } else if r.Endian == binary.LittleEndian { + return uint64(data[7])<<56 | uint64(data[6])<<48 | uint64(data[5])<<40 | uint64(data[4])<<32 | uint64(data[3])<<24 | uint64(data[2])<<16 | uint64(data[1])<<8 | uint64(data[0]) + } + return uint64(data[0])<<56 | uint64(data[1])<<48 | uint64(data[2])<<40 | uint64(data[3])<<32 | uint64(data[4])<<24 | uint64(data[5])<<16 | uint64(data[6])<<8 | uint64(data[7]) +} + +// ReadInt8 reads a int8. +func (r *BinaryReader2) ReadInt8() int8 { + return int8(r.ReadByte()) +} + +// ReadInt16 reads a int16. +func (r *BinaryReader2) ReadInt16() int16 { + return int16(r.ReadUint16()) +} + +// ReadInt32 reads a int32. +func (r *BinaryReader2) ReadInt32() int32 { + return int32(r.ReadUint32()) +} + +// ReadInt64 reads a int64. +func (r *BinaryReader2) ReadInt64() int64 { + return int64(r.ReadUint64()) +} + // BinaryWriter is a big endian binary file format writer. type BinaryWriter struct { buf []byte diff --git a/source/vendor/github.com/tdewolff/parse/v2/binary_unix.go b/source/vendor/github.com/tdewolff/parse/v2/binary_unix.go new file mode 100644 index 0000000..4a72186 --- /dev/null +++ b/source/vendor/github.com/tdewolff/parse/v2/binary_unix.go @@ -0,0 +1,91 @@ +//go:build unix + +package parse + +import ( + "errors" + "fmt" + "io" + "os" + "runtime" + "syscall" +) + +type binaryReaderMmap struct { + data []byte +} + +func newBinaryReaderMmap(filename string) (*binaryReaderMmap, error) { + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer f.Close() + + fi, err := f.Stat() + if err != nil { + return nil, err + } + + size := fi.Size() + if size == 0 { + // Treat (size == 0) as a special case, avoiding the syscall, since + // "man 2 mmap" says "the length... must be greater than 0". + // + // As we do not call syscall.Mmap, there is no need to call + // runtime.SetFinalizer to enforce a balancing syscall.Munmap. + return &binaryReaderMmap{ + data: make([]byte, 0), + }, nil + } else if size < 0 { + return nil, fmt.Errorf("mmap: file %q has negative size", filename) + } else if size != int64(int(size)) { + return nil, fmt.Errorf("mmap: file %q is too large", filename) + } + + data, err := syscall.Mmap(int(f.Fd()), 0, int(size), syscall.PROT_READ, syscall.MAP_SHARED) + if err != nil { + return nil, err + } + r := &binaryReaderMmap{data} + runtime.SetFinalizer(r, (*binaryReaderMmap).Close) + return r, nil +} + +// Close closes the reader. +func (r *binaryReaderMmap) Close() error { + if r.data == nil { + return nil + } else if len(r.data) == 0 { + r.data = nil + return nil + } + data := r.data + r.data = nil + runtime.SetFinalizer(r, nil) + return syscall.Munmap(data) +} + +// Len returns the length of the underlying memory-mapped file. +func (r *binaryReaderMmap) Len() int { + return len(r.data) +} + +func (r *binaryReaderMmap) Bytes(n int, off int64) ([]byte, error) { + if r.data == nil { + return nil, errors.New("mmap: closed") + } else if off < 0 || int64(len(r.data)) < off { + return nil, fmt.Errorf("mmap: invalid offset %d", off) + } else if int64(len(r.data)-n) < off { + return r.data[off:len(r.data):len(r.data)], io.EOF + } + return r.data[off : off+int64(n) : off+int64(n)], nil +} + +func NewBinaryReader2Mmap(filename string) (*BinaryReader2, error) { + f, err := newBinaryReaderMmap(filename) + if err != nil { + return nil, err + } + return NewBinaryReader2(f), nil +} diff --git a/source/vendor/github.com/tdewolff/parse/v2/buffer/lexer.go b/source/vendor/github.com/tdewolff/parse/v2/buffer/lexer.go index 46e6bda..3c9da22 100644 --- a/source/vendor/github.com/tdewolff/parse/v2/buffer/lexer.go +++ b/source/vendor/github.com/tdewolff/parse/v2/buffer/lexer.go @@ -2,7 +2,6 @@ package buffer import ( "io" - "io/ioutil" ) var nullBuffer = []byte{0} @@ -18,7 +17,7 @@ type Lexer struct { restore func() } -// NewLexer returns a new Lexer for a given io.Reader, and uses ioutil.ReadAll to read it into a byte slice. +// NewLexer returns a new Lexer for a given io.Reader, and uses io.ReadAll to read it into a byte slice. // If the io.Reader implements Bytes, that is used instead. // It will append a NULL at the end of the buffer. func NewLexer(r io.Reader) *Lexer { @@ -30,7 +29,7 @@ func NewLexer(r io.Reader) *Lexer { b = buffer.Bytes() } else { var err error - b, err = ioutil.ReadAll(r) + b, err = io.ReadAll(r) if err != nil { return &Lexer{ buf: nullBuffer, diff --git a/source/vendor/github.com/tdewolff/parse/v2/common.go b/source/vendor/github.com/tdewolff/parse/v2/common.go index e079530..1883d1b 100644 --- a/source/vendor/github.com/tdewolff/parse/v2/common.go +++ b/source/vendor/github.com/tdewolff/parse/v2/common.go @@ -317,9 +317,13 @@ func replaceEntities(b []byte, i int, entitiesMap map[string][]byte, revEntities } } else { for ; j < len(b) && j-i-1 <= MaxEntityLength && b[j] != ';'; j++ { + if !(b[j] >= '0' && b[j] <= '9' || b[j] >= 'a' && b[j] <= 'z' || b[j] >= 'A' && b[j] <= 'Z') { + // invalid character reference character + break + } } - if j <= i+1 || len(b) <= j { - return b, j - 1 + if len(b) <= j || j == i+1 || b[j] != ';' { + return b, i } var ok bool @@ -399,7 +403,7 @@ func ReplaceMultipleWhitespaceAndEntities(b []byte, entitiesMap map[string][]byt if j == 0 { return b } else if j == 1 { // only if starts with whitespace - b[k-1] = b[0] + b[k-1] = b[0] // move newline to end of whitespace return b[k-1:] } else if k < len(b) { j += copy(b[j:], b[k:]) diff --git a/source/vendor/github.com/tdewolff/parse/v2/input.go b/source/vendor/github.com/tdewolff/parse/v2/input.go index 924f14f..586ad73 100644 --- a/source/vendor/github.com/tdewolff/parse/v2/input.go +++ b/source/vendor/github.com/tdewolff/parse/v2/input.go @@ -2,7 +2,6 @@ package parse import ( "io" - "io/ioutil" ) var nullBuffer = []byte{0} @@ -18,7 +17,7 @@ type Input struct { restore func() } -// NewInput returns a new Input for a given io.Input and uses ioutil.ReadAll to read it into a byte slice. +// NewInput returns a new Input for a given io.Input and uses io.ReadAll to read it into a byte slice. // If the io.Input implements Bytes, that is used instead. It will append a NULL at the end of the buffer. func NewInput(r io.Reader) *Input { var b []byte @@ -29,7 +28,7 @@ func NewInput(r io.Reader) *Input { b = buffer.Bytes() } else { var err error - b, err = ioutil.ReadAll(r) + b, err = io.ReadAll(r) if err != nil { return &Input{ buf: nullBuffer, diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.envrc b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.envrc index 6de8a8a..0da5bcc 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.envrc +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.envrc @@ -1,3 +1,2 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=" - -use devenv \ No newline at end of file +watch_file ./flake.nix ./nix/scripts/*.nix ./nix/config/*.nix ./nix/packages/*.nix +use flake \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitignore b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitignore index ddb7cef..13bb7b5 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitignore +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitignore @@ -18,17 +18,12 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out -testdata/ - # Dependency directories (remove the comment below to include it) # vendor/ # Go workspace file go.work -# Go Fuzz build -testdata/ - ### Go Patch ### /vendor/ /Godeps/ @@ -61,7 +56,7 @@ testdata/ # Gradle .idea/**/gradle.xml -g.idea/**/libraries +.idea/**/libraries # Gradle and Maven with auto-import # When using Gradle or Maven with auto-import, you should exclude module files, @@ -147,6 +142,14 @@ fabric.properties .idea/**/azureSettings.xml # End of https://www.toptal.com/developers/gitignore/api/intellij,go -/.attach_pid* +# Devenv .devenv* devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml + +/Session.vim diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitlab-ci.yml b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitlab-ci.yml index 1bc73eb..78b9b3f 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitlab-ci.yml +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/.gitlab-ci.yml @@ -1,59 +1,43 @@ - -# THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL -# DO NOT EDIT THIS FILE MANUALLY -# INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix -# AND OPEN A SHELL WITH THE COMMAND devenv shell -# - -image: docker-registry.schukai.com:443/nixos-ci-devenv:latest - variables: - # The repo name as used in - # https://github.com/nix-community/NUR/blob/master/repos.json - NIXOS_VERSION: "23.05" NIXPKGS_ALLOW_UNFREE: "1" NIXPKGS_ALLOW_INSECURE: "1" GIT_DEPTH: 10 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + stages: - test - - deploy + - release before_script: - - echo > .env-gitlab-ci - - variables=("HOME=$HOME" "CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME" "CI_REPOSITORY_URL=$CI_REPOSITORY_URL" "GITLAB_TOKEN=$GITLAB_TOKEN" "CI_JOB_TOKEN=$CI_JOB_TOKEN" "GITLAB_USER_EMAIL=$GITLAB_USER_EMAIL" "GITLAB_USER_NAME=\"$GITLAB_USER_NAME\"" "CI_REGISTRY_USER=$CI_REGISTRY_USER" "CI_PROJECT_ID=$CI_PROJECT_ID" "CI_PROJECT_DIR=$CI_PROJECT_DIR" "CI_API_V4_URL=$CI_API_V4_URL" "CI_PROJECT_NAME=$CI_PROJECT_NAME" "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA"); for var in "${variables[@]}"; do echo "$var" >> .env-gitlab-ci; done - - cat .env-gitlab-ci + - git config --global user.email "${GITLAB_USER_EMAIL}" + - git config --global user.name "${GITLAB_USER_NAME:-"Gitlab CI"}" + - git config --global credential.helper '!f() { echo "username=gitlab-ci-token"; echo "password=${CI_JOB_TOKEN}"; }; f' + - git config --global pull.rebase true + - git config --global http.sslVerify "false" + after_script: - - if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi + - nix develop .#gitlab --command clean-up -test: +tests: stage: test tags: - - nixos + - nixos-gen3 script: - - devenv shell test-lib - - cache: - - key: nixos - paths: - - /nix/store - + - nix develop .#gitlab --command run-ci-tests artifacts: paths: - - dist + - last-phpunit-result.xml -deploy: - stage: deploy +release: + stage: release tags: - - nixos + - nixos-gen3 script: - - devenv shell -c deploy-lib - + - nix develop .#gitlab --command release when: on_success - - cache: - - key: nixos - paths: - - /nix/store - + rules: + - if: $CI_COMMIT_BRANCH == "master" + \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.lock index a9b3b22..438f632 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.lock +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1698243190, - "narHash": "sha256-n+SbyNQRhUcaZoU00d+7wi17HJpw/kAUrXOL4zRcqE8=", + "lastModified": 1706018268, + "narHash": "sha256-d24+re0t8b6HYGzAPZCIJed85n23RUFXQa2yuHoW0uQ=", "owner": "cachix", "repo": "devenv", - "rev": "86f476f7edb86159fd20764489ab4e4df6edb4b6", + "rev": "ad0ae333b210e31237e1fc4a7ddab71a01785add", "type": "github" }, "original": { @@ -20,11 +20,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -38,11 +38,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -59,11 +59,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", "type": "github" }, "original": { @@ -74,48 +74,48 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698288402, - "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", + "lastModified": 1705916986, + "narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", + "rev": "d7f206b723e42edb09d9d753020a84b3061a79d8", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1698288402, - "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", + "lastModified": 1705916986, + "narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", + "rev": "d7f206b723e42edb09d9d753020a84b3061a79d8", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "type": "indirect" } }, @@ -130,11 +130,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698227354, - "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", + "lastModified": 1705757126, + "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", + "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", "type": "github" }, "original": { @@ -171,11 +171,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1690668568, - "narHash": "sha256-jzixQKFFW4oxO0S4GYqbkFCXzhBd6com6Z9+MtVKakU=", + "lastModified": 1704542622, + "narHash": "sha256-HnFuaOXHoxv8tpBvMsEjfhcl/hFNxEY7GbBqoyJ1U8U=", "ref": "refs/heads/master", - "rev": "3838f03165b726e47d586c04a1821749375e1001", - "revCount": 37, + "rev": "6b4f85fe6d934429cf3055bbcd8cf15014730118", + "revCount": 114, "type": "git", "url": "https://gitlab.schukai.com/oss/utilities/version.git" }, diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.nix index 5fdd16f..a32c8d7 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.nix +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.nix @@ -13,7 +13,7 @@ delve dialog drill - exa + eza fd fd feh @@ -76,7 +76,7 @@ PATH="''${PATH}":${pkgs.gnutar}/bin PATH="''${PATH}":${pkgs.gzip}/bin/ PATH="''${PATH}":${pkgs.procps}/bin/ - PATH="''${PATH}":${pkgs.exa}/bin/ + PATH="''${PATH}":${pkgs.eza}/bin/ PATH="''${PATH}":${pkgs.git}/bin/ PATH="''${PATH}":${pkgs.gnugrep}/bin/ PATH="''${PATH}":${ @@ -101,7 +101,7 @@ PATH="''${PATH}":${pkgs.moreutils}/bin/ PATH="''${PATH}":${pkgs.gnutar}/bin PATH="''${PATH}":${pkgs.gzip}/bin/ - PATH="''${PATH}":${pkgs.exa}/bin/ + PATH="''${PATH}":${pkgs.eza}/bin/ PATH="''${PATH}":${pkgs.git}/bin/ PATH="''${PATH}":${ inputs.version.defaultPackage."${builtins.currentSystem}" diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.yaml b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.yaml index 525a6f0..1fd1de9 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.yaml +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/devenv.yaml @@ -1,6 +1,6 @@ inputs: nixpkgs: - url: github:nixos/nixpkgs/nixos-23.05 + url: github:nixos/nixpkgs/nixos-23.11 version: url: git+https://gitlab.schukai.com/oss/utilities/version.git diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.lock new file mode 100644 index 0000000..fd83cb2 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.lock @@ -0,0 +1,181 @@ +{ + "nodes": { + "commonFlake": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "dir": "common", + "lastModified": 1718788884, + "narHash": "sha256-PefMbkGNMK9TN1qcNL9OkFVTNdv6wo6XoaS8eTdsY04=", + "ref": "refs/heads/master", + "rev": "abda2dc723e13dfc835535593321c514666e679e", + "revCount": 39, + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + }, + "original": { + "dir": "common", + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flakeUtils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727397532, + "narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f65141456289e81ea0d5a05af8898333cab5c53d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1704145853, + "narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2ea8eab9e400618748ab1a6a108255233b602c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "commonFlake": "commonFlake", + "flake-utils": "flake-utils", + "flakeUtils": "flakeUtils", + "nixpkgs": "nixpkgs_2", + "nixpkgsUnstable": "nixpkgsUnstable", + "versionFlake": "versionFlake" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "versionFlake": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1716914109, + "narHash": "sha256-JY0PLGWzYRDQ9daKLGOBWHHuYun9nSpH9J3aSk8iDmQ=", + "ref": "refs/heads/master", + "rev": "fe8dd932d6c414a93b4a69c470792b2db038e0fb", + "revCount": 129, + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + }, + "original": { + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.nix new file mode 100644 index 0000000..eb9d6b8 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/flake.nix @@ -0,0 +1,158 @@ +{ + description = "xflags is a library"; + + inputs = { + nixpkgs = {url = "github:nixos/nixpkgs/nixos-24.05";}; + nixpkgsUnstable = {url = "github:nixos/nixpkgs/nixos-unstable";}; + flakeUtils = {url = "github:numtide/flake-utils";}; + + commonFlake = { + url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common"; + flake = true; + }; + + versionFlake = { + url = "git+https://gitlab.schukai.com/oss/utilities/version.git"; + flake = true; + }; + }; + + outputs = { + self, + nixpkgs, + nixpkgsUnstable, + flake-utils, + versionFlake, + commonFlake, + ... + } @ inputs: + flake-utils.lib.eachDefaultSystem (system: let + inherit (nixpkgs.lib) optional; + + commonPck = commonFlake.packages.${system}.common; + versionPck = versionFlake.packages.${system}.version; + + pkgs' = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + common = commonPck; + }) + + (final: prev: { + version = versionPck; + }) + + (final: prev: { + dolt = + (import nixpkgsUnstable { + inherit system; + }) + .dolt; + }) + ]; + }; + in { + packages = rec { + manual = pkgs'.callPackage ./nix/packages/manual.nix {inherit self pkgs';}; + }; + + devShells = { + default = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + versionBin = versionPck + "/bin/version"; + + scriptGoTask = import ./nix/scripts/go-task.nix {inherit self pkgs' system;}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptGoTask + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -n "$CI_JOB_TOKEN" ]; then + echo_fail "You are in a CI environment, this shell is not intended for CI, but for local development" + exit 1 + fi + + echo_header "xflags Lib development shell" + readonly worktree=$(get_working_dir) + echo_hint "Working directory: ''${worktree}" + currentVersion=$(${versionBin} print -g) + if [ -z "''${currentVersion}" ]; then + echo_fail "No version found, check your git tags" + else + echo_hint "Current version: ''${currentVersion}" + fi + + currentGitBranch=$(git rev-parse --abbrev-ref HEAD) + echo_hint "Current branch: ''${currentGitBranch}" + echo_hint "You can run the task command to see the available tasks" + + echo_section "Happy hacking!" + ''; + }; + + gitlab = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + + scriptCleanUp = pkgs'.callPackage ./nix/scripts/clean-up.nix {inherit pkgs';}; + scriptRunCITests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {inherit pkgs';}; + scriptRelease = pkgs'.callPackage ./nix/scripts/release.nix {inherit pkgs';}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptCleanUp + scriptRunCITests + scriptRelease + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -z "$CI_JOB_TOKEN" ]; then + echo_fail "You are not in a CI environment, this shell is intended for CI, but for local development" + exit 1 + fi + + cd ''${CI_PROJECT_DIR} || exit 1 + + ''; + }; + }; + }); +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/xflags.iml b/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/xflags.iml deleted file mode 100644 index 49df094..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/application/xflags/xflags.iml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="WEB_MODULE" version="4"> - <component name="Go" enabled="true" /> - <component name="NewModuleRootManager" inherit-compiler-output="true"> - <exclude-output /> - <content url="file://$MODULE_DIR$" /> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.envrc b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.envrc new file mode 100644 index 0000000..0da5bcc --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.envrc @@ -0,0 +1,2 @@ +watch_file ./flake.nix ./nix/scripts/*.nix ./nix/config/*.nix ./nix/packages/*.nix +use flake \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitignore b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitignore index dd6e53a..e16eb68 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitignore +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitignore @@ -1,32 +1,5 @@ - -# Makefile comes from update -Makefile.example - -# Vendor -/development/vendor/ -/deployment/vendor/ - -# Created by https://www.toptal.com/developers/gitignore/api/intellij+iml,phpunit,git,vim,visualstudiocode,phpstorm,go,intellij+all,netbeans,dbeaver,node,yarn -# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+iml,phpunit,git,vim,visualstudiocode,phpstorm,go,intellij+all,netbeans,dbeaver,node,yarn - -### DBeaver ### -# ide config file -.dbeaver-data-sources*.xml - -### Git ### -# Created by git for backups. To disable backups in Git: -# git config --global mergetool.keepBackup false -*.orig - -# Created by git when using merge tools for conflicts -*.BACKUP.* -*.BASE.* -*.LOCAL.* -*.REMOTE.* -*_BACKUP_*.txt -*_BASE_*.txt -*_LOCAL_*.txt -*_REMOTE_*.txt +# Created by https://www.toptal.com/developers/gitignore/api/intellij,go +# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,go ### Go ### # If you prefer the allow list template instead of the deny list, see community template: @@ -55,7 +28,7 @@ go.work /vendor/ /Godeps/ -### Intellij+all ### +### Intellij ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 @@ -134,272 +107,7 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser -### Intellij+all Patch ### -# Ignore everything but code style settings and run configurations -# that are supposed to be shared within teams. - -.idea/* - -!.idea/codeStyles -!.idea/runConfigurations - -### Intellij+iml ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff - -# AWS User-specific - -# Generated files - -# Sensitive or high-churn files - -# Gradle - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake - -# Mongo Explorer plugin - -# File-based project format - -# IntelliJ - -# mpeltonen/sbt-idea plugin - -# JIRA plugin - -# Cursive Clojure plugin - -# SonarLint plugin - -# Crashlytics plugin (for Android Studio and IntelliJ) - -# Editor-based Rest Client - -# Android studio 3.1+ serialized cache file - -### Intellij+iml Patch ### -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -### NetBeans ### -**/nbproject/private/ -**/nbproject/Makefile-*.mk -**/nbproject/Package-*.bash -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -### Node Patch ### -# Serverless Webpack directories -.webpack/ - -# Optional stylelint cache - -# SvelteKit build / generate output -.svelte-kit - -### PhpStorm ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff - -# AWS User-specific - -# Generated files - -# Sensitive or high-churn files - -# Gradle - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake - -# Mongo Explorer plugin - -# File-based project format - -# IntelliJ - -# mpeltonen/sbt-idea plugin - -# JIRA plugin - -# Cursive Clojure plugin - -# SonarLint plugin - -# Crashlytics plugin (for Android Studio and IntelliJ) - -# Editor-based Rest Client - -# Android studio 3.1+ serialized cache file - -### PhpStorm Patch ### +### Intellij Patch ### # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 # *.iml @@ -423,7 +131,8 @@ dist # Cache file creation bug # See https://youtrack.jetbrains.com/issue/JBR-2257 -.idea/ACHE_FILE +.idea/$CACHE_FILE$ + # CodeStream plugin # https://plugins.jetbrains.com/plugin/12206-codestream .idea/codestream.xml @@ -432,82 +141,16 @@ dist # https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij .idea/**/azureSettings.xml -### PHPUnit ### -# Covers PHPUnit -# Reference: https://phpunit.de/ +# End of https://www.toptal.com/developers/gitignore/api/intellij,go +# Devenv +.devenv* +devenv.local.nix -# Generated files -.phpunit.result.cache -.phpunit.cache - -# PHPUnit -/app/phpunit.xml -/phpunit.xml - -# Build data -/build/ - -### Vim ### -# Swap -[._]*.s[a-v][a-z] -!*.svg # comment out if you don't need vector files -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim -Sessionx.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# Support for Project snippet scope -.vscode/*.code-snippets - -# Ignore code-workspaces -*.code-workspace - -### yarn ### -# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored - -.yarn/* -!.yarn/releases -!.yarn/patches -!.yarn/plugins -!.yarn/sdks -!.yarn/versions - -# if you are NOT using Zero-installs, then: -# comment the following lines -!.yarn/cache - -# and uncomment the following lines -# .pnp.* +# direnv +.direnv +# pre-commit +.pre-commit-config.yaml +/Session.vim +.direnv/ diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitlab-ci.yml b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitlab-ci.yml new file mode 100644 index 0000000..78b9b3f --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/.gitlab-ci.yml @@ -0,0 +1,43 @@ +variables: + NIXPKGS_ALLOW_UNFREE: "1" + NIXPKGS_ALLOW_INSECURE: "1" + GIT_DEPTH: 10 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + + +stages: + - test + - release + +before_script: + - git config --global user.email "${GITLAB_USER_EMAIL}" + - git config --global user.name "${GITLAB_USER_NAME:-"Gitlab CI"}" + - git config --global credential.helper '!f() { echo "username=gitlab-ci-token"; echo "password=${CI_JOB_TOKEN}"; }; f' + - git config --global pull.rebase true + - git config --global http.sslVerify "false" + + +after_script: + - nix develop .#gitlab --command clean-up + +tests: + stage: test + tags: + - nixos-gen3 + script: + - nix develop .#gitlab --command run-ci-tests + artifacts: + paths: + - last-phpunit-result.xml + +release: + stage: release + tags: + - nixos-gen3 + script: + - nix develop .#gitlab --command release + when: on_success + rules: + - if: $CI_COMMIT_BRANCH == "master" + \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CHANGELOG.md b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CHANGELOG.md deleted file mode 100644 index d409954..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ - -<a name="v0.2.0"></a> -## v0.2.0 - 2022-12-18 -### Add Features -- implementation of basic features -- first implementation - - diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CONTRIBUTING.md b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CONTRIBUTING.md new file mode 100644 index 0000000..2713a85 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/CONTRIBUTING.md @@ -0,0 +1,58 @@ +# Contributing to schukai GmbH Projects + +## Code of Conduct + +Be a human, not an asshole. Common sense and basic human decency apply. + +## Getting Started + +### Setting up the Project + +1. Fork the project on GitLab. +2. Clone your fork locally. Replace `[your-username]` with your GitLab username and `[project-name]` with the actual project name: + ```bash + git clone $(git config --get remote.origin.url) + ``` +3. Add the upstream repository. Replace `[original-username]` and `[project-name]` with the original repository's username and project name: + ```bash + git remote add upstream https://gitlab.schukai.com/[original-username]/[project-name].git + ``` + +### Making Changes + +1. Create a new branch: + ```bash + git checkout -b new-feature-branch + ``` +2. Make your changes. +3. Commit your changes: + ```bash + git commit -m "Description of change" + ``` + +### Submitting a Merge Request + +1. Push your changes to your fork: + ```bash + git push origin new-feature-branch + ``` +2. Navigate to the original project repository on `gitlab.schukai.com`. +3. Open a Merge Request and provide a clear description of the changes. + +## Coding Guidelines + +- Follow the coding style used in the project. +- Write unit tests for new features. +- Ensure that all tests pass before submitting a Merge Request. + +## Reporting Issues + +If you find an issue, please create a new issue on `gitlab.schukai.com`. + +## Additional Resources + +- [GitLab Flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) +- [GitLab Merge Request Guidelines](https://docs.gitlab.com/ee/user/project/merge_requests/) + +Thank you for your contribution! + diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/LICENSE b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/LICENSE index 89c200e..5694d30 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/LICENSE +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/LICENSE @@ -1,7 +1,14 @@ -LICENSE +Copyright (C) 2023 schukai GmbH -* All content residing under the "documentation/" directory of this repository is licensed under "Creative Commons: CC BY-SA 4.0 license". -* All content that resides under the "application/" directory of this repository, if that directory exists, is licensed under the license defined in "application/LICENSE". -* All third-party components that are integrated into our software are licensed under the original licence provided by the owner of the respective component. -* Content outside the above directories or restrictions is available under the "AGPL 3.0" licence as defined here: https://www.gnu.org/licenses/agpl-3.0.en.html +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/Makefile b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/Makefile deleted file mode 100644 index c199733..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -############################################################################################# -############################################################################################# -## -## PROJECT-DEFINITIONS -## -############################################################################################# -############################################################################################# - -COMPONENT_NAME := data - -############################################################################################# -############################################################################################# -## -## MORE GENERAL BLOCK WITH STANDARD DEFINITIONS -## -############################################################################################# -############################################################################################# - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -PROJECT_ROOT:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)/ -THIS_MAKEFILE:=$(PROJECT_ROOT)$(THIS_MAKEFILE_PATH) - -# include project.mk only if it exists --include $(PROJECT_ROOT)project.mk - - -# Define the location of Makefiles -MAKEFILE_IMPORT_PATH?=$(PROJECT_ROOT)makefiles/ - -# include project.mk only if it exists --include $(MAKEFILE_IMPORT_PATH)project.mk - -############################################################################################# -############################################################################################# -## -## INCLUSION OF VARIOUS STANDARD RULES -## -############################################################################################# -############################################################################################# - -#include $(MAKEFILE_IMPORT_PATH)directories-standard.mk -include $(MAKEFILE_IMPORT_PATH)directories-go-lib.mk -#include $(MAKEFILE_IMPORT_PATH)directories-go-utilities.mk -#include $(MAKEFILE_IMPORT_PATH)directories-platform-part.mk -#include $(MAKEFILE_IMPORT_PATH)jsdoc.mk -include $(MAKEFILE_IMPORT_PATH)output.mk -include $(MAKEFILE_IMPORT_PATH)placeholder.mk -#include $(MAKEFILE_IMPORT_PATH)conan.mk -#include $(MAKEFILE_IMPORT_PATH)s3.mk -#include $(MAKEFILE_IMPORT_PATH)readme-standard.mk -#include $(MAKEFILE_IMPORT_PATH)readme-webcomponents.mk -#include $(MAKEFILE_IMPORT_PATH)readme-go-utilities.mk -include $(MAKEFILE_IMPORT_PATH)readme-go-lib.mk -#include $(MAKEFILE_IMPORT_PATH)readme-platform-part.mk -include $(MAKEFILE_IMPORT_PATH)licenses.mk -include $(MAKEFILE_IMPORT_PATH)license-agpl3.mk -#include $(MAKEFILE_IMPORT_PATH)license-unlicensed.mk -#include $(MAKEFILE_IMPORT_PATH)license-all-rights-reserved.mk -#include $(MAKEFILE_IMPORT_PATH)jsdoc-json.mk -include $(MAKEFILE_IMPORT_PATH)go.mk -include $(MAKEFILE_IMPORT_PATH)changelog.mk -#include $(MAKEFILE_IMPORT_PATH)docman.mk -#include $(MAKEFILE_IMPORT_PATH)reqman.mk -include $(MAKEFILE_IMPORT_PATH)git.mk -include $(MAKEFILE_IMPORT_PATH)gitignore.mk -include $(MAKEFILE_IMPORT_PATH)color.mk -include $(MAKEFILE_IMPORT_PATH)version.mk -#include $(MAKEFILE_IMPORT_PATH)docker.mk -#include $(MAKEFILE_IMPORT_PATH)node.mk -include $(MAKEFILE_IMPORT_PATH)terminal.mk -include $(MAKEFILE_IMPORT_PATH)target-go-fetch-licenses.mk -include $(MAKEFILE_IMPORT_PATH)target-add-licenses.mk -include $(MAKEFILE_IMPORT_PATH)target-deploy-tool.mk -#include $(MAKEFILE_IMPORT_PATH)target-jsdoc-build.mk -#include $(MAKEFILE_IMPORT_PATH)target-docman.mk -#include $(MAKEFILE_IMPORT_PATH)target-caddy.mk -#include $(MAKEFILE_IMPORT_PATH)target-conan.mk -#include $(MAKEFILE_IMPORT_PATH)target-phpunit.mk -#include $(MAKEFILE_IMPORT_PATH)target-jekyll.mk -include $(MAKEFILE_IMPORT_PATH)target-update-makefiles.mk -include $(MAKEFILE_IMPORT_PATH)target-help.mk -include $(MAKEFILE_IMPORT_PATH)target-go-build.mk -#include $(MAKEFILE_IMPORT_PATH)target-node-build.mk -#include $(MAKEFILE_IMPORT_PATH)target-node-test.mk -#include $(MAKEFILE_IMPORT_PATH)target-npm-publish.mk -#include $(MAKEFILE_IMPORT_PATH)target-npm.mk -include $(MAKEFILE_IMPORT_PATH)target-git.mk -#include $(MAKEFILE_IMPORT_PATH)target-init-standard.mk -#include $(MAKEFILE_IMPORT_PATH)target-init-webcomponent.mk -#include $(MAKEFILE_IMPORT_PATH)target-init-go-utilities.mk -#nclude $(MAKEFILE_IMPORT_PATH)target-init-go-lib.mk -#include $(MAKEFILE_IMPORT_PATH)target-init-platform-part.mk -include $(MAKEFILE_IMPORT_PATH)target-version.mk -include $(MAKEFILE_IMPORT_PATH)target-variable.mk -include $(MAKEFILE_IMPORT_PATH)terminal-check.mk - - -############################################################################################# - -# include target-project.mk only if it exists --include $(MAKEFILE_IMPORT_PATH)target-project.mk diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.lock new file mode 100644 index 0000000..fd83cb2 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.lock @@ -0,0 +1,181 @@ +{ + "nodes": { + "commonFlake": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "dir": "common", + "lastModified": 1718788884, + "narHash": "sha256-PefMbkGNMK9TN1qcNL9OkFVTNdv6wo6XoaS8eTdsY04=", + "ref": "refs/heads/master", + "rev": "abda2dc723e13dfc835535593321c514666e679e", + "revCount": 39, + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + }, + "original": { + "dir": "common", + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flakeUtils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727397532, + "narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f65141456289e81ea0d5a05af8898333cab5c53d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1704145853, + "narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2ea8eab9e400618748ab1a6a108255233b602c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "commonFlake": "commonFlake", + "flake-utils": "flake-utils", + "flakeUtils": "flakeUtils", + "nixpkgs": "nixpkgs_2", + "nixpkgsUnstable": "nixpkgsUnstable", + "versionFlake": "versionFlake" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "versionFlake": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1716914109, + "narHash": "sha256-JY0PLGWzYRDQ9daKLGOBWHHuYun9nSpH9J3aSk8iDmQ=", + "ref": "refs/heads/master", + "rev": "fe8dd932d6c414a93b4a69c470792b2db038e0fb", + "revCount": 129, + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + }, + "original": { + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.nix new file mode 100644 index 0000000..c33cffd --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/flake.nix @@ -0,0 +1,158 @@ +{ + description = "Data is a library"; + + inputs = { + nixpkgs = {url = "github:nixos/nixpkgs/nixos-24.05";}; + nixpkgsUnstable = {url = "github:nixos/nixpkgs/nixos-unstable";}; + flakeUtils = {url = "github:numtide/flake-utils";}; + + commonFlake = { + url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common"; + flake = true; + }; + + versionFlake = { + url = "git+https://gitlab.schukai.com/oss/utilities/version.git"; + flake = true; + }; + }; + + outputs = { + self, + nixpkgs, + nixpkgsUnstable, + flake-utils, + versionFlake, + commonFlake, + ... + } @ inputs: + flake-utils.lib.eachDefaultSystem (system: let + inherit (nixpkgs.lib) optional; + + commonPck = commonFlake.packages.${system}.common; + versionPck = versionFlake.packages.${system}.version; + + pkgs' = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + common = commonPck; + }) + + (final: prev: { + version = versionPck; + }) + + (final: prev: { + dolt = + (import nixpkgsUnstable { + inherit system; + }) + .dolt; + }) + ]; + }; + in { + packages = rec { + manual = pkgs'.callPackage ./nix/packages/manual.nix {inherit self pkgs';}; + }; + + devShells = { + default = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + versionBin = versionPck + "/bin/version"; + + scriptGoTask = import ./nix/scripts/go-task.nix {inherit self pkgs' system;}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptGoTask + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -n "$CI_JOB_TOKEN" ]; then + echo_fail "You are in a CI environment, this shell is not intended for CI, but for local development" + exit 1 + fi + + echo_header "Data Lib development shell" + readonly worktree=$(get_working_dir) + echo_hint "Working directory: ''${worktree}" + currentVersion=$(${versionBin} print -g) + if [ -z "''${currentVersion}" ]; then + echo_fail "No version found, check your git tags" + else + echo_hint "Current version: ''${currentVersion}" + fi + + currentGitBranch=$(git rev-parse --abbrev-ref HEAD) + echo_hint "Current branch: ''${currentGitBranch}" + echo_hint "You can run the task command to see the available tasks" + + echo_section "Happy hacking!" + ''; + }; + + gitlab = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + + scriptCleanUp = pkgs'.callPackage ./nix/scripts/clean-up.nix {inherit pkgs';}; + scriptRunCITests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {inherit pkgs';}; + scriptRelease = pkgs'.callPackage ./nix/scripts/release.nix {inherit pkgs';}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptCleanUp + scriptRunCITests + scriptRelease + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -z "$CI_JOB_TOKEN" ]; then + echo_fail "You are not in a CI environment, this shell is intended for CI, but for local development" + exit 1 + fi + + cd ''${CI_PROJECT_DIR} || exit 1 + + ''; + }; + }; + }); +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/mem.prof b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/mem.prof deleted file mode 100644 index 38e295555833f2d752cbaccc33aaa5ca269c9365..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5525 zcmb2|=3oE;mj7ESt1G0RPThWd;*;yAT#rw_VYl&dh0)HNO&;G=T39$NzE3!!ctr6| zXKJMmx3`q?$sG&LEem%}_2yXmblSDQ1_4f&*)$rbv|qbW)9TykTYfq<QT)=~FKi{Z z-+g=eE_mDR+H;le#*e*cPkH-K`E>ES=eEzw&#m5hNL@rDS6^hy0)HQ-_zUWP0;Ill zGSurgUy9q$=X5Z-u4GHdcW%~s-x`I)oERIOw68l(c_dq3J|$!6hWJZfiXD#2d=D}I zj?5F1(N5jzX&|Yd{j|#CN5O|1-b;7+|45LWTw}nxJR`VNpw8ysz2GI6_}QI(J|8xj zv#hm5fU)L-{0y;%XjNT?h6Sx(CTJX%xBtknQm46BCyY%rV&TfFsRBQ4MEeVR9`L%W zf9j!_rcQ#D-}NgS1fCi&r*G&iviYJho8ypmaHPM0*2YP`EFU*+k5jaroM<>%%~>=o z^Qu+H$se=Z-zltLe&D_6GG9iQD`~4PhsJw)dU_UY3bH!+oPSE^rw1vrM?_@oJ|wMt zCm#H8#+f@ID-KGn4P!SH&9^$VCG$hW{Heapkrv&Vmp|N_U(?Ui`e65^0FGB1{ARCh z=6JYX?&p6O<{Rpn3|}MGXIgO_IIMhMJ&N^D;H}jSmKN=qqCft`EnE5Fhsw6)O?_6E zLu$$=WL|z~|5VejeW%6r%*!9&-oAN{=SNk;)3gINbCyqCZJM><3%`Aqh9+m1X7KXX z1x|D0gawvHXf*I8vHg3!S$~rL<p*{48n1jz7wq}EHdR&i;3mnqXA{|ET~zBnUYy>! zQ)r)B^QxAg7V*&w+FeBDYClNGdWgoH`L;SiQSXY>mkBG5@$WmkBrD?7lB|p)Zn|s2 zxsF)Z{bruzlyR*#N$o_jn+5av3x^UF(+<t7ShmfB-B39GMr}vW^#k0ODtKKC7P*!R zm|9fWU(R}HI&)@J#vwJ`Rp)}1i*TK~*Q93O+<0nL)||-T$HGfJ(gVBa*Pr2gxqzul zPH6Lo?*5J2Lj~AfT|+%CPMVakpzNB)L#vuMh0#AaHEpEZ+jAeTKF)Rhtek30e=~dT zL-nN_+T!aDi0$*>+F$3ebM1j?uT9-0zD}6YY+w1g?$m7^j$*HLM`N?>HaQ`yx|cf@ zm98G-QM-CDDQ1oCMaMHow;!7^r~Uu8HMyTIFIZtZFX5<6?K_*}E0(n%soC>+wpno& z)3cv)X#(6I()n*cl%4ia_sHS)oR2*1;olx?*~=_*x2aX<wfIttkX7w2%y$2IXK!tf z+&eQPA<oL-l#BAd;4?o=CtbB&x67@4>L32cAA+}CTa)tjiTRrildc(mIQTo~n(yO? z^Abm^)a=TRr2T!v5@~rkQB7Rz;av8dv|^@bu6mnwZ0;|x`4<)5d%;<$>G%G$)h{KU z#~lfDn&|TJ*<rKn{VBRTq89V5R;Zp=vZK|{YgWOB!f4O%Ku%N9uP&*R7q=+o9DDx# z_L|$rHeEC8Pcr@R!g2Q3sFSY>4-`b4Y&`m7_4?auPI7+Qb|Z1y=dhA>*K(z2KS~Li zCNp(n!0M};oK8>hDV-aAT(`<Y=b&@^R^52DxjG_V`P0^H^_JPap#4bXj~o9tN9s>s z!_0cWVBy?NA@$P^cWG65$3L1F{LA~}gTvb<%?;{&zGs@1*9xw4#}2CJgn4hO`c%H{ zu-DJ%w(`20X}Ocv<V_FJD~_;qms8D)^E_E(6Zz(UNua0U+|tvss!r^Me0Be?vU99S zKkP2FCjD?^#k6f9{GG)gzu$lKcEP+meB6Qj>5p&TGLk(~Y4L}rxsC0;mm%-8$3=1m z+8_4S>I<(s+c>o+yZC{Ojk|R?d!gOFkB1C5h4HS}wmEW2ZvT@wJLST2JD;z$*x&KP zH{|KO6Sh|uwjW`&h|$@UCplkTRNUgD;=v~l3rkj9aB?o~v%Bu95_GxA-!}94uJBbK zBXSC_WW4g(T2p?|JV-+$L~&}~{YlfN{&?lQZQAN%nUOCq8i{SbyGzY<b-@OX5A)|N zC=A=#^<_dtZ@&1(N5VOq-<(*p@UBQ|!ojR(Q&O$ey7Q)HJl^xMf!WhClRIP=uj8`o z56br?wO4b_{-(0FjQ94kFx6{Ye*|tkyH015*y#;rYY%(LZsMztowFjkdyQ+xikRmc zHf7H<E51Ez%9`Vc{co>})t_2%DrxWHmeYqUGqt$I51n|+Tk*qt+brIo-or90?mSqb zc#XU8hurMa(1}|m67RP1tzM90Evec)@6{#kqi%b?=7lXj%)84!#F6`ZFW>WrmA9C- zo_Z_v-_1Q!ShLhdd8yC>i{B+Je7XUayRMi$EIu0aTcrB!%=fb+_OFq%RWW<~Vey+t z(IYdi&c1Z^jQ2MV&AlS!bBvFEU2^X6$qf0|HZ!M+u<yB>(#W?+RNnr;g<#J6Dm;!` z-z0v$-lNzUcGBzJ`~{+g-1~xKREi$ox&LU_`sN)R@zs;Ao@;&Y=`x#JyP$QO1N%nN z{)^8Zh=&?DsI7kK;AgOkMeo+D6`9waA0^f7@6f#Nd*PV4^_j=k7nrpl_g!N()!Lo= z<HO%?E4Q55z}BT9zT(a^!^W&gN9l<>S5CIlFlW6r&9+_7*ij_z)vXUt?th+|E2ry~ zsQB#Q&kDQrB<p)$dHTD5eo&pc^k)HM+ydRptB<PwI2L#A0n?9#i+&$<s)&v25p&?) zmcf0<NvCD%j-cqJ%{Lm=>%R;6HnHvSj$@HZFkP2+YpKN_#miC;J4`NdWEb#W);pXp zlc=2dqjgDZqVBrX=X%E%pEr8T^F!Rzn)%v8D><+52M>zpY|4t@>#~a0wg1#tRP&uf z@z;}WZ>PW6@nzHL^%{Qj<7`#d9dVaSY}Cq_Zu#xOxv74AnQd{chtL0MNU{|E7aM1L zzUAwVIPTX9>yAzDza`u+v@A?G?$*?|`(M3U<a*0%-9huN-O)}_Uk+S1?Q^~2oTM%% zk@$R7W%=r$)Au;~c?ACbE}P_KbxP1GWj&X;+%c2XrR@KYh0bHYv~tcp4*6S`{elY` z-_&g~NjWcRy~bhfZrSFXRQ6M`SC(7l9iM#uc47{r>)J(kZhUx|z1)H$`dIUF?x#;C zZU1&Wz(!rI(D#*eY4DnobdK!e>Bp?DM_TjT-tI7Wci#uAcehp+UoZT2+tKb&`b@)5 zjXIUT^5x{$`7GsAYKyOHot<NLeTUWL2gmMBN?N>q$wuqe?LUuSin)Gbk9qFAr%jVS z|9HLhyH~;L@?e8)X?MgHOn!6V`~KwlPofrR>DPa5Ffuy8J$e1&iYafG-1YQaaBjEk z!dF{g^D!^kR3LTmYHRX#qn+PHHovx<996zm@RyF@@!S6@CS1Ghy20&xCr8fZze-&H zRq7u^vPc&+mnBAYaO526{iDk@yI}IRNcM}Jzwd9f{_8gX&BdnRZy)`(&pobs|L!Nv zShaV*m6osWx@@{j!FL@Sp9_Ddo=s#*togO1-06qC7$zM^Z_8P0{p3yIF{Y{UhZ3I! zf17i7hM0tgkClqP^VD~#jVU(GVPb4k-*6t244=&|b3FIlyVf~Z|7N}Xc$Y_QZBcm9 z)yj9tx_!5ky)JD2yU|R1R!pw*(h{M?mke&P=g-|CvU|0xL-ea33CfOw7hc&oN3&n- z-TrsZ>%}X7JdP9IlC)avnzK@;`QFpZgU^P44s2dv9hoB-y}#LHUEQ~nlf}PxovZw4 zvi7y^rB#pOX55{Zd(knb`}^Ls!)NL*h6S(gvVGesU8&NQ-EHBV9+c1^ukquXSHz0a z^(=4JAK%9PcSU%o+@Eg~r?0#|%klbOC7$=Eci!QNF6b`PtNdP3IPq2C^L*>C-)6J_ zX@4UfzPI}0(g@pB4P_<yRLLrvLU!@WNr&$5KW@#cuWpxkAm-ji-W?qJkIpLf9)6-- z`Lo!|y*KJx|I78f0kzY%=lU;={hnca;z8{B51C;H*Cj<;wNEQNb<}Q4P$esG$gcKd zldrurdF5YzB-parYSkt0nJc>vPFtwYGxd|ev<m-^{XecqZLQg`KqODkV6ERGtBYJ) zPDNYPG{wtH7{o6+d{WoBT4Ld89c!y3JHPH?{ePP(*mniAJ$EQru<tr&zu#eArGS@? zmQ1GSGj~+mzfvre-4}D_9`7Y_c6$xs>y~UBjz>OTb&t1y__!ifal-7@qD>DvSYPdN zN_L-by*~0`E%*1@|E%`fQ=BJ?u3B=TvCCnpv>N+k!>2nZyi(Xy@x!yOcca9&lda{3 zIY-yt^08GZ`Z0U=_dsTyg+`p*8(H*@b#KkBntI~#{hH@)N^@D4y%YC-nD^7_flkI@ zv)t&2j-?x9w`Wg(q42BVL$h?|VH@dtJVkfs@md$Omvwe!efaueVbd{r$9S{p?;l@0 zxVUV=f}Rt7Ym2$pw{Cje;`y?yT$$_2=isK>vBD2lsB?x)(a*j0d-Hm(Q<<xE>d(D2 zIkj?m$(?xjoh5hXT&r3(Sx)Hs<CFO}-(FRJeLi!l!_%*Ml`j;2eVqAdo68HQTI&lz z4^kt(^g9{eT5_sf+>5(NpYzI2d)4hdA1}}Cc(Yu6VqT|kTOHH?$9(&WbehGV-qdgQ z{usnICH6-<zeJJLLrtbBH?w{oto;{%-^6LDPkEpJn@{&FuSA*tcr5z6uF}Ex?apX! zHn9^ig;Fnts+jrera!E*{1dY1MbQo({m1hk+jXwDJHDm(LHndKzL>u0#&3fyDrRJU zPUPPixV)>n%;v{6dv<THri0RUKUXSk+Nju6d_GCb*mugpAgd?xrSIxWTcnqVrgeC< z8twI}k+T00z0dg4Z^iu<;@?ipzOb`^HEv<-%H|(Da=+hB4mte%pz`FMZReX;f6&r( z34X97Xost|Cg(5lGpqi6Nna8bdd@>S^zYW|!mZbob`{r(eZOC)o*B*f{$zNd_JgcF zQL|TucQiHSzfXVk^MlQXm7gC<?P=>|=Gs@*&?$bvR!dmFVeXE}ox4SCKA8wdKiIFj zk@eQbxt-M_GJjZw!w)H+n53=PW~j!eRq@5#Cx$hC#>pe07aC=K{>*7wUvuQh)eix@ z!r{&`kA3z89u#kXzc}F9fsQo`O)qrLowf2@a5Hl-*Y>TS-3`9nY%*H#ChVI=^Qq@k zq(x_{E)4IOEmHGH-OSD=`rPmDE2d{YQfn1n9=IxgmWh!@@ZKJwQ|b}x!aHV*)_hN^ zGu|ooZbHBov0WRw?|a{0^x*xyXD>JM&9Z1Hop7MVEOfoVcC8<O3hVyvmh1CRepL11 zSf1{Z@Q(A^KTd?tkZ4)HylK(7Am)AU?`OInE#F+!U9|dBrK-ivy7QVHtM2Tse%x|J zY_HRuWe;-e6E@ss_<l<37K5ixky?KEhkN}qDir^O9D34Ppc{Akh_#5#FM;Ki%6Bv_ z?-8up;BI`Ct@PBqNM`<d0Z-C59Gd*%_LSRGt!-BB3qCks_Kx@Rt(<mio+p?)as}rk zuW$N2Kj~3gg+ubAG>_z2o#mPpUpUpa9m?~}Y2`_qvBUr1bosRR+YYo}+O3<gaOupf zxl(^N{Q1#vOy03@`KIul-Z#}_rDkn;_%b<u$Mb*R_Z8-s@^Y|pwK{2v`Rxh1bz!&9 z%9)B@3k|-!_^n*O=J+Abf42+f1}6O|-n(%}<`3(#r)TFFnojeI{5Uu4_|`O=`Nn?= zSL;tUS3CY=<&!zH&U|_5)1JENPxz%*n`>v*80ETES8omrUt&M|%xvj15${`P?wNV^ zNRXTJ7X9hH%hpuri26ocj4_itTjiQ_uqE{Y%c`(R(rsq5E(zS5wRP7d&CP~Inm2Ff zNuI4Vp6;I}ba6?pxfj3H*?Tc5yJwzWzfk{7ws+q4o}(8F`zD@g@mjP-Gf~pi%zKIA zom(1<x0*idsjQDm4D4E@Q<u)WaowJoy(M2$ADun+<<2@En@a-wG=$BimFI><pL%7U z=6<}=Gbd16*xWO=<6m*hwTL#Wxc!Wa=jFaWE%Eeagpu$<{^V1Bi!Oy<GC%6Kb;(&t z`ANS0-_q7vaGvRmetB=r%+s#BgEsDw%;XT4kGOfv!)Wpu>GYoKK~E++UGxj)3a)dT ztQ38w&Thw=z~=!%<|@_7yoo>W=rJWfoWIeD>5rq>Gi$|ylV&Y1{f$!Bz4BgWbv7q? ziT2g$ukCsdosFv0p0uII*njB-AN9|(*H-Av-(u8OsP!%)fBnptcXEyvzh09QZ725L za_ec?C%Xf!qqfRU_nEv=Y2umk@1-t}!mO(HPJLy#xx47&yM6N_jAm`GI^*++%~(2< zBVWHRzh{l%?n#ox*0v`k-(Jkq&b>8h;vC(Zv$w7@t^Sl|lIU7pEp&0qRY_Z3Yu)SS z?z5D9<qmV6j+pK7EO=wzqP(&zr=Bianc{9X&3Bfi(WUAB%O+L+T5de8|E&2L7bE%3 z^s^E7?ns?}c4p1Sry_luCI)NvecNPIl)ZY&4~aa}mhI`uGh?Pt^$m^`-JG-KZ>Y_g z-Mdbn?fxH?XJse7RzCWvma*`AzvG*1`;3gU-~3qJayKyK>;~6~;R1E4#w{mTODW&n zcSbDvV1>?xnK6|@bMx$bO(tY$U7OxnF1>k<<RsJGL1{Mgy`G)*h_?TldM!h4eU;L` z48Kp4rzV^`^-MW;Wy&3sSI4`BO=l@<8D789a4$P@<<+|zQ<fQCx;_2%y@X>{y*q_D z-k&<M_(*l^{F}$Q8sskaY*`bMoRS^?&;Oi&kn-f`bKH&x843#sc$v8E+O+HlYx2jJ zC$~M_oThVEB69AgqGg3&HMJflCwlhz2H0@>A78GUwtwTR5((*J&PmaBv(Knl$RAtA z!hGs@1G|3KP3;3OHb>__>n;ADBwjgx@;+UA+r&e=Qq(R=7+!vv64&)_zKo!x(N0xA zV;!M{^Dnx0p1gB4Kh?TdwLURIr)HO$WliK$n}D#7(`xR$oGGKN!+kX3`^M}g*3(}4 z+{`L+EA8XfcQ0^dp1;gXDf_Gcma1E80`KvpTv8W`_kW}~+j7(0TRC56-?U%8{=}>e zJ!k*F-jMV&rDp3?zvD)8k1e|F`B7|hywk~-8`IC!*&SJ9csQ<CY2%O5+LLQ;Ub~*D z+Vk@0a!cb};aUIhT=LEl*=ZGbu6A0-_G6oDv)A-wW;|xRJ*{V%@E*JHoB!Q~K8A8m z+I{8Jw;4D0?<n1QZ0DaI$;E6A`9_DuJ1<_iH2aLiZM$zDbIpq@(>J~ESo-VC9NvWK zbD3^RYWwf3sSKMv*JPpQQ^j9S!FK!C>Q6S@d~8e7Gl>tE-knuV{<b_eOHcmvv&+Y> zD3#Z*IsV2}tNVZ2**P=Me^oP{nWC2H@Uc+uUT)d9r9R>Q`8u~ZUtX*(+rKpE*dP1a z0~=$i(sl0cEb&xHzjCwc?dd$}pIfS4tA4wB(csOEJHAbFC6|^?4cgnbuV?DVHF|4% zC-QAReQK85iEYB3#W&6-%bV={=)q^6{W9W|aQ(42%emt=&(`?eS$i(;@tadmeJ_c= zH#~H)W|#S_4Pu7RBu<}?+gB5LdD7--Zq~DA&8m#=zp!ndd2yw3!PBpEEnmO-&&j~> O|9{BNVAnuH1_l5;JLTU1 diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/parser.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/parser.go index d34cd64..e3d5673 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/parser.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/parser.go @@ -1,3 +1,6 @@ +// Copyright 2024 schukai GmbH +// SPDX-License-Identifier: proprietary + package data import "github.com/volker-schukai/tokenizer" diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/project.mk b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/project.mk deleted file mode 100644 index 4bbcd7e..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/project.mk +++ /dev/null @@ -1,4 +0,0 @@ - -## Project directory in which the Makefiles should be located -MAKEFILE_IMPORT_PATH=$(PROJECT_ROOT)makefiles/ - diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/release.json b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/release.json deleted file mode 100644 index 5fb9597..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/release.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"0.2.0"} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/transformer.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/transformer.go index 1d430ca..1ee7c2f 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/transformer.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/transformer.go @@ -1,8 +1,11 @@ +// Copyright 2024 schukai GmbH +// SPDX-License-Identifier: proprietary + package data import ( - "crypto/md5" - "crypto/sha1" + "crypto/md5" // #nosec + "crypto/sha1" // #nosec "crypto/sha256" "encoding/base64" "encoding/hex" @@ -10,7 +13,7 @@ import ( "errors" "fmt" "github.com/volker-schukai/tokenizer" - "gitlab.schukai.com/oss/libraries/go/utilities/pathfinder" + "gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git" "html" "math" "net/url" @@ -706,11 +709,13 @@ func handleStrings(tokens TokenList, currentValue string) (any, error) { } else if tokens[0].Is(PipeCmdMD5) { + // #nosec d := md5.Sum([]byte(currentValue)) return hex.EncodeToString(d[:]), nil } else if tokens[0].Is(PipeCmdSHA1) { + // #nosec d := sha1.Sum([]byte(currentValue)) return hex.EncodeToString(d[:]), nil diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/util.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/util.go index cbcf950..3715efa 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/util.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/data.git/util.go @@ -1,3 +1,6 @@ +// Copyright 2024 schukai GmbH +// SPDX-License-Identifier: proprietary + package data import ( @@ -45,14 +48,14 @@ func wordWrap(str string, width uint, br string) string { current = 0 } else { current += uint(spacebuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) } spacebuf.Reset() } else { current += uint(spacebuf.Len() + wordbuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) spacebuf.Reset() - wordbuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) wordbuf.Reset() } buf.WriteRune(char) @@ -60,9 +63,9 @@ func wordWrap(str string, width uint, br string) string { } else if unicode.IsSpace(char) { if spacebuf.Len() == 0 || wordbuf.Len() > 0 { current += uint(spacebuf.Len() + wordbuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) spacebuf.Reset() - wordbuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) wordbuf.Reset() } spacebuf.WriteRune(char) @@ -78,11 +81,11 @@ func wordWrap(str string, width uint, br string) string { if wordbuf.Len() == 0 { if current+uint(spacebuf.Len()) <= width { - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) } } else { - spacebuf.WriteTo(buf) - wordbuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) } return buf.String() } diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.envrc b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.envrc new file mode 100644 index 0000000..0da5bcc --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.envrc @@ -0,0 +1,2 @@ +watch_file ./flake.nix ./nix/scripts/*.nix ./nix/config/*.nix ./nix/packages/*.nix +use flake \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitignore b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitignore new file mode 100644 index 0000000..13bb7b5 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitignore @@ -0,0 +1,155 @@ +# Created by https://www.toptal.com/developers/gitignore/api/intellij,go +# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,go + +### Go ### +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work + +### Go Patch ### +/vendor/ +/Godeps/ + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +# End of https://www.toptal.com/developers/gitignore/api/intellij,go +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml + +/Session.vim diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitlab-ci.yml b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitlab-ci.yml new file mode 100644 index 0000000..78b9b3f --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/.gitlab-ci.yml @@ -0,0 +1,43 @@ +variables: + NIXPKGS_ALLOW_UNFREE: "1" + NIXPKGS_ALLOW_INSECURE: "1" + GIT_DEPTH: 10 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + + +stages: + - test + - release + +before_script: + - git config --global user.email "${GITLAB_USER_EMAIL}" + - git config --global user.name "${GITLAB_USER_NAME:-"Gitlab CI"}" + - git config --global credential.helper '!f() { echo "username=gitlab-ci-token"; echo "password=${CI_JOB_TOKEN}"; }; f' + - git config --global pull.rebase true + - git config --global http.sslVerify "false" + + +after_script: + - nix develop .#gitlab --command clean-up + +tests: + stage: test + tags: + - nixos-gen3 + script: + - nix develop .#gitlab --command run-ci-tests + artifacts: + paths: + - last-phpunit-result.xml + +release: + stage: release + tags: + - nixos-gen3 + script: + - nix develop .#gitlab --command release + when: on_success + rules: + - if: $CI_COMMIT_BRANCH == "master" + \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/CONTRIBUTING.md b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/CONTRIBUTING.md new file mode 100644 index 0000000..2713a85 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/CONTRIBUTING.md @@ -0,0 +1,58 @@ +# Contributing to schukai GmbH Projects + +## Code of Conduct + +Be a human, not an asshole. Common sense and basic human decency apply. + +## Getting Started + +### Setting up the Project + +1. Fork the project on GitLab. +2. Clone your fork locally. Replace `[your-username]` with your GitLab username and `[project-name]` with the actual project name: + ```bash + git clone $(git config --get remote.origin.url) + ``` +3. Add the upstream repository. Replace `[original-username]` and `[project-name]` with the original repository's username and project name: + ```bash + git remote add upstream https://gitlab.schukai.com/[original-username]/[project-name].git + ``` + +### Making Changes + +1. Create a new branch: + ```bash + git checkout -b new-feature-branch + ``` +2. Make your changes. +3. Commit your changes: + ```bash + git commit -m "Description of change" + ``` + +### Submitting a Merge Request + +1. Push your changes to your fork: + ```bash + git push origin new-feature-branch + ``` +2. Navigate to the original project repository on `gitlab.schukai.com`. +3. Open a Merge Request and provide a clear description of the changes. + +## Coding Guidelines + +- Follow the coding style used in the project. +- Write unit tests for new features. +- Ensure that all tests pass before submitting a Merge Request. + +## Reporting Issues + +If you find an issue, please create a new issue on `gitlab.schukai.com`. + +## Additional Resources + +- [GitLab Flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) +- [GitLab Merge Request Guidelines](https://docs.gitlab.com/ee/user/project/merge_requests/) + +Thank you for your contribution! + diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/LICENSE b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/LICENSE new file mode 100644 index 0000000..5694d30 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/LICENSE @@ -0,0 +1,14 @@ +Copyright (C) 2023 schukai GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/README.md b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/README.md new file mode 100644 index 0000000..4d1522c --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/README.md @@ -0,0 +1,69 @@ +## Pathfinder + +## What does this library? + +This library provides a simple way to get and set values in a nested structure. + +It supports: + +* [X] Set values in a nested structure +* [X] Get values from a nested structure + +## Installation + +```shell +go get gitlab.schukai.com/oss/libraries/go/utilities/pathfinder +``` + +**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies. + +## Usage + +### Set values + +```go +s := &StructA{} +err := GetValue[*StructA](s, "my.key") +``` + +### Get values + +```go +s := &StructA{} +err := SetValue[*StructA](s, "my.key", "value") +``` + +## Contributing + +Merge requests are welcome. For major changes, please open an issue first to discuss what +you would like to change. **Please make sure to update tests as appropriate.** + +Versioning is done with [SemVer](https://semver.org/). +Changelog is generated with [git-chglog](https://github.com/git-chglog/git-chglog#git-chglog) + +Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. +Messages are started with a type, which is one of the following: + +- **feat**: A new feature +- **fix**: A bug fix +- **doc**: Documentation only changes +- **refactor**: A code change that neither fixes a bug nor adds a feature +- **perf**: A code change that improves performance +- **test**: Adding missing or correcting existing tests +- **chore**: Other changes that don't modify src or test files + +The footer would be used for a reference to an issue or a breaking change. + +A commit that has a footer `BREAKING CHANGE:`, or appends a ! after the type/scope, +introduces a breaking API change (correlating with MAJOR in semantic versioning). +A BREAKING CHANGE can be part of commits of any type. + +the following is an example of a commit message: + +```text +feat: add 'extras' field +``` + +## License + +[AGPL-3.0](https://choosealicense.com/licenses/agpl-3.0/) diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/error.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/error.go new file mode 100644 index 0000000..614b13e --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/error.go @@ -0,0 +1,39 @@ +// Copyright 2022 schukai GmbH +// SPDX-License-Identifier: AGPL-3.0 + +package pathfinder + +import ( + "errors" + "reflect" +) + +type InvalidPathError error + +func newInvalidPathError(path string) InvalidPathError { + return InvalidPathError(errors.New("invalid path " + path)) +} + +type UnsupportedTypeAtTopOfPathError error + +func newUnsupportedTypeAtTopOfPathError(path string, t reflect.Type) UnsupportedTypeAtTopOfPathError { + return UnsupportedTypeAtTopOfPathError(errors.New("unsupported type " + t.String() + " at top of path " + path)) +} + +type UnsupportedTypePathError error + +func newUnsupportedTypePathError(path string, t reflect.Type) UnsupportedTypePathError { + return UnsupportedTypePathError(errors.New("unsupported type " + t.String() + " at path " + path)) +} + +type CannotSetError error + +func newCannotSetError(name string) CannotSetError { + return CannotSetError(errors.New("cannot set " + name)) +} + +type InvalidTypeForPathError error + +func newInvalidTypeForPathError(path string, pt string, nt string) InvalidTypeForPathError { + return InvalidTypeForPathError(errors.New("invalid type for path " + path + ": expected " + pt + ", got " + nt)) +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/find.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/find.go new file mode 100644 index 0000000..0495ecf --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/find.go @@ -0,0 +1,51 @@ +// Copyright 2024 schukai GmbH +// SPDX-License-Identifier: proprietary + +package pathfinder + +import ( + "fmt" + "reflect" + "strings" +) + +func FindPaths(v reflect.Value, targetType reflect.Type, path []string, paths *[]string) { + + if v.Kind() == reflect.Invalid { + return + } + + vType := v.Type() + + switch v.Kind() { + case reflect.Ptr: + FindPaths(v.Elem(), targetType, path, paths) + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + newPath := append(path, vType.Field(i).Name) + FindPaths(v.Field(i), targetType, newPath, paths) + } + case reflect.Map: + for _, key := range v.MapKeys() { + newPath := append(path, fmt.Sprint(key)) + FindPaths(v.MapIndex(key), targetType, newPath, paths) + } + case reflect.Slice, reflect.Array: + for i := 0; i < v.Len(); i++ { + newPath := append(path, fmt.Sprint(i)) + FindPaths(v.Index(i), targetType, newPath, paths) + } + + case reflect.String, reflect.Bool, reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8, reflect.Int, reflect.Uint64, reflect.Uint32, reflect.Uint16, reflect.Uint8, reflect.Uint: + if vType != targetType { + return + } + + default: + return + } + + if vType == targetType { + *paths = append(*paths, strings.Join(path, ".")) + } +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.lock new file mode 100644 index 0000000..fd83cb2 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.lock @@ -0,0 +1,181 @@ +{ + "nodes": { + "commonFlake": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "dir": "common", + "lastModified": 1718788884, + "narHash": "sha256-PefMbkGNMK9TN1qcNL9OkFVTNdv6wo6XoaS8eTdsY04=", + "ref": "refs/heads/master", + "rev": "abda2dc723e13dfc835535593321c514666e679e", + "revCount": 39, + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + }, + "original": { + "dir": "common", + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flakeUtils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727397532, + "narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f65141456289e81ea0d5a05af8898333cab5c53d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1704145853, + "narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2ea8eab9e400618748ab1a6a108255233b602c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "commonFlake": "commonFlake", + "flake-utils": "flake-utils", + "flakeUtils": "flakeUtils", + "nixpkgs": "nixpkgs_2", + "nixpkgsUnstable": "nixpkgsUnstable", + "versionFlake": "versionFlake" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "versionFlake": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1716914109, + "narHash": "sha256-JY0PLGWzYRDQ9daKLGOBWHHuYun9nSpH9J3aSk8iDmQ=", + "ref": "refs/heads/master", + "rev": "fe8dd932d6c414a93b4a69c470792b2db038e0fb", + "revCount": 129, + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + }, + "original": { + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.nix new file mode 100644 index 0000000..64f1699 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/flake.nix @@ -0,0 +1,158 @@ +{ + description = "Configuration is a library"; + + inputs = { + nixpkgs = {url = "github:nixos/nixpkgs/nixos-24.05";}; + nixpkgsUnstable = {url = "github:nixos/nixpkgs/nixos-unstable";}; + flakeUtils = {url = "github:numtide/flake-utils";}; + + commonFlake = { + url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common"; + flake = true; + }; + + versionFlake = { + url = "git+https://gitlab.schukai.com/oss/utilities/version.git"; + flake = true; + }; + }; + + outputs = { + self, + nixpkgs, + nixpkgsUnstable, + flake-utils, + versionFlake, + commonFlake, + ... + } @ inputs: + flake-utils.lib.eachDefaultSystem (system: let + inherit (nixpkgs.lib) optional; + + commonPck = commonFlake.packages.${system}.common; + versionPck = versionFlake.packages.${system}.version; + + pkgs' = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + common = commonPck; + }) + + (final: prev: { + version = versionPck; + }) + + (final: prev: { + dolt = + (import nixpkgsUnstable { + inherit system; + }) + .dolt; + }) + ]; + }; + in { + packages = rec { + manual = pkgs'.callPackage ./nix/packages/manual.nix {inherit self pkgs';}; + }; + + devShells = { + default = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + versionBin = versionPck + "/bin/version"; + + scriptGoTask = import ./nix/scripts/go-task.nix {inherit self pkgs' system;}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptGoTask + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -n "$CI_JOB_TOKEN" ]; then + echo_fail "You are in a CI environment, this shell is not intended for CI, but for local development" + exit 1 + fi + + echo_header "Configuration Lib development shell" + readonly worktree=$(get_working_dir) + echo_hint "Working directory: ''${worktree}" + currentVersion=$(${versionBin} print -g) + if [ -z "''${currentVersion}" ]; then + echo_fail "No version found, check your git tags" + else + echo_hint "Current version: ''${currentVersion}" + fi + + currentGitBranch=$(git rev-parse --abbrev-ref HEAD) + echo_hint "Current branch: ''${currentGitBranch}" + echo_hint "You can run the task command to see the available tasks" + + echo_section "Happy hacking!" + ''; + }; + + gitlab = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + + scriptCleanUp = pkgs'.callPackage ./nix/scripts/clean-up.nix {inherit pkgs';}; + scriptRunCITests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {inherit pkgs';}; + scriptRelease = pkgs'.callPackage ./nix/scripts/release.nix {inherit pkgs';}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptCleanUp + scriptRunCITests + scriptRelease + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -z "$CI_JOB_TOKEN" ]; then + echo_fail "You are not in a CI environment, this shell is intended for CI, but for local development" + exit 1 + fi + + cd ''${CI_PROJECT_DIR} || exit 1 + + ''; + }; + }; + }); +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/get.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/get.go new file mode 100644 index 0000000..3d53650 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/get.go @@ -0,0 +1,74 @@ +// Copyright 2022 schukai GmbH +// SPDX-License-Identifier: AGPL-3.0 + +package pathfinder + +import ( + "reflect" + "strconv" + "strings" +) + +// GetValue returns the value of a field in a struct, given a path to the field. +// The path can contain dots to access nested fields. +// The object must be a pointer to a struct, a struct, a map, a slice or an array, +// otherwise an error is returned. +func GetValue[D any](obj D, keyWithDots string) (any, error) { + keySlice := strings.Split(keyWithDots, ".") + v := reflect.ValueOf(obj) + + for _, key := range keySlice[0:] { + + if !v.IsValid() { + return nil, newInvalidPathError(keyWithDots) + } + + switch v.Kind() { + case reflect.Ptr, reflect.Interface: + v = v.Elem() + } + + switch v.Kind() { + case reflect.Map: + v = v.MapIndex(reflect.ValueOf(key)) + if !v.IsValid() { + return nil, newInvalidPathError(keyWithDots) + } + + case reflect.Slice, reflect.Array: + index, err := strconv.Atoi(key) + if err != nil { + return nil, newInvalidPathError(keyWithDots) + } + // check if index is in range + if index >= v.Len() { + return nil, newInvalidPathError(keyWithDots) + } + v = v.Index(index) + case reflect.Struct: + v = v.FieldByName(key) + if !v.IsValid() { + return nil, newInvalidPathError(keyWithDots) + } + default: + return nil, newInvalidPathError(keyWithDots) + } + + } + + if v.Kind() == reflect.Invalid { + return nil, newInvalidPathError(keyWithDots) + } + + //for v.Kind() == reflect.Ptr { + // v = v.Elem() + //} + + // check if v can interface + if !v.CanInterface() { + return nil, newInvalidPathError(keyWithDots) + } + + return v.Interface(), nil + +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/pathfinder.iml b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/pathfinder.iml new file mode 100644 index 0000000..789c0e8 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/pathfinder.iml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/.devenv/state/go/pkg/mod/github.com/google/addlicense@v1.1.1/testdata/expected" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/.devenv/state/go/pkg/mod/github.com/google/addlicense@v1.1.1/testdata/initial" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/release.json b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/release.json new file mode 100644 index 0000000..ccd00c2 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/release.json @@ -0,0 +1 @@ +{"version":"0.5.2"} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/set.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/set.go new file mode 100644 index 0000000..7c37da1 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git/set.go @@ -0,0 +1,293 @@ +// Copyright 2022 schukai GmbH +// SPDX-License-Identifier: AGPL-3.0 + +package pathfinder + +import ( + "bytes" + "encoding/gob" + "fmt" + "reflect" + "strconv" + "strings" +) + +func deepCopy(src, dst interface{}) error { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + dec := gob.NewDecoder(&buf) + + if err := enc.Encode(src); err != nil { + return err + } + + return dec.Decode(dst) +} + +// SetValue sets the value of a field in a struct, given a path to the field. +// The object must be a pointer to a struct, otherwise an error is returned. +func SetValue[D any](obj D, keyWithDots string, newValue any) error { + + keySlice := strings.Split(keyWithDots, ".") + reflectionOfObject := reflect.ValueOf(obj) + + for keyIndex, key := range keySlice[0 : len(keySlice)-1] { + + if reflectionOfObject.Kind() == reflect.Map { + + if reflectionOfObject.IsNil() { + return newInvalidPathError(keyWithDots) + } + + currentValue := reflectionOfObject.MapIndex(reflect.ValueOf(key)).Interface() + newValueCopy := reflect.New(reflect.TypeOf(currentValue)).Interface() + if err := deepCopy(currentValue, newValueCopy); err != nil { + return err + } + + newValueCopyPtr := &newValueCopy + newValueCopyReflect := reflect.ValueOf(newValueCopyPtr).Elem() + if !newValueCopyReflect.CanAddr() { + return newCannotSetError("Wert ist nicht adressierbar") + } + newKey := strings.Join(keySlice[keyIndex+1:], ".") + + err := SetValue(newValueCopyPtr, newKey, newValue) + if err != nil { + return err + } + + reflectionOfObject.SetMapIndex(reflect.ValueOf(key), reflect.ValueOf(newValueCopy).Elem()) + return nil + + } + + if reflectionOfObject.Kind() == reflect.Ptr && reflectionOfObject.Elem().Kind() == reflect.Interface { + reflectionOfObject = reflectionOfObject.Elem().Elem() + } + + for reflectionOfObject.Kind() != reflect.Ptr { + if reflectionOfObject.Kind() == reflect.Invalid { + return newInvalidPathError(keyWithDots) + } + + if reflectionOfObject.CanAddr() { + reflectionOfObject = reflectionOfObject.Addr() + } else { + return newCannotSetError(keyWithDots) + } + + } + + if reflectionOfObject.Kind() != reflect.Ptr { + return newUnsupportedTypePathError(keyWithDots, reflectionOfObject.Type()) + } + + switch reflectionOfObject.Elem().Kind() { + case reflect.Struct: + reflectionOfObject = reflectionOfObject.Elem().FieldByName(key) + + case reflect.Slice: + // index is a number and get reflectionOfObject from slice with index + index, err := strconv.Atoi(key) + if err != nil { + return newInvalidPathError(keyWithDots) + } + + if index >= reflectionOfObject.Elem().Len() { + return newInvalidPathError(keyWithDots) + } + + reflectionOfObject = reflectionOfObject.Elem().Index(index) + default: + return newUnsupportedTypePathError(keyWithDots, reflectionOfObject.Type()) + } + + } + + if reflectionOfObject.Kind() == reflect.Invalid { + return newInvalidPathError(keyWithDots) + } + + for reflectionOfObject.Kind() == reflect.Ptr { + reflectionOfObject = reflectionOfObject.Elem() + } + + // non-supporter type at the top of the path + switch reflectionOfObject.Kind() { + case reflect.Struct: + + reflectionOfObject = reflectionOfObject.FieldByName(keySlice[len(keySlice)-1]) + if !reflectionOfObject.IsValid() { + return newInvalidPathError(keyWithDots) + } + + if !reflectionOfObject.CanSet() { + return newCannotSetError(keyWithDots) + } + + case reflect.Map: + + key := keySlice[len(keySlice)-1] + m := reflectionOfObject + + keyVal := reflect.ValueOf(key) + newVal := reflect.ValueOf(newValue) + + if !keyVal.Type().ConvertibleTo(m.Type().Key()) { + return fmt.Errorf("key type mismatch") + } + + if !newVal.Type().ConvertibleTo(m.Type().Elem()) { + return fmt.Errorf("value type mismatch") + } + + keyValConverted := keyVal.Convert(m.Type().Key()) + newValConverted := newVal.Convert(m.Type().Elem()) + m.SetMapIndex(keyValConverted, newValConverted) + return nil + + case reflect.Slice: + + index, err := strconv.Atoi(keySlice[len(keySlice)-1]) + if err != nil { + return newInvalidPathError(keyWithDots) + } + + if index >= reflectionOfObject.Len() { + return newInvalidPathError(keyWithDots) + } + + reflectionOfObject = reflectionOfObject.Index(index) + + case reflect.Array: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Ptr: + if newValue == nil { + reflectionOfObject.Set(reflect.Zero(reflectionOfObject.Type())) + } else { + reflectionOfObject.Set(reflect.ValueOf(&newValue)) + } + return nil + case reflect.Interface: + + // check if reflectionOfObject is an interface to an struct pointer + if reflectionOfObject.Elem().Kind() == reflect.Ptr && reflectionOfObject.Elem().Elem().Kind() == reflect.Struct { + return SetValue(reflectionOfObject.Elem().Interface(), keySlice[len(keySlice)-1], newValue) + } + + case reflect.Chan: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Func: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.UnsafePointer: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Uintptr: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Complex64: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Complex128: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + case reflect.Invalid: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + default: + return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) + } + + newValueType := reflect.TypeOf(newValue) + if newValueType == nil { + return newUnsupportedTypePathError(keyWithDots, reflectionOfObject.Type()) + } + + newValueKind := reflect.TypeOf(newValue).Kind() + + switch reflectionOfObject.Kind() { + case reflect.String: + if reflectionOfObject.Kind() == reflect.Ptr || reflectionOfObject.Kind() == reflect.Interface { + if reflectionOfObject.Elem().CanSet() && reflectionOfObject.Elem().Kind() == reflect.String { + if newValueKind == reflect.String { + reflectionOfObject.Elem().SetString(newValue.(string)) + } else { + reflectionOfObject.Elem().SetString(fmt.Sprintf("%v", newValue)) + } + } + } else if newValueKind == reflect.String { + + if reflect.TypeOf(newValue).ConvertibleTo(reflect.TypeOf("")) { + newValueString := reflect.ValueOf(newValue).Convert(reflect.TypeOf("")).Interface().(string) + reflectionOfObject.SetString(newValueString) + } else { + return newUnsupportedTypePathError(keyWithDots, reflectionOfObject.Type()) + } + } else { + reflectionOfObject.SetString(fmt.Sprintf("%v", newValue)) + } + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + + if newValueKind == reflect.Int { + reflectionOfObject.SetInt(int64(newValue.(int))) + } else { + s, err := strconv.ParseInt(fmt.Sprintf("%v", newValue), 10, 64) + if err != nil { + return err + } + reflectionOfObject.SetInt(s) + } + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + + if newValueKind == reflect.Int { + reflectionOfObject.SetUint(uint64(newValue.(int))) + } else { + s, err := strconv.ParseInt(fmt.Sprintf("%v", newValue), 10, 64) + if err != nil { + return err + } + reflectionOfObject.SetUint(uint64(s)) + } + + case reflect.Bool: + + if newValueKind == reflect.Bool { + reflectionOfObject.SetBool(newValue.(bool)) + } else { + b, err := strconv.ParseBool(fmt.Sprintf("%v", newValue)) + if err != nil { + return err + } + + reflectionOfObject.SetBool(b) + } + + case reflect.Float64, reflect.Float32: + + if newValueKind == reflect.Float64 { + reflectionOfObject.SetFloat(newValue.(float64)) + } else { + s, err := strconv.ParseFloat(fmt.Sprintf("%v", newValue), 64) + if err != nil { + return err + } + + reflectionOfObject.SetFloat(s) + } + + case reflect.Slice, reflect.Array: + + if newValueKind == reflect.Ptr { + newValue = reflect.ValueOf(newValue).Elem().Interface() + reflectionOfObject.Set(reflect.ValueOf(newValue)) + } else if newValueKind == reflect.Slice { + reflectionOfObject.Set(reflect.ValueOf(newValue)) + } else { + return newUnsupportedTypePathError(keyWithDots, reflectionOfObject.Type()) + } + + default: + return newInvalidTypeForPathError(keyWithDots, reflectionOfObject.Type().String(), newValueKind.String()) + } + + return nil + +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.envrc b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.envrc index 6de8a8a..0da5bcc 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.envrc +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.envrc @@ -1,3 +1,2 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=" - -use devenv \ No newline at end of file +watch_file ./flake.nix ./nix/scripts/*.nix ./nix/config/*.nix ./nix/packages/*.nix +use flake \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.gitlab-ci.yml b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.gitlab-ci.yml index 1bc73eb..78b9b3f 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.gitlab-ci.yml +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/.gitlab-ci.yml @@ -1,59 +1,43 @@ - -# THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL -# DO NOT EDIT THIS FILE MANUALLY -# INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix -# AND OPEN A SHELL WITH THE COMMAND devenv shell -# - -image: docker-registry.schukai.com:443/nixos-ci-devenv:latest - variables: - # The repo name as used in - # https://github.com/nix-community/NUR/blob/master/repos.json - NIXOS_VERSION: "23.05" NIXPKGS_ALLOW_UNFREE: "1" NIXPKGS_ALLOW_INSECURE: "1" GIT_DEPTH: 10 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + stages: - test - - deploy + - release before_script: - - echo > .env-gitlab-ci - - variables=("HOME=$HOME" "CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME" "CI_REPOSITORY_URL=$CI_REPOSITORY_URL" "GITLAB_TOKEN=$GITLAB_TOKEN" "CI_JOB_TOKEN=$CI_JOB_TOKEN" "GITLAB_USER_EMAIL=$GITLAB_USER_EMAIL" "GITLAB_USER_NAME=\"$GITLAB_USER_NAME\"" "CI_REGISTRY_USER=$CI_REGISTRY_USER" "CI_PROJECT_ID=$CI_PROJECT_ID" "CI_PROJECT_DIR=$CI_PROJECT_DIR" "CI_API_V4_URL=$CI_API_V4_URL" "CI_PROJECT_NAME=$CI_PROJECT_NAME" "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA"); for var in "${variables[@]}"; do echo "$var" >> .env-gitlab-ci; done - - cat .env-gitlab-ci + - git config --global user.email "${GITLAB_USER_EMAIL}" + - git config --global user.name "${GITLAB_USER_NAME:-"Gitlab CI"}" + - git config --global credential.helper '!f() { echo "username=gitlab-ci-token"; echo "password=${CI_JOB_TOKEN}"; }; f' + - git config --global pull.rebase true + - git config --global http.sslVerify "false" + after_script: - - if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi + - nix develop .#gitlab --command clean-up -test: +tests: stage: test tags: - - nixos + - nixos-gen3 script: - - devenv shell test-lib - - cache: - - key: nixos - paths: - - /nix/store - + - nix develop .#gitlab --command run-ci-tests artifacts: paths: - - dist + - last-phpunit-result.xml -deploy: - stage: deploy +release: + stage: release tags: - - nixos + - nixos-gen3 script: - - devenv shell -c deploy-lib - + - nix develop .#gitlab --command release when: on_success - - cache: - - key: nixos - paths: - - /nix/store - + rules: + - if: $CI_COMMIT_BRANCH == "master" + \ No newline at end of file diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.lock deleted file mode 100644 index a9b3b22..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.lock +++ /dev/null @@ -1,190 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1698243190, - "narHash": "sha256-n+SbyNQRhUcaZoU00d+7wi17HJpw/kAUrXOL4zRcqE8=", - "owner": "cachix", - "repo": "devenv", - "rev": "86f476f7edb86159fd20764489ab4e4df6edb4b6", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1698288402, - "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1698288402, - "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-23.05", - "type": "indirect" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1698227354, - "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks", - "version": "version" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "version": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1690668568, - "narHash": "sha256-jzixQKFFW4oxO0S4GYqbkFCXzhBd6com6Z9+MtVKakU=", - "ref": "refs/heads/master", - "rev": "3838f03165b726e47d586c04a1821749375e1001", - "revCount": 37, - "type": "git", - "url": "https://gitlab.schukai.com/oss/utilities/version.git" - }, - "original": { - "type": "git", - "url": "https://gitlab.schukai.com/oss/utilities/version.git" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.nix deleted file mode 100644 index 5fdd16f..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.nix +++ /dev/null @@ -1,715 +0,0 @@ -{ pkgs ? import <nixpkgs> {}, inputs, phps, lib, config, modulesPath, ... }: - -{ - # https://devenv.sh/packages/ - packages = with pkgs; [ - inputs.version.defaultPackage."${builtins.currentSystem}" - appimage-run - blackbox - blackbox-terminal - coreutils-full - dbeaver - dbeaver - delve - dialog - drill - exa - fd - fd - feh - gcc12 - gdlv - git - glab - gnugrep - gnumake - gnused - go-licenses - gosec - go-task - gum - httpie - hurl - jq - libffi - logrotate - meld - memcached - netcat - nixfmt - nodePackages.mermaid-cli - openssh - procps - ranger - unixtools.xxd - unzip - util-linux - wget - zlib - ]; - - # https://devenv.sh/languages/ - # languages.nix.enable = true; - languages = { go = { enable = true; }; }; - - difftastic.enable = true; - - scripts.get-go-default-packages.exec = '' - #!${pkgs.bash}/bin/bash - echo $(awk -F ' ' '/^module / { print $2 }' go.mod) - ''; - - # This script is executed when the app is built - # You can use it to build the app - scripts.test-lib.exec = '' - #!${pkgs.bash}/bin/bash - #set -euo pipefail - set -x - - PATH="''${PATH}":${pkgs.coreutils}/bin - PATH="''${PATH}":${pkgs.findutils}/bin - PATH="''${PATH}":${pkgs.jq}/bin/ - PATH="''${PATH}":${pkgs.rsync}/bin/ - PATH="''${PATH}":${pkgs.bash}/bin/ - PATH="''${PATH}":${pkgs.curl}/bin/ - PATH="''${PATH}":${pkgs.moreutils}/bin/ - PATH="''${PATH}":${pkgs.gnutar}/bin - PATH="''${PATH}":${pkgs.gzip}/bin/ - PATH="''${PATH}":${pkgs.procps}/bin/ - PATH="''${PATH}":${pkgs.exa}/bin/ - PATH="''${PATH}":${pkgs.git}/bin/ - PATH="''${PATH}":${pkgs.gnugrep}/bin/ - PATH="''${PATH}":${ - inputs.version.defaultPackage."${builtins.currentSystem}" - }/bin/ - - export PATH - - task test - - ''; - - # This scritp is used to deploy the app to the gitlab registry - # It is used by the gitlab-ci.yml file - # The environment variables are set in the gitlab project settings - scripts.deploy-lib.exec = '' - #!${pkgs.bash}/bin/bash - - PATH="''${PATH}":${pkgs.coreutils}/bin - PATH="''${PATH}":${pkgs.jq}/bin/ - PATH="''${PATH}":${pkgs.curl}/bin/ - PATH="''${PATH}":${pkgs.moreutils}/bin/ - PATH="''${PATH}":${pkgs.gnutar}/bin - PATH="''${PATH}":${pkgs.gzip}/bin/ - PATH="''${PATH}":${pkgs.exa}/bin/ - PATH="''${PATH}":${pkgs.git}/bin/ - PATH="''${PATH}":${ - inputs.version.defaultPackage."${builtins.currentSystem}" - }/bin/ - - export PATH - - if [[ -f .env-gitlab-ci ]]; then - source .env-gitlab-ci - rm .env-gitlab-ci - fi - - set -x - ## if $HOME not set, set it to current directory - if [[ -z "''${HOME}" ]]; then - HOME=$(pwd) - fi - - export HOME - - git config user.email "''${GITLAB_USER_EMAIL}" - git config user.name "''${GITLAB_USER_NAME:-"Gitlab CI"}" - git config pull.rebase true - git config http.sslVerify "false" - git remote set-url origin https://pad:''${GITLAB_TOKEN}@''${CI_REPOSITORY_URL#*@} - - git fetch --all --tags --unshallow - git reset --hard origin/master - git checkout $CI_COMMIT_REF_NAME - git pull origin $CI_COMMIT_REF_NAME - - if [ ! -z "''${CI_PROJECT_DIR}" ]; then - echo "CI_PROJECT_DIR is set, using it as project root." - project_root=$(realpath "''${CI_PROJECT_DIR}")/ - elif [ ! -z "''${DEVENV_ROOT}" ]; then - echo "DEVENV_ROOT is set, using it as project root." - project_root=$(realpath "''${DEVENV_ROOT}")/ - else - echo "Error: DEVENV_ROOT or CI_PROJECT_DIR environment variables are not set." - exit 1 - fi - - if [ ! -d "''${project_root}" ]; then - echo "Error: Project root directory does not seem to be valid." - echo "Check the DEVENV_ROOT or CI_PROJECT_DIR environment variables." - exit 1 - fi - - if [ -z "'CI_JOB_TOKEN" ]; then - echo "Error: CI_JOB_TOKEN variable is not set." - exit 1 - fi - - git --no-pager log --decorate=short --pretty=oneline - gitVersion=v$(version predict) - git tag -a $gitVersion -m"chore: bump version" - git --no-pager log --decorate=short --pretty=oneline - git push -o ci.skip origin ''${CI_COMMIT_REF_NAME} --tags - - echo "done" - - ''; - - enterShell = '' - -cat <<'EOF' > CONTRIBUTING.md -# Contributing to schukai GmbH Projects - -## Code of Conduct - -Be a human, not an asshole. Common sense and basic human decency apply. - -## Getting Started - -### Setting up the Project - -1. Fork the project on GitLab. -2. Clone your fork locally. Replace `[your-username]` with your GitLab username and `[project-name]` with the actual project name: - ```bash - git clone $(git config --get remote.origin.url) - ``` -3. Add the upstream repository. Replace `[original-username]` and `[project-name]` with the original repository's username and project name: - ```bash - git remote add upstream https://gitlab.schukai.com/[original-username]/[project-name].git - ``` - -### Making Changes - -1. Create a new branch: - ```bash - git checkout -b new-feature-branch - ``` -2. Make your changes. -3. Commit your changes: - ```bash - git commit -m "Description of change" - ``` - -### Submitting a Merge Request - -1. Push your changes to your fork: - ```bash - git push origin new-feature-branch - ``` -2. Navigate to the original project repository on `gitlab.schukai.com`. -3. Open a Merge Request and provide a clear description of the changes. - -## Coding Guidelines - -- Follow the coding style used in the project. -- Write unit tests for new features. -- Ensure that all tests pass before submitting a Merge Request. - -## Reporting Issues - -If you find an issue, please create a new issue on `gitlab.schukai.com`. - -## Additional Resources - -- [GitLab Flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) -- [GitLab Merge Request Guidelines](https://docs.gitlab.com/ee/user/project/merge_requests/) - -Thank you for your contribution! - -EOF - -cat <<'EOF' > LICENSE -Copyright (C) 2023 schukai GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published -by the Free Software Foundation, either version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. - -EOF - -cat <<'EOF' > Taskfile.yml - -# THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL -# DO NOT EDIT THIS FILE MANUALLY -# INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix -# AND OPEN A SHELL WITH THE COMMAND devenv shell -# -# Information about the task runner can be found here: -# https://taskfile.dev - -version: '3' - -tasks: - default: - cmds: - - task --list - silent: true - - test: - desc: Execute unit tests in Go. - env: - TEST_BY_TASK: true - cmds: - - echo "Execute unit tests in Go." - - gosec . - - go test -tags=runOnTask -cover -v ./... - - go test -tags=runOnTask -bench -v ./... - - go test -tags=runOnTask -race -v ./... - - test-fuzz: - desc: Conduct fuzzing tests.# - env: - TEST_BY_TASK: true - cmds: - - echo "Conduct fuzzing tests." - - go test -tags=runOnTask -v -fuzztime=30s -fuzz=Fuzz ./... - - add-licenses: - desc: Attach license headers to Go files. - cmds: - - echo "Attach license headers to Go files." - - go install github.com/google/addlicense@latest - - addlicense -c "schukai GmbH" -s -l "AGPL-3.0" ./*.go - silent: true - - check-licenses: - desc: Check license headers of Go files. - silent: true - cmds: - - go-licenses save "$(get-go-default-packages)" --ignore "gitlab.schukai.com" --force --save_path ''${DEVENV_ROOT}/licenses/ - - check: - desc: Confirm repository status. - cmds: - - git diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1) - silent: true - - commit: - desc: Commit changes to the repository. - aliases: - - c - - ci - - git-commit - cmds: - - do-git-commit -EOF - -cat <<'EOF' > .gitlab-ci.yml - -# THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL -# DO NOT EDIT THIS FILE MANUALLY -# INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix -# AND OPEN A SHELL WITH THE COMMAND devenv shell -# - -image: docker-registry.schukai.com:443/nixos-ci-devenv:latest - -variables: - # The repo name as used in - # https://github.com/nix-community/NUR/blob/master/repos.json - NIXOS_VERSION: "23.05" - NIXPKGS_ALLOW_UNFREE: "1" - NIXPKGS_ALLOW_INSECURE: "1" - GIT_DEPTH: 10 - -stages: - - test - - deploy - -before_script: - - echo > .env-gitlab-ci - - variables=("HOME=$HOME" "CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME" "CI_REPOSITORY_URL=$CI_REPOSITORY_URL" "GITLAB_TOKEN=$GITLAB_TOKEN" "CI_JOB_TOKEN=$CI_JOB_TOKEN" "GITLAB_USER_EMAIL=$GITLAB_USER_EMAIL" "GITLAB_USER_NAME=\"$GITLAB_USER_NAME\"" "CI_REGISTRY_USER=$CI_REGISTRY_USER" "CI_PROJECT_ID=$CI_PROJECT_ID" "CI_PROJECT_DIR=$CI_PROJECT_DIR" "CI_API_V4_URL=$CI_API_V4_URL" "CI_PROJECT_NAME=$CI_PROJECT_NAME" "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA"); for var in "''${variables[@]}"; do echo "$var" >> .env-gitlab-ci; done - - cat .env-gitlab-ci - -after_script: - - if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi - -test: - stage: test - tags: - - nixos - script: - - devenv shell test-lib - - cache: - - key: nixos - paths: - - /nix/store - - artifacts: - paths: - - dist - -deploy: - stage: deploy - tags: - - nixos - script: - - devenv shell -c deploy-lib - - when: on_success - - cache: - - key: nixos - paths: - - /nix/store - -EOF - - ''; - - scripts.do-git-commit.exec = '' - #!/usr/bin/env bash - - # Define colors if the terminal supports it - if [ -t 1 ]; then - RED='\033[0;31m' - GREEN='\033[0;32m' - RESET='\033[0m' - BOLD='\033[1m' - else - RED="" - GREEN="" - RESET="" - fi - - step=1 - - reset - clear - - # create random log file - LOGFILE="$(mktemp)" - if [ $? -ne 0 ]; then - echo -e "''${RED}✖ Could not create temporary log file. Exiting.''${RESET}" - exit 1 - fi - - log_and_display() { - echo -e "''${GREEN}==> $step. $1''${RESET}" | tee -a $LOGFILE - step=$((step + 1)) - } - - log_error_and_display() { - echo -e "''${RED}==> $step. $1''${RESET}" | tee -a $LOGFILE - } - - printLogfileAndExit() { - exit_code=$1 - echo -e "\n\n========================================\n\n\n" - - echo -e "\n\n''${BOLD}Git and GitLab Automation Script''${RESET}\n\nI have performed the following actions:\n\n" - cat "$LOGFILE" - - # Optional: Remove log file - rm -f "$LOGFILE" - - if [ $exit_code -eq 0 ]; then - echo -e "\n''${GREEN}✔''${RESET} All actions were successful" | tee -a $LOGFILE - elif [ $exit_code -eq -1 ]; then - echo -e "\n''${RED}✖''${RESET} The script was manually cancelled" | tee -a $LOGFILE - exit_code=0 - else - echo -e "\n''${RED}✖''${RESET} Some actions failed" | tee -a $LOGFILE - fi - - exit $exit_code - } - - print_headline() { - local title=$1 - local underline=$(printf '─%.0s' $(seq 1 ''${#title})) - echo -e "\n\n''${BOLD}''${title}\n''${underline}''${RESET}\n" - } - - do_cancel() { - echo -e "''${RED}==> ✖ Cancelled.''${RESET}" | tee -a $LOGFILE - printLogfileAndExit -1 - } - - # Function for unified logging and display - log_action() { - if [ $? -eq 0 ]; then - echo -e " ''${GREEN}✔''${RESET} $1: Successful" | tee -a $LOGFILE - else - echo -e " ''${RED}✖''${RESET} $1: Failed" | tee -a $LOGFILE - printLogfileAndExit 1 - fi - } - - print_what_to_do() { - echo -e "\n\nWhat do you want to do?\n" - } - - git_status=$(git status --porcelain) - if [[ -z "$git_status" ]]; then - log_error_and_display "No changes to commit. Exiting." - printLogfileAndExit 0 - fi - - print_headline "Choose commit type" - selection=$(gum choose "feat: (new feature for the user, not a new feature for build script)" "fix: (bug fix for the user, not a fix to a build script)" "chore: (updating grunt tasks etc.; no production code change)" "docs: (changes to the documentation)" "style: (formatting, missing semi colons, etc; no production code change)" "refactor: (refactoring production code, eg. renaming a variable)" "test: (adding missing tests, refactoring tests; no production code change)" "Cancel") - - commit_type=$(echo "$selection" | awk -F':' '{print $1}') - - if [[ "$commit_type" == "Cancel" ]]; then - do_cancel - fi - - log_and_display "You chose the commit type: $commit_type" - - # NEXT STEP ISSUE HANDLING ############################################################################################################ - #log_and_display "Issue handling" - - gitlabIssues=() - while IFS= read -r line; do - if [[ $line =~ ^# ]]; then - id=$(echo "$line" | awk '{print substr($1, 2)}') - title=$(echo "$line" | awk -F'about' '{print $1}' | awk '{$1=$2=""; print substr($0, 3)}') - gitlabIssues+=("$id > $title") - fi - done < <(gum spin --spinner dot --show-output --title "Ask gitlab ..." -- glab issue list --output-format=details) - - ## if issues are available, ask if user wants to use an existing issue or create a new one - createOption="Create new issue" - existingOption="Use existing issue" - cancelOption="Cancel" - - print_headline "Choose issue handling" - if [ ''${#gitlabIssues[@]} -eq 0 ]; then - log_and_display "There are no issues available." - - print_what_to_do - choice=$(gum choose "$createOption" "$cancelOption") - - else - log_and_display "There are ''${#gitlabIssues[@]} issues available." - print_what_to_do - choice=$(gum choose "$createOption" "$existingOption" "$cancelOption") - fi - - if [[ "$choice" == "$cancelOption" ]]; then - do_cancel - fi - - ## array of issue ids - work_on_issue_ids=() - - issue_text="" - - if [[ "$choice" == "$createOption" ]]; then - print_headline "Create new issue" - issue_text=$(gum input --placeholder "Enter issue title") - echo -e "Enter issue description. ''${RED}End with Ctrl+D''${RESET}\n" - issue_description=$(gum write --placeholder "Enter issue description. End with Ctrl+D") - - if [[ -z "$issue_text" ]]; then - log_error_and_display "Issue title is empty. Exiting." - printLogfileAndExit 1 - fi - - log_and_display "You entered the issue title: $issue_text" - log_and_display "You entered the issue description: $issue_description" - echo -e "\n" - - gum confirm "Do you want to create this issue?" - # gum confirm exits with status 0 if confirmed and status 1 if cancelled. - if [ $? -eq 1 ]; then - do_cancel - fi - - issue_output=$(glab issue create -t"$issue_text" --no-editor --description "$issue_description") - issue_id=$(echo "$issue_output" | grep -oP '(?<=/issues/)\d+') - - work_on_issue_ids+=("$issue_id") - - log_action "glab issue with id $issue_id created" - - else - - print_headline "Use existing issue" - echo -e "Select issue with arrow keys and press tab or space to select. Press enter to confirm.\n" - issue_ids=$(gum choose --no-limit "''${gitlabIssues[@]}") - - # assign issue_ids to work_on_issue_ids. iterate over lines and take integer from beginning of line - while IFS= read -r line; do - work_on_issue_ids+=($(echo "$line" | grep -oP '^\d+')) - done <<<"$issue_ids" - - fi - - if [ ''${#work_on_issue_ids[@]} -eq 0 ]; then - log_and_display "No issue selected. Exiting." - printLogfileAndExit 0 - fi - - # NEXT STEP COMMIT MESSAGE ############################################################################################################ - # print work_on_issue_ids - work_on_issue_ids_string="" - for i in "''${work_on_issue_ids[@]}"; do - work_on_issue_ids_string+="#$i " - done - - log_and_display "You chose to work on the following issues: ''${work_on_issue_ids_string}" - - - print_headline "Check for changes to commit" - - # ' ' = unmodified - # M = modified - # T = file type changed (regular file, symbolic link or submodule) - # A = added - # D = deleted - # R = renamed - # C = copied (if config option status.renames is set to "copies") - # U = updated but unmerged - # https://man.freebsd.org/cgi/man.cgi?query=git-status&sektion=1&manpath=freebsd-release-ports - - count_all_changes=$(echo "$git_status" | wc -l) - count_staged_changes=$(echo "$git_status" | grep -c '^M') - count_new_staged_files=$(echo "$git_status" | grep -c '^A') - count_staged_changes=$((count_staged_changes + count_new_staged_files)) - - - - git_options_all="All $count_all_changes changes" - git_options_staged="Only the $count_staged_changes staged changes" - git_options_select_files="Select files" - git_options_cancel="Cancel" - - git_options_array=() - if [[ $count_all_changes -gt 0 ]]; then - git_options_array+=("$git_options_all") - fi - - if [[ $count_staged_changes -gt 0 ]]; then - git_options_array+=("$git_options_staged") - fi - - git_options_array+=( "$git_options_select_files" ) - git_options_array+=( "$git_options_cancel" ) - - - selection=$(gum choose "''${git_options_array[@]}") - if [[ "$selection" == "$git_options_cancel" ]]; then - do_cancel - fi - - if [[ "$selection" == "$git_options_all" ]]; then - git add -A - echo "1" - elif [[ "$selection" == "$git_options_select_files" ]]; then - - files=() - while IFS= read -r line; do - files+=("$line") - done <<<"$git_status" - - selected_files=$(gum choose --no-limit "''${files[@]}") - - # no files selected - if [[ -z "$selected_files" ]]; then - log_and_display "No files selected. Exiting." - printLogfileAndExit 0 - fi - - # add selected files - while IFS= read -r line; do - ## git proclimne could have letter, ? or ! at the beginning of the line - file=$(echo "$line" | awk '{print $2}') - if [[ -z "$file" || ! -f "$file" ]]; then - log_and_display "No file found in line: $line" - continue - fi - - git add "$file" - done <<<"$selected_files" - - fi - - ## count staged changes again and print - count_staged_changes=$(echo "$git_status" | grep -c '^M') - count_new_staged_files=$(echo "$git_status" | grep -c '^A') - count_staged_changes=$((count_staged_changes + count_new_staged_files)) - - log_and_display "You have $count_staged_changes staged changes to commit." - - # NEXT STEP COMMIT MESSAGE ############################################################################################################ - - print_headline "Enter commit message" - commit_message=$(gum input --placeholder "Enter commit message" --value "$commit_type: $issue_text $work_on_issue_ids_string") - - if [[ -z "$commit_message" ]]; then - log_error_and_display "Commit message is empty. Exiting." - printLogfileAndExit 1 - fi - - log_and_display "You entered the commit message: $commit_message" - - gum confirm "Do you want to commit with this message?" - if [ $? -eq 1 ]; then - do_cancel - fi - - # NEXT STEP COMMIT #################################################################################################################### - print_headline "Committing changes" - - if ! git commit -m "$commit_message" ; then - log_error_and_display "Commit failed. Exiting." - printLogfileAndExit 1 - fi - - log_and_display "Commit successful." - - # NEXT STEP PUSH ###################################################################################################################### - - print_headline "Pushing changes" - - if ! git push ; then - log_error_and_display "Push failed. Exiting." - printLogfileAndExit 1 - fi - - log_and_display "Push successful." - - # Close issue ###################################################################################################################### - - print_headline "Closing issues" - - for issue_id in "''${work_on_issue_ids[@]}"; do - - gum confirm "Do you want to close issue #$issue_id?" - if [ $? -eq 1 ]; then - continue - fi - - if ! glab issue close "$issue_id" ; then - log_error_and_display "Closing issue $issue_id failed. Exiting." - else - log_and_display "Closing issue $issue_id successful." - fi - done - - printLogfileAndExit 0 - ''; - - -} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.yaml b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.yaml deleted file mode 100644 index 525a6f0..0000000 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/devenv.yaml +++ /dev/null @@ -1,7 +0,0 @@ -inputs: - nixpkgs: - url: github:nixos/nixpkgs/nixos-23.05 - - version: - url: git+https://gitlab.schukai.com/oss/utilities/version.git - flake: true diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/find.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/find.go index cbf1973..0495ecf 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/find.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/find.go @@ -1,3 +1,6 @@ +// Copyright 2024 schukai GmbH +// SPDX-License-Identifier: proprietary + package pathfinder import ( diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.lock b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.lock new file mode 100644 index 0000000..fd83cb2 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.lock @@ -0,0 +1,181 @@ +{ + "nodes": { + "commonFlake": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "dir": "common", + "lastModified": 1718788884, + "narHash": "sha256-PefMbkGNMK9TN1qcNL9OkFVTNdv6wo6XoaS8eTdsY04=", + "ref": "refs/heads/master", + "rev": "abda2dc723e13dfc835535593321c514666e679e", + "revCount": 39, + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + }, + "original": { + "dir": "common", + "type": "git", + "url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flakeUtils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727397532, + "narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f65141456289e81ea0d5a05af8898333cab5c53d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1704145853, + "narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2ea8eab9e400618748ab1a6a108255233b602c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "commonFlake": "commonFlake", + "flake-utils": "flake-utils", + "flakeUtils": "flakeUtils", + "nixpkgs": "nixpkgs_2", + "nixpkgsUnstable": "nixpkgsUnstable", + "versionFlake": "versionFlake" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "versionFlake": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1716914109, + "narHash": "sha256-JY0PLGWzYRDQ9daKLGOBWHHuYun9nSpH9J3aSk8iDmQ=", + "ref": "refs/heads/master", + "rev": "fe8dd932d6c414a93b4a69c470792b2db038e0fb", + "revCount": 129, + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + }, + "original": { + "type": "git", + "url": "https://gitlab.schukai.com/oss/utilities/version.git" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.nix b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.nix new file mode 100644 index 0000000..64f1699 --- /dev/null +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/flake.nix @@ -0,0 +1,158 @@ +{ + description = "Configuration is a library"; + + inputs = { + nixpkgs = {url = "github:nixos/nixpkgs/nixos-24.05";}; + nixpkgsUnstable = {url = "github:nixos/nixpkgs/nixos-unstable";}; + flakeUtils = {url = "github:numtide/flake-utils";}; + + commonFlake = { + url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git?dir=common"; + flake = true; + }; + + versionFlake = { + url = "git+https://gitlab.schukai.com/oss/utilities/version.git"; + flake = true; + }; + }; + + outputs = { + self, + nixpkgs, + nixpkgsUnstable, + flake-utils, + versionFlake, + commonFlake, + ... + } @ inputs: + flake-utils.lib.eachDefaultSystem (system: let + inherit (nixpkgs.lib) optional; + + commonPck = commonFlake.packages.${system}.common; + versionPck = versionFlake.packages.${system}.version; + + pkgs' = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + common = commonPck; + }) + + (final: prev: { + version = versionPck; + }) + + (final: prev: { + dolt = + (import nixpkgsUnstable { + inherit system; + }) + .dolt; + }) + ]; + }; + in { + packages = rec { + manual = pkgs'.callPackage ./nix/packages/manual.nix {inherit self pkgs';}; + }; + + devShells = { + default = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + versionBin = versionPck + "/bin/version"; + + scriptGoTask = import ./nix/scripts/go-task.nix {inherit self pkgs' system;}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptGoTask + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -n "$CI_JOB_TOKEN" ]; then + echo_fail "You are in a CI environment, this shell is not intended for CI, but for local development" + exit 1 + fi + + echo_header "Configuration Lib development shell" + readonly worktree=$(get_working_dir) + echo_hint "Working directory: ''${worktree}" + currentVersion=$(${versionBin} print -g) + if [ -z "''${currentVersion}" ]; then + echo_fail "No version found, check your git tags" + else + echo_hint "Current version: ''${currentVersion}" + fi + + currentGitBranch=$(git rev-parse --abbrev-ref HEAD) + echo_hint "Current branch: ''${currentGitBranch}" + echo_hint "You can run the task command to see the available tasks" + + echo_section "Happy hacking!" + ''; + }; + + gitlab = let + commonPck = commonFlake.packages.${system}.common; + commonScript = commonPck + "/bin/common"; + + versionPck = versionFlake.packages.${system}.version; + + scriptCleanUp = pkgs'.callPackage ./nix/scripts/clean-up.nix {inherit pkgs';}; + scriptRunCITests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {inherit pkgs';}; + scriptRelease = pkgs'.callPackage ./nix/scripts/release.nix {inherit pkgs';}; + + commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';}; + + extendedPackages = [ + scriptCleanUp + scriptRunCITests + scriptRelease + ]; + + scriptPackages = [ + versionPck + ]; + + shellPackages = + commonPackages + ++ extendedPackages + ++ scriptPackages; + in + pkgs'.mkShell { + nativeBuildInputs = shellPackages; + + shellHook = '' + source ${commonScript} + + if [ -z "$CI_JOB_TOKEN" ]; then + echo_fail "You are not in a CI environment, this shell is intended for CI, but for local development" + exit 1 + fi + + cd ''${CI_PROJECT_DIR} || exit 1 + + ''; + }; + }; + }); +} diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/get.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/get.go index 8af7435..3d53650 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/get.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/get.go @@ -17,7 +17,7 @@ func GetValue[D any](obj D, keyWithDots string) (any, error) { keySlice := strings.Split(keyWithDots, ".") v := reflect.ValueOf(obj) - for _, key := range keySlice[0:len(keySlice)] { + for _, key := range keySlice[0:] { if !v.IsValid() { return nil, newInvalidPathError(keyWithDots) diff --git a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/set.go b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/set.go index 5981594..7c37da1 100644 --- a/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/set.go +++ b/source/vendor/gitlab.schukai.com/oss/libraries/go/utilities/pathfinder/set.go @@ -175,7 +175,7 @@ func SetValue[D any](obj D, keyWithDots string, newValue any) error { if reflectionOfObject.Elem().Kind() == reflect.Ptr && reflectionOfObject.Elem().Elem().Kind() == reflect.Struct { return SetValue(reflectionOfObject.Elem().Interface(), keySlice[len(keySlice)-1], newValue) } - + case reflect.Chan: return newUnsupportedTypeAtTopOfPathError(keyWithDots, reflectionOfObject.Type()) case reflect.Func: diff --git a/source/vendor/golang.org/x/crypto/LICENSE b/source/vendor/golang.org/x/crypto/LICENSE index 6a66aea..2a7cf70 100644 --- a/source/vendor/golang.org/x/crypto/LICENSE +++ b/source/vendor/golang.org/x/crypto/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/source/vendor/golang.org/x/exp/LICENSE b/source/vendor/golang.org/x/exp/LICENSE index 6a66aea..2a7cf70 100644 --- a/source/vendor/golang.org/x/exp/LICENSE +++ b/source/vendor/golang.org/x/exp/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/source/vendor/golang.org/x/net/LICENSE b/source/vendor/golang.org/x/net/LICENSE index 6a66aea..2a7cf70 100644 --- a/source/vendor/golang.org/x/net/LICENSE +++ b/source/vendor/golang.org/x/net/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/source/vendor/golang.org/x/sys/LICENSE b/source/vendor/golang.org/x/sys/LICENSE index 6a66aea..2a7cf70 100644 --- a/source/vendor/golang.org/x/sys/LICENSE +++ b/source/vendor/golang.org/x/sys/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/source/vendor/golang.org/x/sys/unix/README.md b/source/vendor/golang.org/x/sys/unix/README.md index 7d3c060..6e08a76 100644 --- a/source/vendor/golang.org/x/sys/unix/README.md +++ b/source/vendor/golang.org/x/sys/unix/README.md @@ -156,7 +156,7 @@ from the generated architecture-specific files listed below, and merge these into a common file for each OS. The merge is performed in the following steps: -1. Construct the set of common code that is idential in all architecture-specific files. +1. Construct the set of common code that is identical in all architecture-specific files. 2. Write this common code to the merged file. 3. Remove the common code from all architecture-specific files. diff --git a/source/vendor/golang.org/x/sys/unix/mkerrors.sh b/source/vendor/golang.org/x/sys/unix/mkerrors.sh index 4ed2e48..ac54eca 100644 --- a/source/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/source/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -58,6 +58,7 @@ includes_Darwin=' #define _DARWIN_USE_64_BIT_INODE #define __APPLE_USE_RFC_3542 #include <stdint.h> +#include <sys/stdio.h> #include <sys/attr.h> #include <sys/clonefile.h> #include <sys/kern_control.h> @@ -551,6 +552,7 @@ ccflags="$@" $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || + $2 ~ /^(CONNECT|SAE)_/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || @@ -654,7 +656,7 @@ errors=$( signals=$( echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | + grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort ) @@ -664,7 +666,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | sort >_error.grep echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | - grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | + grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort >_signal.grep echo '// mkerrors.sh' "$@" diff --git a/source/vendor/golang.org/x/sys/unix/syscall_aix.go b/source/vendor/golang.org/x/sys/unix/syscall_aix.go index 67ce6ce..6f15ba1 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -360,7 +360,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, var status _C_int var r Pid_t err = ERESTART - // AIX wait4 may return with ERESTART errno, while the processus is still + // AIX wait4 may return with ERESTART errno, while the process is still // active. for err == ERESTART { r, err = wait4(Pid_t(pid), &status, options, rusage) diff --git a/source/vendor/golang.org/x/sys/unix/syscall_darwin.go b/source/vendor/golang.org/x/sys/unix/syscall_darwin.go index 4cc7b00..099867d 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq)) } +//sys renamexNp(from string, to string, flag uint32) (err error) + +func RenamexNp(from string, to string, flag uint32) (err error) { + return renamexNp(from, to, flag) +} + +//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) + +func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + return renameatxNp(fromfd, from, tofd, to, flag) +} + //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { @@ -554,6 +566,43 @@ func PthreadFchdir(fd int) (err error) { return pthread_fchdir_np(fd) } +// Connectx calls connectx(2) to initiate a connection on a socket. +// +// srcIf, srcAddr, and dstAddr are filled into a [SaEndpoints] struct and passed as the endpoints argument. +// +// - srcIf is the optional source interface index. 0 means unspecified. +// - srcAddr is the optional source address. nil means unspecified. +// - dstAddr is the destination address. +// +// On success, Connectx returns the number of bytes enqueued for transmission. +func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocID, flags uint32, iov []Iovec, connid *SaeConnID) (n uintptr, err error) { + endpoints := SaEndpoints{ + Srcif: srcIf, + } + + if srcAddr != nil { + addrp, addrlen, err := srcAddr.sockaddr() + if err != nil { + return 0, err + } + endpoints.Srcaddr = (*RawSockaddr)(addrp) + endpoints.Srcaddrlen = uint32(addrlen) + } + + if dstAddr != nil { + addrp, addrlen, err := dstAddr.sockaddr() + if err != nil { + return 0, err + } + endpoints.Dstaddr = (*RawSockaddr)(addrp) + endpoints.Dstaddrlen = uint32(addrlen) + } + + err = connectx(fd, &endpoints, associd, flags, iov, &n, connid) + return +} + +//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff --git a/source/vendor/golang.org/x/sys/unix/syscall_hurd.go b/source/vendor/golang.org/x/sys/unix/syscall_hurd.go index ba46651..a6a2d2f 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_hurd.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_hurd.go @@ -11,6 +11,7 @@ package unix int ioctl(int, unsigned long int, uintptr_t); */ import "C" +import "unsafe" func ioctl(fd int, req uint, arg uintptr) (err error) { r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) diff --git a/source/vendor/golang.org/x/sys/unix/syscall_linux.go b/source/vendor/golang.org/x/sys/unix/syscall_linux.go index 5682e26..f08abd4 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1295,6 +1295,48 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { return &value, err } +// GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas" +// algorithm. +// +// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: +// +// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) +func GetsockoptTCPCCVegasInfo(fd, level, opt int) (*TCPVegasInfo, error) { + var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment + vallen := _Socklen(SizeofTCPCCInfo) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) + out := (*TCPVegasInfo)(unsafe.Pointer(&value[0])) + return out, err +} + +// GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp" +// algorithm. +// +// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: +// +// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) +func GetsockoptTCPCCDCTCPInfo(fd, level, opt int) (*TCPDCTCPInfo, error) { + var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment + vallen := _Socklen(SizeofTCPCCInfo) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) + out := (*TCPDCTCPInfo)(unsafe.Pointer(&value[0])) + return out, err +} + +// GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr" +// algorithm. +// +// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: +// +// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) +func GetsockoptTCPCCBBRInfo(fd, level, opt int) (*TCPBBRInfo, error) { + var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment + vallen := _Socklen(SizeofTCPCCInfo) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) + out := (*TCPBBRInfo)(unsafe.Pointer(&value[0])) + return out, err +} + // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { @@ -1959,7 +2001,26 @@ func Getpgrp() (pid int) { //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) -//sys Getrandom(buf []byte, flags int) (n int, err error) + +func Getrandom(buf []byte, flags int) (n int, err error) { + vdsoRet, supported := vgetrandom(buf, uint32(flags)) + if supported { + if vdsoRet < 0 { + return 0, errnoErr(syscall.Errno(-vdsoRet)) + } + return vdsoRet, nil + } + var p *byte + if len(buf) > 0 { + p = &buf[0] + } + r, _, e := Syscall(SYS_GETRANDOM, uintptr(unsafe.Pointer(p)), uintptr(len(buf)), uintptr(flags)) + if e != 0 { + return 0, errnoErr(e) + } + return int(r), nil +} + //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettid() (tid int) @@ -2592,3 +2653,4 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) +//sys Mseal(b []byte, flags uint) (err error) diff --git a/source/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/source/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index cf2ee6c..745e5c7 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -182,3 +182,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } + +const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/source/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/source/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index 3d0e984..dd2262a 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -214,3 +214,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } + +const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/source/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/source/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index 6f5a288..8cf3670 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -187,3 +187,5 @@ func RISCVHWProbe(pairs []RISCVHWProbePairs, set *CPUSet, flags uint) (err error } return riscvHWProbe(pairs, setSize, set, flags) } + +const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/source/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/source/vendor/golang.org/x/sys/unix/syscall_openbsd.go index b25343c..b86ded5 100644 --- a/source/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/source/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -293,6 +293,7 @@ func Uname(uname *Utsname) error { //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) +//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) diff --git a/source/vendor/golang.org/x/sys/unix/vgetrandom_linux.go b/source/vendor/golang.org/x/sys/unix/vgetrandom_linux.go new file mode 100644 index 0000000..07ac8e0 --- /dev/null +++ b/source/vendor/golang.org/x/sys/unix/vgetrandom_linux.go @@ -0,0 +1,13 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && go1.24 + +package unix + +import _ "unsafe" + +//go:linkname vgetrandom runtime.vgetrandom +//go:noescape +func vgetrandom(p []byte, flags uint32) (ret int, supported bool) diff --git a/source/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go b/source/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go new file mode 100644 index 0000000..297e97b --- /dev/null +++ b/source/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go @@ -0,0 +1,11 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !linux || !go1.24 + +package unix + +func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { + return -1, false +} diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/source/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index e40fa85..d73c465 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -237,6 +237,9 @@ const ( CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 + CONNECT_DATA_AUTHENTICATED = 0x4 + CONNECT_DATA_IDEMPOTENT = 0x2 + CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 @@ -1169,6 +1172,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1260,6 +1268,10 @@ const ( RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 + SAE_ASSOCID_ALL = 0xffffffff + SAE_ASSOCID_ANY = 0x0 + SAE_CONNID_ALL = 0xffffffff + SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/source/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index bb02aa6..4a55a40 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -237,6 +237,9 @@ const ( CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 + CONNECT_DATA_AUTHENTICATED = 0x4 + CONNECT_DATA_IDEMPOTENT = 0x2 + CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 @@ -1169,6 +1172,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1260,6 +1268,10 @@ const ( RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 + SAE_ASSOCID_ALL = 0xffffffff + SAE_ASSOCID_ANY = 0x0 + SAE_CONNID_ALL = 0xffffffff + SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux.go index 877a62b..de3b462 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -457,6 +457,7 @@ const ( B600 = 0x8 B75 = 0x2 B9600 = 0xd + BCACHEFS_SUPER_MAGIC = 0xca451a4e BDEVFS_MAGIC = 0x62646576 BINDERFS_SUPER_MAGIC = 0x6c6f6f70 BINFMTFS_MAGIC = 0x42494e4d @@ -494,6 +495,7 @@ const ( BPF_F_TEST_REG_INVARIANTS = 0x80 BPF_F_TEST_RND_HI32 = 0x4 BPF_F_TEST_RUN_ON_CPU = 0x1 + BPF_F_TEST_SKB_CHECKSUM_COMPLETE = 0x4 BPF_F_TEST_STATE_FREQ = 0x8 BPF_F_TEST_XDP_LIVE_FRAMES = 0x2 BPF_F_XDP_DEV_BOUND_ONLY = 0x40 @@ -928,6 +930,7 @@ const ( EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 + EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 ESP_V4_FLOW = 0xa ESP_V6_FLOW = 0xc @@ -941,9 +944,6 @@ const ( ETHTOOL_FEC_OFF = 0x4 ETHTOOL_FEC_RS = 0x8 ETHTOOL_FLAG_ALL = 0x7 - ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 - ETHTOOL_FLAG_OMIT_REPLY = 0x2 - ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_FLASHDEV = 0x33 ETHTOOL_FLASH_MAX_FILENAME = 0x80 ETHTOOL_FWVERS_LEN = 0x20 @@ -1705,6 +1705,7 @@ const ( KEXEC_ARCH_S390 = 0x160000 KEXEC_ARCH_SH = 0x2a0000 KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 KEXEC_FILE_DEBUG = 0x8 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 @@ -1780,6 +1781,7 @@ const ( KEY_SPEC_USER_KEYRING = -0x4 KEY_SPEC_USER_SESSION_KEYRING = -0x5 LANDLOCK_ACCESS_FS_EXECUTE = 0x1 + LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000 LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800 LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40 LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80 @@ -1861,6 +1863,19 @@ const ( MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 + MAP_HUGE_16GB = 0x88000000 + MAP_HUGE_16KB = 0x38000000 + MAP_HUGE_16MB = 0x60000000 + MAP_HUGE_1GB = 0x78000000 + MAP_HUGE_1MB = 0x50000000 + MAP_HUGE_256MB = 0x70000000 + MAP_HUGE_2GB = 0x7c000000 + MAP_HUGE_2MB = 0x54000000 + MAP_HUGE_32MB = 0x64000000 + MAP_HUGE_512KB = 0x4c000000 + MAP_HUGE_512MB = 0x74000000 + MAP_HUGE_64KB = 0x40000000 + MAP_HUGE_8MB = 0x5c000000 MAP_HUGE_MASK = 0x3f MAP_HUGE_SHIFT = 0x1a MAP_PRIVATE = 0x2 @@ -1908,6 +1923,7 @@ const ( MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 MNT_ID_REQ_SIZE_VER0 = 0x18 + MNT_ID_REQ_SIZE_VER1 = 0x20 MODULE_INIT_COMPRESSED_FILE = 0x4 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 @@ -2173,7 +2189,7 @@ const ( NFT_REG_SIZE = 0x10 NFT_REJECT_ICMPX_MAX = 0x3 NFT_RT_MAX = 0x4 - NFT_SECMARK_CTX_MAXLEN = 0x100 + NFT_SECMARK_CTX_MAXLEN = 0x1000 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 NFT_TABLE_F_MASK = 0x7 @@ -2342,9 +2358,11 @@ const ( PERF_MEM_LVLNUM_IO = 0xa PERF_MEM_LVLNUM_L1 = 0x1 PERF_MEM_LVLNUM_L2 = 0x2 + PERF_MEM_LVLNUM_L2_MHB = 0x5 PERF_MEM_LVLNUM_L3 = 0x3 PERF_MEM_LVLNUM_L4 = 0x4 PERF_MEM_LVLNUM_LFB = 0xc + PERF_MEM_LVLNUM_MSC = 0x6 PERF_MEM_LVLNUM_NA = 0xf PERF_MEM_LVLNUM_PMEM = 0xe PERF_MEM_LVLNUM_RAM = 0xd @@ -2417,6 +2435,7 @@ const ( PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 + PROCFS_IOCTL_MAGIC = 'f' PROC_SUPER_MAGIC = 0x9fa0 PROT_EXEC = 0x4 PROT_GROWSDOWN = 0x1000000 @@ -2498,6 +2517,23 @@ const ( PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c + PR_PPC_DEXCR_CTRL_CLEAR = 0x4 + PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 + PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 + PR_PPC_DEXCR_CTRL_MASK = 0x1f + PR_PPC_DEXCR_CTRL_SET = 0x2 + PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8 + PR_PPC_DEXCR_IBRTPD = 0x1 + PR_PPC_DEXCR_NPHIE = 0x3 + PR_PPC_DEXCR_SBHE = 0x0 + PR_PPC_DEXCR_SRAPD = 0x2 + PR_PPC_GET_DEXCR = 0x48 + PR_PPC_SET_DEXCR = 0x49 + PR_RISCV_CTX_SW_FENCEI_OFF = 0x1 + PR_RISCV_CTX_SW_FENCEI_ON = 0x0 + PR_RISCV_SCOPE_PER_PROCESS = 0x0 + PR_RISCV_SCOPE_PER_THREAD = 0x1 + PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47 PR_RISCV_V_GET_CONTROL = 0x46 PR_RISCV_V_SET_CONTROL = 0x45 PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3 @@ -2902,11 +2938,12 @@ const ( RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 + RWF_ATOMIC = 0x40 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x3f + RWF_SUPPORTED = 0x7f RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3179,6 +3216,7 @@ const ( STATX_ATTR_MOUNT_ROOT = 0x2000 STATX_ATTR_NODUMP = 0x40 STATX_ATTR_VERITY = 0x100000 + STATX_ATTR_WRITE_ATOMIC = 0x400000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -3192,8 +3230,10 @@ const ( STATX_MTIME = 0x40 STATX_NLINK = 0x4 STATX_SIZE = 0x200 + STATX_SUBVOL = 0x8000 STATX_TYPE = 0x1 STATX_UID = 0x8 + STATX_WRITE_ATOMIC = 0x10000 STATX__RESERVED = 0x80000000 SYNC_FILE_RANGE_WAIT_AFTER = 0x4 SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 @@ -3592,6 +3632,7 @@ const ( XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 XDP_UMEM_PGOFF_FILL_RING = 0x100000000 XDP_UMEM_REG = 0x4 + XDP_UMEM_TX_METADATA_LEN = 0x4 XDP_UMEM_TX_SW_CSUM = 0x2 XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1 XDP_USE_NEED_WAKEUP = 0x8 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index e4bc0bd..8aa6d77 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -151,9 +153,14 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 689317a..da428f4 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -151,9 +153,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 5cca668..bf45bfe 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 1427050..71c6716 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 ESR_MAGIC = 0x45535201 EXTPROC = 0x10000 @@ -152,9 +154,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 28e39af..9476628 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -152,9 +154,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index cd66e92..b9e85f3 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index c1595eb..a48b68a 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index ee9456b..ea00e85 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 8cfca81..91c6468 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 60b0deb..8cbf38d 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -150,9 +152,14 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index f90aa72..a2df734 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -150,9 +152,14 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index ba9e015..2479137 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -150,9 +152,14 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 07cdfd6..d265f14 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 2f1dd21..3f2d644 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -148,9 +150,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/source/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index f40519d..5d8b727 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -82,6 +82,8 @@ const ( EFD_CLOEXEC = 0x400000 EFD_NONBLOCK = 0x4000 EMT_TAGOVF = 0x1 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x400000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -153,9 +155,14 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 + NS_GET_PID_FROM_PIDNS = 0x4004b706 + NS_GET_PID_IN_PIDNS = 0x4004b708 + NS_GET_TGID_FROM_PIDNS = 0x4004b707 + NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 diff --git a/source/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/source/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go index da08b2a..1ec2b14 100644 --- a/source/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/source/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -581,6 +581,8 @@ const ( AT_EMPTY_PATH = 0x1000 AT_REMOVEDIR = 0x200 RENAME_NOREPLACE = 1 << 0 + ST_RDONLY = 1 + ST_NOSUID = 2 ) const ( diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 07642c3..24b346e 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -793,6 +841,26 @@ var libc_pthread_fchdir_np_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { + var _p0 unsafe.Pointer + if len(iov) > 0 { + _p0 = unsafe.Pointer(&iov[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_connectx_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index 923e08c..ebd2131 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 @@ -238,6 +248,11 @@ TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) +TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_connectx(SB) +GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 +DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 7d73dda..824b9c2 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -793,6 +841,26 @@ var libc_pthread_fchdir_np_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { + var _p0 unsafe.Pointer + if len(iov) > 0 { + _p0 = unsafe.Pointer(&iov[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_connectx_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 0577001..4f178a2 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 @@ -238,6 +248,11 @@ TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) +TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_connectx(SB) +GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 +DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/source/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 87d8612..af30da5 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -971,23 +971,6 @@ func Getpriority(which int, who int) (prio int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getrandom(buf []byte, flags int) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { @@ -2229,3 +2212,19 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mseal(b []byte, flags uint) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 9dc4241..1851df1 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 41b5617..0b43c69 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 0d3a075..e1ec0db 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 4019a65..880c6d6 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index c39f777..7c8452a 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index ac4af24..b8ef95b 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 57571d0..2ffdf86 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index f77d532..2af3b5c 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index e62963e..1da08d5 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index fae140b..b7a2513 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 0083135..6e85b0a 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 9d1e0ff..f15dadf 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -555,6 +555,12 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_mount(SB) + RET +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_nanosleep(SB) RET diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 79029ed..28b487d 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index da115f9..1e7f321 100644 --- a/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/source/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 53aef5d..524b082 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -457,4 +457,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 71d5247..f485dbf 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -341,6 +341,7 @@ const ( SYS_STATX = 332 SYS_IO_PGETEVENTS = 333 SYS_RSEQ = 334 + SYS_URETPROBE = 335 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 @@ -379,4 +380,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index c747706..70b35bf 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -421,4 +421,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index f96e214..1893e2f 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -85,7 +85,7 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 - SYS_FSTATAT = 79 + SYS_NEWFSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 @@ -324,4 +324,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 2842534..16a4017 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -84,6 +84,8 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 + SYS_NEWFSTATAT = 79 + SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 SYS_FDATASYNC = 83 @@ -318,4 +320,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index d095301..7e567f1 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -441,4 +441,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 295c7f4..38ae55e 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -371,4 +371,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index d1a9eac..55e92e6 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -371,4 +371,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index bec157c..60658d6 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -441,4 +441,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 7ee7bdc..e203e8a 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -448,4 +448,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index fad1f25..5944b97 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -420,4 +420,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 7d3e163..c66d416 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -420,4 +420,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 0ed53ad..a5459e7 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -84,7 +84,7 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 - SYS_FSTATAT = 79 + SYS_NEWFSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 @@ -325,4 +325,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 2fba04a..01d8682 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -386,4 +386,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 621d00d..7b703e7 100644 --- a/source/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/source/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -399,4 +399,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/source/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 091d107..d003c3d 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -306,6 +306,19 @@ type XVSockPgen struct { type _Socklen uint32 +type SaeAssocID uint32 + +type SaeConnID uint32 + +type SaEndpoints struct { + Srcif uint32 + Srcaddr *RawSockaddr + Srcaddrlen uint32 + Dstaddr *RawSockaddr + Dstaddrlen uint32 + _ [4]byte +} + type Xucred struct { Version uint32 Uid uint32 diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/source/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index 28ff4ef..0d45a94 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -306,6 +306,19 @@ type XVSockPgen struct { type _Socklen uint32 +type SaeAssocID uint32 + +type SaeConnID uint32 + +type SaEndpoints struct { + Srcif uint32 + Srcaddr *RawSockaddr + Srcaddrlen uint32 + Dstaddr *RawSockaddr + Dstaddrlen uint32 + _ [4]byte +} + type Xucred struct { Version uint32 Uid uint32 diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 6cbd094..51e13eb 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -625,6 +625,7 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 + POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index 7c03b6e..d002d8e 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -630,6 +630,7 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 + POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index 422107e..3f863d8 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -616,6 +616,7 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 + POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index 505a12a..61c7293 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -610,6 +610,7 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 + POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go index cc986c7..b5d1741 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go @@ -612,6 +612,7 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 + POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_linux.go b/source/vendor/golang.org/x/sys/unix/ztypes_linux.go index 4740b83..3a69e45 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -87,30 +87,35 @@ type StatxTimestamp struct { } type Statx_t struct { - Mask uint32 - Blksize uint32 - Attributes uint64 - Nlink uint32 - Uid uint32 - Gid uint32 - Mode uint16 - _ [1]uint16 - Ino uint64 - Size uint64 - Blocks uint64 - Attributes_mask uint64 - Atime StatxTimestamp - Btime StatxTimestamp - Ctime StatxTimestamp - Mtime StatxTimestamp - Rdev_major uint32 - Rdev_minor uint32 - Dev_major uint32 - Dev_minor uint32 - Mnt_id uint64 - Dio_mem_align uint32 - Dio_offset_align uint32 - _ [12]uint64 + Mask uint32 + Blksize uint32 + Attributes uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Mode uint16 + _ [1]uint16 + Ino uint64 + Size uint64 + Blocks uint64 + Attributes_mask uint64 + Atime StatxTimestamp + Btime StatxTimestamp + Ctime StatxTimestamp + Mtime StatxTimestamp + Rdev_major uint32 + Rdev_minor uint32 + Dev_major uint32 + Dev_minor uint32 + Mnt_id uint64 + Dio_mem_align uint32 + Dio_offset_align uint32 + Subvol uint64 + Atomic_write_unit_min uint32 + Atomic_write_unit_max uint32 + Atomic_write_segments_max uint32 + _ [1]uint32 + _ [9]uint64 } type Fsid struct { @@ -515,6 +520,29 @@ type TCPInfo struct { Total_rto_time uint32 } +type TCPVegasInfo struct { + Enabled uint32 + Rttcnt uint32 + Rtt uint32 + Minrtt uint32 +} + +type TCPDCTCPInfo struct { + Enabled uint16 + Ce_state uint16 + Alpha uint32 + Ab_ecn uint32 + Ab_tot uint32 +} + +type TCPBBRInfo struct { + Bw_lo uint32 + Bw_hi uint32 + Min_rtt uint32 + Pacing_gain uint32 + Cwnd_gain uint32 +} + type CanFilter struct { Id uint32 Mask uint32 @@ -556,6 +584,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0xf8 + SizeofTCPCCInfo = 0x14 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 ) @@ -2485,7 +2514,7 @@ type XDPMmapOffsets struct { type XDPUmemReg struct { Addr uint64 Len uint64 - Chunk_size uint32 + Size uint32 Headroom uint32 Flags uint32 Tx_metadata_len uint32 @@ -3473,7 +3502,7 @@ const ( DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6 ) type FsverityDigest struct { @@ -3765,7 +3794,7 @@ const ( ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 - ETHTOOL_MSG_USER_MAX = 0x2b + ETHTOOL_MSG_USER_MAX = 0x2c ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3805,7 +3834,10 @@ const ( ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 - ETHTOOL_MSG_KERNEL_MAX = 0x2b + ETHTOOL_MSG_KERNEL_MAX = 0x2c + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 @@ -3947,7 +3979,7 @@ const ( ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX = 0x18 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX = 0x19 - ETHTOOL_A_COALESCE_MAX = 0x1c + ETHTOOL_A_COALESCE_MAX = 0x1e ETHTOOL_A_PAUSE_UNSPEC = 0x0 ETHTOOL_A_PAUSE_HEADER = 0x1 ETHTOOL_A_PAUSE_AUTONEG = 0x2 @@ -3975,7 +4007,7 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x5 + ETHTOOL_A_TSINFO_MAX = 0x6 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4605,7 +4637,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14a + NL80211_ATTR_MAX = 0x14c NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -5209,7 +5241,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x20 + NL80211_FREQUENCY_ATTR_MAX = 0x21 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc diff --git a/source/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/source/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 15adc04..ad05b51 100644 --- a/source/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/source/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -727,6 +727,37 @@ const ( RISCV_HWPROBE_EXT_ZBA = 0x8 RISCV_HWPROBE_EXT_ZBB = 0x10 RISCV_HWPROBE_EXT_ZBS = 0x20 + RISCV_HWPROBE_EXT_ZICBOZ = 0x40 + RISCV_HWPROBE_EXT_ZBC = 0x80 + RISCV_HWPROBE_EXT_ZBKB = 0x100 + RISCV_HWPROBE_EXT_ZBKC = 0x200 + RISCV_HWPROBE_EXT_ZBKX = 0x400 + RISCV_HWPROBE_EXT_ZKND = 0x800 + RISCV_HWPROBE_EXT_ZKNE = 0x1000 + RISCV_HWPROBE_EXT_ZKNH = 0x2000 + RISCV_HWPROBE_EXT_ZKSED = 0x4000 + RISCV_HWPROBE_EXT_ZKSH = 0x8000 + RISCV_HWPROBE_EXT_ZKT = 0x10000 + RISCV_HWPROBE_EXT_ZVBB = 0x20000 + RISCV_HWPROBE_EXT_ZVBC = 0x40000 + RISCV_HWPROBE_EXT_ZVKB = 0x80000 + RISCV_HWPROBE_EXT_ZVKG = 0x100000 + RISCV_HWPROBE_EXT_ZVKNED = 0x200000 + RISCV_HWPROBE_EXT_ZVKNHA = 0x400000 + RISCV_HWPROBE_EXT_ZVKNHB = 0x800000 + RISCV_HWPROBE_EXT_ZVKSED = 0x1000000 + RISCV_HWPROBE_EXT_ZVKSH = 0x2000000 + RISCV_HWPROBE_EXT_ZVKT = 0x4000000 + RISCV_HWPROBE_EXT_ZFH = 0x8000000 + RISCV_HWPROBE_EXT_ZFHMIN = 0x10000000 + RISCV_HWPROBE_EXT_ZIHINTNTL = 0x20000000 + RISCV_HWPROBE_EXT_ZVFH = 0x40000000 + RISCV_HWPROBE_EXT_ZVFHMIN = 0x80000000 + RISCV_HWPROBE_EXT_ZFA = 0x100000000 + RISCV_HWPROBE_EXT_ZTSO = 0x200000000 + RISCV_HWPROBE_EXT_ZACAS = 0x400000000 + RISCV_HWPROBE_EXT_ZICOND = 0x800000000 + RISCV_HWPROBE_EXT_ZIHINTPAUSE = 0x1000000000 RISCV_HWPROBE_KEY_CPUPERF_0 = 0x5 RISCV_HWPROBE_MISALIGNED_UNKNOWN = 0x0 RISCV_HWPROBE_MISALIGNED_EMULATED = 0x1 @@ -734,4 +765,6 @@ const ( RISCV_HWPROBE_MISALIGNED_FAST = 0x3 RISCV_HWPROBE_MISALIGNED_UNSUPPORTED = 0x4 RISCV_HWPROBE_MISALIGNED_MASK = 0x7 + RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6 + RISCV_HWPROBE_WHICH_CPUS = 0x1 ) diff --git a/source/vendor/golang.org/x/sys/windows/dll_windows.go b/source/vendor/golang.org/x/sys/windows/dll_windows.go index 115341f..4e613cf 100644 --- a/source/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/source/vendor/golang.org/x/sys/windows/dll_windows.go @@ -65,7 +65,7 @@ func LoadDLL(name string) (dll *DLL, err error) { return d, nil } -// MustLoadDLL is like LoadDLL but panics if load operation failes. +// MustLoadDLL is like LoadDLL but panics if load operation fails. func MustLoadDLL(name string) *DLL { d, e := LoadDLL(name) if e != nil { diff --git a/source/vendor/golang.org/x/sys/windows/security_windows.go b/source/vendor/golang.org/x/sys/windows/security_windows.go index 97651b5..b6e1ab7 100644 --- a/source/vendor/golang.org/x/sys/windows/security_windows.go +++ b/source/vendor/golang.org/x/sys/windows/security_windows.go @@ -1179,7 +1179,7 @@ type OBJECTS_AND_NAME struct { //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW -//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) = advapi32.GetAce +//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { diff --git a/source/vendor/golang.org/x/sys/windows/syscall_windows.go b/source/vendor/golang.org/x/sys/windows/syscall_windows.go index 6525c62..5cee9a3 100644 --- a/source/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/source/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -17,8 +17,10 @@ import ( "unsafe" ) -type Handle uintptr -type HWND uintptr +type ( + Handle uintptr + HWND uintptr +) const ( InvalidHandle = ^Handle(0) @@ -211,6 +213,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId +//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW +//sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout +//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout +//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx //sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow //sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW //sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx @@ -307,6 +313,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode //sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo //sys setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition +//sys GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP +//sys GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP +//sys SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP +//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP //sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW //sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW //sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole @@ -1368,9 +1378,11 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } + func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } + func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } diff --git a/source/vendor/golang.org/x/sys/windows/types_windows.go b/source/vendor/golang.org/x/sys/windows/types_windows.go index d8cb71d..7b97a15 100644 --- a/source/vendor/golang.org/x/sys/windows/types_windows.go +++ b/source/vendor/golang.org/x/sys/windows/types_windows.go @@ -1060,6 +1060,7 @@ const ( SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6 SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4 SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12 + SIO_UDP_NETRESET = IOC_IN | IOC_VENDOR | 15 // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460 @@ -2003,7 +2004,21 @@ const ( MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 ) -const GAA_FLAG_INCLUDE_PREFIX = 0x00000010 +// Flags for GetAdaptersAddresses, see +// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses. +const ( + GAA_FLAG_SKIP_UNICAST = 0x1 + GAA_FLAG_SKIP_ANYCAST = 0x2 + GAA_FLAG_SKIP_MULTICAST = 0x4 + GAA_FLAG_SKIP_DNS_SERVER = 0x8 + GAA_FLAG_INCLUDE_PREFIX = 0x10 + GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20 + GAA_FLAG_INCLUDE_WINS_INFO = 0x40 + GAA_FLAG_INCLUDE_GATEWAYS = 0x80 + GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100 + GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200 + GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400 +) const ( IF_TYPE_OTHER = 1 @@ -2017,6 +2032,50 @@ const ( IF_TYPE_IEEE1394 = 144 ) +// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin +const ( + IpPrefixOriginOther = 0 + IpPrefixOriginManual = 1 + IpPrefixOriginWellKnown = 2 + IpPrefixOriginDhcp = 3 + IpPrefixOriginRouterAdvertisement = 4 + IpPrefixOriginUnchanged = 1 << 4 +) + +// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin +const ( + NlsoOther = 0 + NlsoManual = 1 + NlsoWellKnown = 2 + NlsoDhcp = 3 + NlsoLinkLayerAddress = 4 + NlsoRandom = 5 + IpSuffixOriginOther = 0 + IpSuffixOriginManual = 1 + IpSuffixOriginWellKnown = 2 + IpSuffixOriginDhcp = 3 + IpSuffixOriginLinkLayerAddress = 4 + IpSuffixOriginRandom = 5 + IpSuffixOriginUnchanged = 1 << 4 +) + +// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state +const ( + NldsInvalid = 0 + NldsTentative = 1 + NldsDuplicate = 2 + NldsDeprecated = 3 + NldsPreferred = 4 + IpDadStateInvalid = 0 + IpDadStateTentative = 1 + IpDadStateDuplicate = 2 + IpDadStateDeprecated = 3 + IpDadStatePreferred = 4 +) + type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 @@ -3404,3 +3463,14 @@ type DCB struct { EvtChar byte wReserved1 uint16 } + +// Keyboard Layout Flags. +// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw +const ( + KLF_ACTIVATE = 0x00000001 + KLF_SUBSTITUTE_OK = 0x00000002 + KLF_REORDER = 0x00000008 + KLF_REPLACELANG = 0x00000010 + KLF_NOTELLSHELL = 0x00000080 + KLF_SETFORPROCESS = 0x00000100 +) diff --git a/source/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/source/vendor/golang.org/x/sys/windows/zsyscall_windows.go index eba7610..4c2e1bd 100644 --- a/source/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/source/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -247,7 +247,9 @@ var ( procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") + procGetConsoleCP = modkernel32.NewProc("GetConsoleCP") procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") + procGetConsoleOutputCP = modkernel32.NewProc("GetConsoleOutputCP") procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo") procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") @@ -347,8 +349,10 @@ var ( procSetCommMask = modkernel32.NewProc("SetCommMask") procSetCommState = modkernel32.NewProc("SetCommState") procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") + procSetConsoleCP = modkernel32.NewProc("SetConsoleCP") procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") + procSetConsoleOutputCP = modkernel32.NewProc("SetConsoleOutputCP") procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") @@ -478,12 +482,16 @@ var ( procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") + procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") procGetShellWindow = moduser32.NewProc("GetShellWindow") procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") procIsWindow = moduser32.NewProc("IsWindow") procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") procIsWindowVisible = moduser32.NewProc("IsWindowVisible") + procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") procMessageBoxW = moduser32.NewProc("MessageBoxW") + procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") + procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") @@ -789,6 +797,14 @@ func FreeSid(sid *SID) (err error) { return } +func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { + r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetLengthSid(sid *SID) (len uint32) { r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) len = uint32(r0) @@ -1225,14 +1241,6 @@ func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCE return } -func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) { - r0, _, _ := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) - if r0 == 0 { - ret = GetLastError() - } - return -} - func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { @@ -2158,6 +2166,15 @@ func GetComputerName(buf *uint16, n *uint32) (err error) { return } +func GetConsoleCP() (cp uint32, err error) { + r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) + cp = uint32(r0) + if cp == 0 { + err = errnoErr(e1) + } + return +} + func GetConsoleMode(console Handle, mode *uint32) (err error) { r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0) if r1 == 0 { @@ -2166,6 +2183,15 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) { return } +func GetConsoleOutputCP() (cp uint32, err error) { + r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0) + cp = uint32(r0) + if cp == 0 { + err = errnoErr(e1) + } + return +} + func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0) if r1 == 0 { @@ -3034,6 +3060,14 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { return } +func SetConsoleCP(cp uint32) (err error) { + r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func setConsoleCursorPosition(console Handle, position uint32) (err error) { r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0) if r1 == 0 { @@ -3050,6 +3084,14 @@ func SetConsoleMode(console Handle, mode uint32) (err error) { return } +func SetConsoleOutputCP(cp uint32) (err error) { + r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetCurrentDirectory(path *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) if r1 == 0 { @@ -4082,6 +4124,12 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { return } +func GetKeyboardLayout(tid uint32) (hkl Handle) { + r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) + hkl = Handle(r0) + return +} + func GetShellWindow() (shellWindow HWND) { r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) shellWindow = HWND(r0) @@ -4115,6 +4163,15 @@ func IsWindowVisible(hwnd HWND) (isVisible bool) { return } +func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { + r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) + hkl = Handle(r0) + if hkl == 0 { + err = errnoErr(e1) + } + return +} + func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) ret = int32(r0) @@ -4124,6 +4181,20 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i return } +func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { + r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) + ret = int32(r0) + return +} + +func UnloadKeyboardLayout(hkl Handle) (err error) { + r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { var _p0 uint32 if inheritExisting { diff --git a/source/vendor/modules.txt b/source/vendor/modules.txt index 9ecbc2c..f3fa8cb 100644 --- a/source/vendor/modules.txt +++ b/source/vendor/modules.txt @@ -4,13 +4,13 @@ github.com/andybalholm/cascadia # github.com/aymanbagabas/go-osc52/v2 v2.0.1 ## explicit; go 1.16 github.com/aymanbagabas/go-osc52/v2 -# github.com/charmbracelet/lipgloss v0.11.0 +# github.com/charmbracelet/lipgloss v1.0.0 ## explicit; go 1.18 github.com/charmbracelet/lipgloss # github.com/charmbracelet/log v0.4.0 ## explicit; go 1.19 github.com/charmbracelet/log -# github.com/charmbracelet/x/ansi v0.1.2 +# github.com/charmbracelet/x/ansi v0.4.5 ## explicit; go 1.18 github.com/charmbracelet/x/ansi github.com/charmbracelet/x/ansi/parser @@ -25,7 +25,7 @@ github.com/lucasb-eyer/go-colorful # github.com/mattn/go-isatty v0.0.20 ## explicit; go 1.15 github.com/mattn/go-isatty -# github.com/mattn/go-runewidth v0.0.15 +# github.com/mattn/go-runewidth v0.0.16 ## explicit; go 1.9 github.com/mattn/go-runewidth # github.com/muesli/termenv v0.15.2 @@ -34,7 +34,7 @@ github.com/muesli/termenv # github.com/rivo/uniseg v0.4.7 ## explicit; go 1.18 github.com/rivo/uniseg -# github.com/tdewolff/parse/v2 v2.7.15 +# github.com/tdewolff/parse/v2 v2.7.19 ## explicit; go 1.13 github.com/tdewolff/parse/v2 github.com/tdewolff/parse/v2/buffer @@ -42,34 +42,37 @@ github.com/tdewolff/parse/v2/css # github.com/volker-schukai/tokenizer v1.0.0 ## explicit; go 1.13 github.com/volker-schukai/tokenizer -# gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.2 -## explicit; go 1.19 +# gitlab.schukai.com/oss/libraries/go/application/xflags v1.16.3 +## explicit; go 1.22 gitlab.schukai.com/oss/libraries/go/application/xflags -# gitlab.schukai.com/oss/libraries/go/markup/html v0.4.2 -## explicit; go 1.21 +# gitlab.schukai.com/oss/libraries/go/markup/html v0.4.6 +## explicit; go 1.22 gitlab.schukai.com/oss/libraries/go/markup/html/engine -# gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.0 -## explicit; go 1.19 +# gitlab.schukai.com/oss/libraries/go/utilities/data.git v0.2.2 +## explicit; go 1.22 gitlab.schukai.com/oss/libraries/go/utilities/data.git -# gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.2 -## explicit; go 1.20 +# gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.4 +## explicit; go 1.21 gitlab.schukai.com/oss/libraries/go/utilities/pathfinder -# golang.org/x/crypto v0.25.0 +# gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git v0.9.5 +## explicit; go 1.21 +gitlab.schukai.com/oss/libraries/go/utilities/pathfinder.git +# golang.org/x/crypto v0.28.0 ## explicit; go 1.20 golang.org/x/crypto/bcrypt golang.org/x/crypto/blowfish -# golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 -## explicit; go 1.20 +# golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c +## explicit; go 1.22.0 golang.org/x/exp/constraints golang.org/x/exp/slices golang.org/x/exp/slog golang.org/x/exp/slog/internal golang.org/x/exp/slog/internal/buffer -# golang.org/x/net v0.27.0 +# golang.org/x/net v0.30.0 ## explicit; go 1.18 golang.org/x/net/html golang.org/x/net/html/atom -# golang.org/x/sys v0.22.0 +# golang.org/x/sys v0.26.0 ## explicit; go 1.18 golang.org/x/sys/unix golang.org/x/sys/windows -- GitLab