mirror of
https://github.com/docker/cli.git
synced 2026-11-13 08:13:40 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fc2dff9bc | ||
|
|
ca5a266c81 | ||
|
|
39f182cbaa | ||
|
|
0684ae0cc1 | ||
|
|
b7dc94c65f | ||
|
|
12566dd80d | ||
|
|
4167943209 | ||
|
|
9dcf8afb5d | ||
|
|
6fdced88c5 | ||
|
|
0a563b177a | ||
|
|
4a63305d74 | ||
|
|
87ff477cb6 | ||
|
|
101ffc09eb | ||
|
|
32ff1e7281 | ||
|
|
d146e672a6 | ||
|
|
ac976d9edb | ||
|
|
48baf6c322 | ||
|
|
47a06aa077 | ||
|
|
1bf3eb68ce | ||
|
|
60dffc9412 | ||
|
|
b0a6803f9b | ||
|
|
f90c2894a8 | ||
|
|
ed4de7d484 | ||
|
|
74b7f5cf27 | ||
|
|
824b68911b | ||
|
|
dbad17f16f | ||
|
|
eb8fab8023 | ||
|
|
7b322e4dc2 | ||
|
|
676ca0067b | ||
|
|
ab989d8316 | ||
|
|
d306b9d600 | ||
|
|
0ffb4c4e0b | ||
|
|
e914d34ac3 | ||
|
|
a6538bea40 | ||
|
|
441acb383d | ||
|
|
ed68c49095 |
@@ -1,34 +1,37 @@
|
|||||||
<!--
|
<!--
|
||||||
Make sure you've read and understood our contributing guidelines;
|
Please make sure you've read and understood our contributing guidelines;
|
||||||
https://github.com/docker/cli/blob/master/CONTRIBUTING.md
|
https://github.com/docker/cli/blob/master/CONTRIBUTING.md
|
||||||
|
|
||||||
** Make sure all your commits include a signature generated with `git commit -s` **
|
Make sure commits are signed off (`git commit -s`) with your real name.
|
||||||
|
|
||||||
If this is a bug fix, make sure your description includes "fixes #xxxx", or
|
If the PR relates to an existing issue or PR, mention it at the top:
|
||||||
"closes #xxxx"
|
|
||||||
|
|
||||||
Provide the following information:
|
- Fixes: https://github.com/docker/cli/issues/12345678
|
||||||
|
- Replaces: https://github.com/docker/cli/pull/12345678
|
||||||
|
- Follow up to: https://github.com/docker/cli/pull/12345678
|
||||||
|
- Related to: https://github.com/docker/cli/issues/12345678
|
||||||
-->
|
-->
|
||||||
|
|
||||||
**- What I did**
|
## Summary
|
||||||
|
|
||||||
**- How I did it**
|
## Release notes (optional)
|
||||||
|
|
||||||
**- How to verify it**
|
|
||||||
|
|
||||||
**- Human readable description for the release notes**
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Write a short (one line) summary that describes the changes in this
|
One-sentence user-facing release note.
|
||||||
pull request for inclusion in the changelog.
|
Leave empty if the change is not changelog-worthy.
|
||||||
It must be placed inside the below triple backticks section.
|
Use present tense and imperative tone.
|
||||||
|
|
||||||
NOTE: Only fill this section if changes introduced in this PR are user-facing.
|
Good:
|
||||||
The PR must have a relevant impact/ label.
|
- Fix a panic when running `docker top` on a non-running Windows container.
|
||||||
|
- Don't print warnings in `docker info` for broken symlinks in CLI plugin directories.
|
||||||
|
|
||||||
|
Bad:
|
||||||
|
- Refactor test TestFooWithBar
|
||||||
|
- Fixed a panic when running docker top
|
||||||
-->
|
-->
|
||||||
|
|
||||||
```markdown changelog
|
```markdown changelog
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**- A picture of a cute animal (not mandatory but encouraged)**
|
## A picture of a cute animal (not mandatory but encouraged)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.platforms.outputs.matrix }}
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
echo ${{ steps.platforms.outputs.matrix }}
|
echo ${{ steps.platforms.outputs.matrix }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
needs:
|
needs:
|
||||||
- prepare
|
- prepare
|
||||||
strategy:
|
strategy:
|
||||||
@@ -65,10 +65,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
set: |
|
set: |
|
||||||
@@ -126,7 +126,7 @@ jobs:
|
|||||||
connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
|
connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
|
||||||
|
|
||||||
prepare-plugins:
|
prepare-plugins:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.platforms.outputs.matrix }}
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
@@ -146,7 +146,7 @@ jobs:
|
|||||||
echo ${{ steps.platforms.outputs.matrix }}
|
echo ${{ steps.platforms.outputs.matrix }}
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
needs:
|
needs:
|
||||||
- prepare-plugins
|
- prepare-plugins
|
||||||
strategy:
|
strategy:
|
||||||
@@ -156,10 +156,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
|
||||||
with:
|
with:
|
||||||
targets: plugins-cross
|
targets: plugins-cross
|
||||||
set: |
|
set: |
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codeql:
|
codeql:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
DISABLE_WARN_OUTSIDE_CONTAINER: '1'
|
DISABLE_WARN_OUTSIDE_CONTAINER: '1'
|
||||||
@@ -68,14 +68,14 @@ jobs:
|
|||||||
cache: false
|
cache: false
|
||||||
-
|
-
|
||||||
name: Initialize CodeQL
|
name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
|
uses: github/codeql-action/init@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
-
|
-
|
||||||
name: Autobuild
|
name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
|
uses: github/codeql-action/autobuild@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0
|
||||||
-
|
-
|
||||||
name: Perform CodeQL Analysis
|
name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
|
uses: github/codeql-action/analyze@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0
|
||||||
with:
|
with:
|
||||||
category: "/language:go"
|
category: "/language:go"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
name: Update daemon.json
|
name: Update daemon.json
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f /etc/docker/daemon.json ]; then
|
if [ ! -f /etc/docker/daemon.json ]; then
|
||||||
# ubuntu 24.04 runners no longer have a default daemon.json present
|
# ubuntu runners no longer have a default daemon.json present
|
||||||
sudo mkdir -p /etc/docker/
|
sudo mkdir -p /etc/docker/
|
||||||
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
|
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
|
||||||
else
|
else
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
docker info
|
docker info
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
|
||||||
-
|
-
|
||||||
name: Run ${{ matrix.target }}
|
name: Run ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
TESTFLAGS: -coverprofile=/tmp/coverage/coverage.txt
|
TESTFLAGS: -coverprofile=/tmp/coverage/coverage.txt
|
||||||
-
|
-
|
||||||
name: Send to Codecov
|
name: Send to Codecov
|
||||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
||||||
with:
|
with:
|
||||||
files: ./build/coverage/coverage.txt
|
files: ./build/coverage/coverage.txt
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
review:
|
review:
|
||||||
uses: docker/docker-agent-action/.github/workflows/review-pr.yml@06e1767af06263c93d712449cbf859778d9392ee # v2.0.5
|
uses: docker/docker-agent-action/.github/workflows/review-pr.yml@3654ec391b070e247de2e2e3c1ff2519b6378b3a # v2.0.9
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # Read repository files and PR diffs
|
contents: read # Read repository files and PR diffs
|
||||||
pull-requests: write # Post review comments
|
pull-requests: write # Post review comments
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync-release-branch:
|
sync-release-branch:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
actions: write
|
actions: write
|
||||||
@@ -116,7 +116,7 @@ jobs:
|
|||||||
push-release-branch:
|
push-release-branch:
|
||||||
needs: sync-release-branch
|
needs: sync-release-branch
|
||||||
if: ${{ !inputs.dry_run && needs.sync-release-branch.outputs.has_changes == 'true' }}
|
if: ${{ !inputs.dry_run && needs.sync-release-branch.outputs.has_changes == 'true' }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
environment: docker-releases
|
environment: docker-releases
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
@@ -26,19 +26,19 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ctn:
|
ctn:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
|
||||||
with:
|
with:
|
||||||
targets: test-coverage
|
targets: test-coverage
|
||||||
-
|
-
|
||||||
name: Send to Codecov
|
name: Send to Codecov
|
||||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
||||||
with:
|
with:
|
||||||
files: ./build/coverage/coverage.txt
|
files: ./build/coverage/coverage.txt
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
@@ -82,7 +82,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
-
|
-
|
||||||
name: Send to Codecov
|
name: Send to Codecov
|
||||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
||||||
with:
|
with:
|
||||||
files: /tmp/coverage.txt
|
files: /tmp/coverage.txt
|
||||||
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
|
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-milestone:
|
validate-milestone:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Validate milestone matches VERSION
|
- name: Validate milestone matches VERSION
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-labels:
|
check-labels:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
timeout-minutes: 120 # guardrails timeout for the whole job
|
timeout-minutes: 120 # guardrails timeout for the whole job
|
||||||
steps:
|
steps:
|
||||||
- name: Missing `area/` label
|
- name: Missing `area/` label
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
run: exit 0
|
run: exit 0
|
||||||
|
|
||||||
check-changelog:
|
check-changelog:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
timeout-minutes: 120 # guardrails timeout for the whole job
|
timeout-minutes: 120 # guardrails timeout for the whole job
|
||||||
env:
|
env:
|
||||||
HAS_IMPACT_LABEL: ${{ contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') }}
|
HAS_IMPACT_LABEL: ${{ contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') }}
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
echo "$desc"
|
echo "$desc"
|
||||||
|
|
||||||
check-pr-branch:
|
check-pr-branch:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
timeout-minutes: 120 # guardrails timeout for the whole job
|
timeout-minutes: 120 # guardrails timeout for the whole job
|
||||||
env:
|
env:
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -38,13 +38,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Run
|
name: Run
|
||||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|
||||||
# check that the generated Markdown and the checked-in files match
|
# check that the generated Markdown and the checked-in files match
|
||||||
validate-md:
|
validate-md:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
@@ -66,7 +66,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
validate-make:
|
validate-make:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
make -f docker.Makefile ${{ matrix.target }}
|
make -f docker.Makefile ${{ matrix.target }}
|
||||||
|
|
||||||
validate-gocompat:
|
validate-gocompat:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
env:
|
env:
|
||||||
GOPATH: ${{ github.workspace }}
|
GOPATH: ${{ github.workspace }}
|
||||||
GO111MODULE: off
|
GO111MODULE: off
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ func TestNewHistoryCommandErrors(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNewHistoryCommandSuccess(t *testing.T) {
|
func TestNewHistoryCommandSuccess(t *testing.T) {
|
||||||
|
// Set to UTC timezone as timestamps in output are
|
||||||
|
// printed in the current timezone
|
||||||
|
local := time.Local
|
||||||
|
time.Local = time.UTC
|
||||||
|
t.Cleanup(func() {
|
||||||
|
time.Local = local
|
||||||
|
})
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
args []string
|
args []string
|
||||||
@@ -118,9 +126,6 @@ func TestNewHistoryCommandSuccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
// Set to UTC timezone as timestamps in output are
|
|
||||||
// printed in the current timezone
|
|
||||||
t.Setenv("TZ", "UTC")
|
|
||||||
cli := test.NewFakeCli(&fakeClient{imageHistoryFunc: tc.imageHistoryFunc})
|
cli := test.NewFakeCli(&fakeClient{imageHistoryFunc: tc.imageHistoryFunc})
|
||||||
cmd := newHistoryCommand(cli)
|
cmd := newHistoryCommand(cli)
|
||||||
cmd.SetOut(io.Discard)
|
cmd.SetOut(io.Discard)
|
||||||
|
|||||||
+12
-12
@@ -4,7 +4,7 @@ module github.com/docker/cli
|
|||||||
// There is no 'go.mod' file, as that would imply opting in for all the rules
|
// There is no 'go.mod' file, as that would imply opting in for all the rules
|
||||||
// around SemVer, which this repo cannot abide by as it uses CalVer.
|
// around SemVer, which this repo cannot abide by as it uses CalVer.
|
||||||
|
|
||||||
go 1.26
|
go 1.26.0
|
||||||
|
|
||||||
tool (
|
tool (
|
||||||
github.com/cpuguy83/go-md2man/v2 // for scripts/docs/generate-man.sh
|
github.com/cpuguy83/go-md2man/v2 // for scripts/docs/generate-man.sh
|
||||||
@@ -31,7 +31,7 @@ require (
|
|||||||
github.com/google/go-cmp v0.7.0
|
github.com/google/go-cmp v0.7.0
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/mattn/go-runewidth v0.0.28
|
github.com/mattn/go-runewidth v0.0.29
|
||||||
github.com/moby/go-archive v0.3.3
|
github.com/moby/go-archive v0.3.3
|
||||||
github.com/moby/moby/api v1.56.0
|
github.com/moby/moby/api v1.56.0
|
||||||
github.com/moby/moby/client v0.6.0
|
github.com/moby/moby/client v0.6.0
|
||||||
@@ -61,12 +61,12 @@ require (
|
|||||||
go.opentelemetry.io/otel/sdk/metric v1.46.0
|
go.opentelemetry.io/otel/sdk/metric v1.46.0
|
||||||
go.opentelemetry.io/otel/trace v1.46.0
|
go.opentelemetry.io/otel/trace v1.46.0
|
||||||
go.yaml.in/yaml/v3 v3.0.5
|
go.yaml.in/yaml/v3 v3.0.5
|
||||||
golang.org/x/sync v0.22.0
|
golang.org/x/sync v0.23.0
|
||||||
golang.org/x/sys v0.47.0
|
golang.org/x/sys v0.48.0
|
||||||
golang.org/x/term v0.45.0
|
golang.org/x/term v0.46.0
|
||||||
golang.org/x/text v0.41.0
|
golang.org/x/text v0.42.0
|
||||||
gotest.tools/v3 v3.5.2
|
gotest.tools/v3 v3.5.2
|
||||||
tags.cncf.io/container-device-interface v1.1.0
|
tags.cncf.io/container-device-interface v1.1.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -75,7 +75,7 @@ require (
|
|||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/clipperhouse/uax29/v2 v2.2.0 // indirect
|
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
||||||
github.com/docker/go-events v0.1.0 // indirect
|
github.com/docker/go-events v0.1.0 // indirect
|
||||||
github.com/docker/go-metrics v0.1.0 // indirect
|
github.com/docker/go-metrics v0.1.0 // indirect
|
||||||
@@ -90,7 +90,7 @@ require (
|
|||||||
github.com/klauspost/compress v1.19.2 // indirect
|
github.com/klauspost/compress v1.19.2 // indirect
|
||||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||||
github.com/moby/sys/user v0.4.1 // indirect
|
github.com/moby/sys/user v0.4.1 // indirect
|
||||||
github.com/moby/sys/userns v0.2.0 // indirect
|
github.com/moby/sys/userns v0.2.1 // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||||
github.com/prometheus/client_model v0.6.1 // indirect
|
github.com/prometheus/client_model v0.6.1 // indirect
|
||||||
@@ -101,9 +101,9 @@ require (
|
|||||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
|
||||||
golang.org/x/mod v0.40.0 // indirect
|
golang.org/x/mod v0.41.0 // indirect
|
||||||
golang.org/x/net v0.58.0 // indirect
|
golang.org/x/net v0.59.0 // indirect
|
||||||
golang.org/x/time v0.15.0 // indirect
|
golang.org/x/time v0.16.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 // indirect
|
||||||
google.golang.org/grpc v1.83.2 // indirect
|
google.golang.org/grpc v1.83.2 // indirect
|
||||||
|
|||||||
+22
-22
@@ -12,8 +12,8 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1x
|
|||||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY=
|
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
||||||
github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
||||||
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
|
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
|
||||||
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
|
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
|
||||||
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
|
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
|
||||||
@@ -82,8 +82,8 @@ github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi
|
|||||||
github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||||
github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU=
|
github.com/mattn/go-runewidth v0.0.29 h1:3oGF3R/S2N9DQ3ptftzVIvg2eicmojCzlwBEmqEPDfQ=
|
||||||
github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
|
github.com/mattn/go-runewidth v0.0.29/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
|
||||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||||
github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
|
github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
|
||||||
@@ -112,8 +112,8 @@ github.com/moby/sys/symlink v0.3.0 h1:GZX89mEZ9u53f97npBy4Rc3vJKj7JBDj/PN2I22GrN
|
|||||||
github.com/moby/sys/symlink v0.3.0/go.mod h1:3eNdhduHmYPcgsJtZXW1W4XUJdZGBIkttZ8xKqPUJq0=
|
github.com/moby/sys/symlink v0.3.0/go.mod h1:3eNdhduHmYPcgsJtZXW1W4XUJdZGBIkttZ8xKqPUJq0=
|
||||||
github.com/moby/sys/user v0.4.1 h1:RgjRlaDKi/Xmyrz4t8lyzXT6v2ooFeO/7xtchmhVWE0=
|
github.com/moby/sys/user v0.4.1 h1:RgjRlaDKi/Xmyrz4t8lyzXT6v2ooFeO/7xtchmhVWE0=
|
||||||
github.com/moby/sys/user v0.4.1/go.mod h1:E9QsW5WRe1kUAf7kW8hXKwu1uhsZEAdPLYHYSDudF4Y=
|
github.com/moby/sys/user v0.4.1/go.mod h1:E9QsW5WRe1kUAf7kW8hXKwu1uhsZEAdPLYHYSDudF4Y=
|
||||||
github.com/moby/sys/userns v0.2.0 h1:nEtDtp7NCV/6dutSklNe8FrENPwFdc4mXnZqC/JWgXM=
|
github.com/moby/sys/userns v0.2.1 h1:4OvdM7BcPkASbuouHsbW3aeMJSFlYDldBRnXVZhaRk8=
|
||||||
github.com/moby/sys/userns v0.2.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
|
github.com/moby/sys/userns v0.2.1/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
|
||||||
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
|
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
|
||||||
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
|
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
|
||||||
github.com/morikuni/aec v1.1.0 h1:vBBl0pUnvi/Je71dsRrhMBtreIqNMYErSAbEeb8jrXQ=
|
github.com/morikuni/aec v1.1.0 h1:vBBl0pUnvi/Je71dsRrhMBtreIqNMYErSAbEeb8jrXQ=
|
||||||
@@ -187,34 +187,34 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
|
|||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs=
|
golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c=
|
||||||
golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE=
|
golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
|
golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues=
|
||||||
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
|
golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
|
||||||
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
|
||||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||||
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
|
golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
|
||||||
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
|
golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
|
golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
|
||||||
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
|
golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
|
||||||
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
|
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
|
||||||
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
|
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
@@ -238,5 +238,5 @@ gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
|
|||||||
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
|
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
|
||||||
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
|
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
|
||||||
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
|
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
|
||||||
tags.cncf.io/container-device-interface v1.1.0 h1:RnxNhxF1JOu6CJUVpetTYvrXHdxw9j9jFYgZpI+anSY=
|
tags.cncf.io/container-device-interface v1.1.1 h1:YPwQz4xg8PlQ0yT/baR0BtLpTQROe4l6M1yuRgAu1vc=
|
||||||
tags.cncf.io/container-device-interface v1.1.0/go.mod h1:76Oj0Yqp9FwTx/pySDc8Bxjpg+VqXfDb50cKAXVJ34Q=
|
tags.cncf.io/container-device-interface v1.1.1/go.mod h1:S1PSJWYPD4Iom0/39mvr/VVFCfG0Yt14j20d0OYrY2M=
|
||||||
|
|||||||
+63
-25
@@ -1,32 +1,34 @@
|
|||||||
An implementation of grapheme cluster boundaries from [Unicode text segmentation](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) (UAX 29), for Unicode version 15.0.0.
|
An implementation of grapheme cluster boundaries from [Unicode text segmentation](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) (UAX 29), for Unicode 17.
|
||||||
|
|
||||||
|
[](https://pkg.go.dev/github.com/clipperhouse/uax29/v2/graphemes)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
```
|
```
|
||||||
go get "github.com/clipperhouse/uax29/v2/graphemes"
|
go get github.com/clipperhouse/uax29/v2/graphemes
|
||||||
```
|
```
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/clipperhouse/uax29/v2/graphemes"
|
import "github.com/clipperhouse/uax29/v2/graphemes"
|
||||||
|
|
||||||
text := "Hello, 世界. Nice dog! 👍🐶"
|
text := "Hello, 世界. Nice dog! 👍🐶"
|
||||||
|
g := graphemes.FromString(text)
|
||||||
|
|
||||||
tokens := graphemes.FromString(text)
|
for g.Next() { // Next() returns true until end of data
|
||||||
|
fmt.Println(g.Value()) // Do something with the current grapheme
|
||||||
for tokens.Next() { // Next() returns true until end of data
|
|
||||||
fmt.Println(tokens.Value()) // Do something with the current grapheme
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
[](https://pkg.go.dev/github.com/clipperhouse/uax29/v2/graphemes)
|
|
||||||
|
|
||||||
_A grapheme is a “single visible character”, which might be a simple as a single letter, or a complex emoji that consists of several Unicode code points._
|
_A grapheme is a “single visible character”, which might be a simple as a single letter, or a complex emoji that consists of several Unicode code points._
|
||||||
|
|
||||||
## Conformance
|
## Conformance
|
||||||
|
|
||||||
We use the Unicode [test suite](https://unicode.org/reports/tr41/tr41-26.html#Tests29). Status:
|
We use the Unicode [test suite](https://unicode.org/reports/tr41/tr41-36.html#Tests29).
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
## APIs
|
## APIs
|
||||||
|
|
||||||
@@ -34,11 +36,10 @@ We use the Unicode [test suite](https://unicode.org/reports/tr41/tr41-26.html#Te
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
text := "Hello, 世界. Nice dog! 👍🐶"
|
text := "Hello, 世界. Nice dog! 👍🐶"
|
||||||
|
g := graphemes.FromString(text)
|
||||||
|
|
||||||
tokens := graphemes.FromString(text)
|
for g.Next() { // Next() returns true until end of data
|
||||||
|
fmt.Println(g.Value()) // Do something with the current grapheme
|
||||||
for tokens.Next() { // Next() returns true until end of data
|
|
||||||
fmt.Println(tokens.Value()) // Do something with the current grapheme
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -47,15 +48,15 @@ for tokens.Next() { // Next() returns true until end of data
|
|||||||
`FromReader` embeds a [`bufio.Scanner`](https://pkg.go.dev/bufio#Scanner), so just use those methods.
|
`FromReader` embeds a [`bufio.Scanner`](https://pkg.go.dev/bufio#Scanner), so just use those methods.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
r := getYourReader() // from a file or network maybe
|
r := getYourReader() // from a file or network maybe
|
||||||
tokens := graphemes.FromReader(r)
|
g := graphemes.FromReader(r)
|
||||||
|
|
||||||
for tokens.Scan() { // Scan() returns true until error or EOF
|
for g.Scan() { // Scan() returns true until error or EOF
|
||||||
fmt.Println(tokens.Text()) // Do something with the current grapheme
|
fmt.Println(g.Text()) // Do something with the current grapheme
|
||||||
}
|
}
|
||||||
|
|
||||||
if tokens.Err() != nil { // Check the error
|
if g.Err() != nil { // Check the error
|
||||||
log.Fatal(tokens.Err())
|
log.Fatal(g.Err())
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -64,16 +65,53 @@ if tokens.Err() != nil { // Check the error
|
|||||||
```go
|
```go
|
||||||
b := []byte("Hello, 世界. Nice dog! 👍🐶")
|
b := []byte("Hello, 世界. Nice dog! 👍🐶")
|
||||||
|
|
||||||
tokens := graphemes.FromBytes(b)
|
g := graphemes.FromBytes(b)
|
||||||
|
|
||||||
for tokens.Next() { // Next() returns true until end of data
|
for g.Next() { // Next() returns true until end of data
|
||||||
fmt.Println(tokens.Value()) // Do something with the current grapheme
|
fmt.Println(g.Value()) // Do something with the current grapheme
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Performance
|
### ANSI escape sequences
|
||||||
|
|
||||||
On a Mac M2 laptop, we see around 200MB/s, or around 100 million graphemes per second. You should see ~constant memory, and no allocations.
|
By the UAX 29 specification, ANSI escape sequences are not grapheme clusters. To treat 7-bit ANSI escape sequences as a single cluster, set `AnsiEscapeSequences` to true.
|
||||||
|
|
||||||
|
```go
|
||||||
|
text := "Hello, \x1b[31mworld\x1b[0m!"
|
||||||
|
g := graphemes.FromString(text)
|
||||||
|
g.AnsiEscapeSequences = true
|
||||||
|
|
||||||
|
for g.Next() {
|
||||||
|
fmt.Println(g.Value())
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To also parse 8-bit C1 controls (non-UTF-8 bytes), set `AnsiEscapeSequences8Bit` to true.
|
||||||
|
|
||||||
|
```go
|
||||||
|
g.AnsiEscapeSequences = true // 7-bit forms (ESC ...)
|
||||||
|
g.AnsiEscapeSequences8Bit = true // 8-bit C1 forms (0x80-0x9F), not valid UTF-8
|
||||||
|
```
|
||||||
|
|
||||||
|
For ESC-initiated (7-bit) control strings, only 7-bit terminators are recognized.
|
||||||
|
For C1-initiated (8-bit) control strings, only C1 ST (`0x9C`) is recognized as ST.
|
||||||
|
|
||||||
|
We implement [ECMA-48](https://ecma-international.org/publications-and-standards/standards/ecma-48/) control codes in both 7-bit and 8-bit representations. 8-bit control codes are not UTF-8 encoded and are not valid UTF-8, caveat emptor.
|
||||||
|
|
||||||
|
### Benchmarks
|
||||||
|
|
||||||
|
```
|
||||||
|
goos: darwin
|
||||||
|
goarch: arm64
|
||||||
|
pkg: github.com/clipperhouse/uax29/graphemes/comparative
|
||||||
|
cpu: Apple M2
|
||||||
|
|
||||||
|
BenchmarkGraphemesMixed/clipperhouse/uax29-8 142635 ns/op 245.12 MB/s 0 B/op 0 allocs/op
|
||||||
|
BenchmarkGraphemesMixed/rivo/uniseg-8 2018284 ns/op 17.32 MB/s 0 B/op 0 allocs/op
|
||||||
|
|
||||||
|
BenchmarkGraphemesASCII/clipperhouse/uax29-8 8846 ns/op 508.73 MB/s 0 B/op 0 allocs/op
|
||||||
|
BenchmarkGraphemesASCII/rivo/uniseg-8 366760 ns/op 12.27 MB/s 0 B/op 0 allocs/op
|
||||||
|
```
|
||||||
|
|
||||||
### Invalid inputs
|
### Invalid inputs
|
||||||
|
|
||||||
|
|||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
package graphemes
|
||||||
|
|
||||||
|
// ansiEscapeLength returns the byte length of a valid 7-bit ANSI escape
|
||||||
|
// sequence at the start of data, or 0 if none.
|
||||||
|
//
|
||||||
|
// Recognized forms (ECMA-48 / ISO 6429):
|
||||||
|
// - CSI: ESC [ then parameter bytes (0x30-0x3F), intermediate (0x20-0x2F), final (0x40-0x7E)
|
||||||
|
// - OSC: ESC ] then payload until BEL (0x07), 7-bit ST (ESC \), CAN (0x18), or SUB (0x1A)
|
||||||
|
// - DCS, SOS, PM, APC: ESC P/X/^/_ then payload until 7-bit ST (ESC \), CAN, or SUB
|
||||||
|
// - Two-byte: ESC + Fe/Fs (0x40-0x7E excluding above), or Fp (0x30-0x3F), or nF (0x20-0x2F then final)
|
||||||
|
func ansiEscapeLength[T ~string | ~[]byte](data T) int {
|
||||||
|
n := len(data)
|
||||||
|
if n < 2 || data[0] != esc {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
b1 := data[1]
|
||||||
|
switch b1 {
|
||||||
|
case '[': // CSI
|
||||||
|
body := csiBodyLength(data[2:])
|
||||||
|
if body == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 2 + body
|
||||||
|
case ']': // OSC - allows BEL or 7-bit ST terminator
|
||||||
|
body := oscLength(data[2:])
|
||||||
|
if body < 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 2 + body
|
||||||
|
case 'P', 'X', '^', '_': // DCS, SOS, PM, APC
|
||||||
|
body := stSequenceLength(data[2:])
|
||||||
|
if body < 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 2 + body
|
||||||
|
}
|
||||||
|
|
||||||
|
if b1 >= 0x40 && b1 <= 0x7E {
|
||||||
|
// Fe/Fs two-byte; [ ] P X ^ _ handled above
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
if b1 >= 0x30 && b1 <= 0x3F {
|
||||||
|
// Fp (private) two-byte
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
if b1 >= 0x20 && b1 <= 0x2F {
|
||||||
|
// nF: intermediates then one final (0x30-0x7E)
|
||||||
|
i := 2
|
||||||
|
for i < n && data[i] >= 0x20 && data[i] <= 0x2F {
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
if i < n && data[i] >= 0x30 && data[i] <= 0x7E {
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// csiBodyLength returns the length of the CSI body (param/intermediate/final bytes).
|
||||||
|
// data is the slice after "ESC [".
|
||||||
|
// Per ECMA-48, the CSI body has the form:
|
||||||
|
//
|
||||||
|
// parameters (0x30–0x3F)*, intermediates (0x20–0x2F)*, final (0x40–0x7E)
|
||||||
|
//
|
||||||
|
// Once an intermediate byte is seen, subsequent parameter bytes are invalid.
|
||||||
|
func csiBodyLength[T ~string | ~[]byte](data T) int {
|
||||||
|
seenIntermediate := false
|
||||||
|
for i := 0; i < len(data); i++ {
|
||||||
|
b := data[i]
|
||||||
|
if b >= 0x30 && b <= 0x3F {
|
||||||
|
if seenIntermediate {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if b >= 0x20 && b <= 0x2F {
|
||||||
|
seenIntermediate = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if b >= 0x40 && b <= 0x7E {
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// oscLength returns the length of the OSC body.
|
||||||
|
// data is the slice after "ESC ]".
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - n >= 0: consumed body length (includes BEL/ST terminator when present)
|
||||||
|
// - -1: not terminated in the provided data
|
||||||
|
//
|
||||||
|
// OSC accepts BEL (0x07) or 7-bit ST (ESC \) as terminators by widespread convention.
|
||||||
|
// Per ECMA-48, CAN (0x18) and SUB (0x1A) cancel the control string; in that
|
||||||
|
// case they are not part of the OSC sequence length.
|
||||||
|
func oscLength[T ~string | ~[]byte](data T) int {
|
||||||
|
for i := 0; i < len(data); i++ {
|
||||||
|
b := data[i]
|
||||||
|
if b == bel {
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
if b == can || b == sub {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
if b == esc && i+1 < len(data) && data[i+1] == '\\' {
|
||||||
|
return i + 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// stSequenceLength returns the length of a control-string body.
|
||||||
|
// data is the slice after "ESC x".
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - n >= 0: consumed body length (includes ST terminator when present)
|
||||||
|
// - -1: not terminated in the provided data
|
||||||
|
//
|
||||||
|
// Used for DCS, SOS, PM, and APC, which per ECMA-48 terminate with ST.
|
||||||
|
// ST here is the 7-bit form (ESC \).
|
||||||
|
// CAN (0x18) and SUB (0x1A) cancel the control string; in that case they are
|
||||||
|
// not part of the sequence length.
|
||||||
|
func stSequenceLength[T ~string | ~[]byte](data T) int {
|
||||||
|
for i := 0; i < len(data); i++ {
|
||||||
|
if data[i] == can || data[i] == sub {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
if data[i] == esc && i+1 < len(data) && data[i+1] == '\\' {
|
||||||
|
return i + 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
package graphemes
|
||||||
|
|
||||||
|
// ansiEscapeLength8Bit returns the byte length of a valid 8-bit C1 ANSI
|
||||||
|
// sequence at the start of data, or 0 if none.
|
||||||
|
//
|
||||||
|
// Recognized forms (ECMA-48 / ISO 6429):
|
||||||
|
// - C1 CSI (0x9B) body as parameter/intermediate/final bytes
|
||||||
|
// - C1 OSC (0x9D) body terminated by BEL, C1 ST, CAN, or SUB
|
||||||
|
// - C1 DCS/SOS/PM/APC (0x90/0x98/0x9E/0x9F) body terminated by C1 ST, CAN, or SUB
|
||||||
|
// - Standalone C1 controls (0x80..0x9F not listed above): single byte
|
||||||
|
func ansiEscapeLength8Bit[T ~string | ~[]byte](data T) int {
|
||||||
|
if len(data) == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
switch data[0] {
|
||||||
|
case 0x9B: // C1 CSI
|
||||||
|
body := csiBodyLength(data[1:])
|
||||||
|
if body == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 1 + body
|
||||||
|
case 0x9D: // C1 OSC
|
||||||
|
body := oscLengthC1(data[1:])
|
||||||
|
if body < 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 1 + body
|
||||||
|
case 0x90, 0x98, 0x9E, 0x9F: // C1 DCS, SOS, PM, APC
|
||||||
|
body := stSequenceLengthC1(data[1:])
|
||||||
|
if body < 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 1 + body
|
||||||
|
default:
|
||||||
|
if data[0] >= 0x80 && data[0] <= 0x9F {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// oscLengthC1 returns the length of a C1 OSC body.
|
||||||
|
// data is the slice after the C1 OSC initiator (0x9D).
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// - n >= 0: consumed body length (includes BEL/ST terminator when present)
|
||||||
|
// - -1: not terminated in the provided data
|
||||||
|
//
|
||||||
|
// Terminators: BEL (0x07) or C1 ST (0x9C).
|
||||||
|
// CAN (0x18) and SUB (0x1A) cancel the control string.
|
||||||
|
func oscLengthC1[T ~string | ~[]byte](data T) int {
|
||||||
|
for i := 0; i < len(data); i++ {
|
||||||
|
b := data[i]
|
||||||
|
if b == bel || b == st {
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
if b == can || b == sub {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// stSequenceLengthC1 parses DCS/SOS/PM/APC bodies that terminate with C1 ST
|
||||||
|
// (0x9C), or are canceled by CAN/SUB.
|
||||||
|
func stSequenceLengthC1[T ~string | ~[]byte](data T) int {
|
||||||
|
for i := 0; i < len(data); i++ {
|
||||||
|
b := data[i]
|
||||||
|
if b == can || b == sub {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
if b == st {
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
+129
-13
@@ -1,9 +1,44 @@
|
|||||||
package graphemes
|
package graphemes
|
||||||
|
|
||||||
import "github.com/clipperhouse/uax29/v2/internal/iterators"
|
import "unicode/utf8"
|
||||||
|
|
||||||
type Iterator[T iterators.Stringish] struct {
|
// FromString returns an iterator for the grapheme clusters in the input string.
|
||||||
*iterators.Iterator[T]
|
// Iterate while Next() is true, and access the grapheme via Value().
|
||||||
|
func FromString(s string) *Iterator[string] {
|
||||||
|
return &Iterator[string]{
|
||||||
|
split: splitFuncString,
|
||||||
|
data: s,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FromBytes returns an iterator for the grapheme clusters in the input bytes.
|
||||||
|
// Iterate while Next() is true, and access the grapheme via Value().
|
||||||
|
func FromBytes(b []byte) *Iterator[[]byte] {
|
||||||
|
return &Iterator[[]byte]{
|
||||||
|
split: splitFuncBytes,
|
||||||
|
data: b,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterator is a generic iterator for grapheme clusters in strings or byte slices,
|
||||||
|
// with an ASCII hot path optimization.
|
||||||
|
type Iterator[T ~string | ~[]byte] struct {
|
||||||
|
split func(T, bool) (int, T, error)
|
||||||
|
data T
|
||||||
|
pos int
|
||||||
|
start int
|
||||||
|
// AnsiEscapeSequences treats 7-bit ANSI escape sequences (ECMA-48) as
|
||||||
|
// single grapheme clusters when true. The default is false.
|
||||||
|
//
|
||||||
|
// 8-bit controls are not enabled by this option. See [AnsiEscapeSequences8Bit].
|
||||||
|
AnsiEscapeSequences bool
|
||||||
|
// AnsiEscapeSequences8Bit treats 8-bit C1 ANSI escape sequences (ECMA-48) as single
|
||||||
|
// grapheme clusters when true. The default is false.
|
||||||
|
//
|
||||||
|
// 8-bit control bytes are not UTF-8 encoded, i.e. not valid UTF-8. If you
|
||||||
|
// choose this option, you are choosing to interpret non-UTF-8 data, caveat
|
||||||
|
// emptor.
|
||||||
|
AnsiEscapeSequences8Bit bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -11,18 +46,99 @@ var (
|
|||||||
splitFuncBytes = splitFunc[[]byte]
|
splitFuncBytes = splitFunc[[]byte]
|
||||||
)
|
)
|
||||||
|
|
||||||
// FromString returns an iterator for the grapheme clusters in the input string.
|
const (
|
||||||
// Iterate while Next() is true, and access the grapheme via Value().
|
esc = 0x1B
|
||||||
func FromString(s string) Iterator[string] {
|
cr = 0x0D
|
||||||
return Iterator[string]{
|
bel = 0x07
|
||||||
iterators.New(splitFuncString, s),
|
can = 0x18
|
||||||
|
sub = 0x1A
|
||||||
|
st = 0x9C
|
||||||
|
)
|
||||||
|
|
||||||
|
// Next advances the iterator to the next grapheme cluster.
|
||||||
|
// Returns false when there are no more grapheme clusters.
|
||||||
|
func (iter *Iterator[T]) Next() bool {
|
||||||
|
if iter.pos >= len(iter.data) {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
iter.start = iter.pos
|
||||||
|
|
||||||
|
b := iter.data[iter.pos]
|
||||||
|
if iter.AnsiEscapeSequences && b == esc {
|
||||||
|
if a := ansiEscapeLength(iter.data[iter.pos:]); a > 0 {
|
||||||
|
iter.pos += a
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if iter.AnsiEscapeSequences8Bit && b >= 0x80 && b <= 0x9F {
|
||||||
|
if a := ansiEscapeLength8Bit(iter.data[iter.pos:]); a > 0 {
|
||||||
|
iter.pos += a
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ASCII hot path: any ASCII is one grapheme when next byte is ASCII or end.
|
||||||
|
if b < utf8.RuneSelf && b != cr {
|
||||||
|
if iter.pos+1 >= len(iter.data) || iter.data[iter.pos+1] < utf8.RuneSelf {
|
||||||
|
iter.pos++
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to UAX29 grapheme parsing
|
||||||
|
remaining := iter.data[iter.pos:]
|
||||||
|
advance, _, err := iter.split(remaining, true)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if advance <= 0 {
|
||||||
|
panic("splitFunc returned a zero or negative advance")
|
||||||
|
}
|
||||||
|
iter.pos += advance
|
||||||
|
if iter.pos > len(iter.data) {
|
||||||
|
panic("splitFunc advanced beyond end of data")
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromBytes returns an iterator for the grapheme clusters in the input bytes.
|
// Value returns the current grapheme cluster.
|
||||||
// Iterate while Next() is true, and access the grapheme via Value().
|
func (iter *Iterator[T]) Value() T {
|
||||||
func FromBytes(b []byte) Iterator[[]byte] {
|
return iter.data[iter.start:iter.pos]
|
||||||
return Iterator[[]byte]{
|
}
|
||||||
iterators.New(splitFuncBytes, b),
|
|
||||||
|
// Start returns the byte position of the current grapheme in the original data.
|
||||||
|
func (iter *Iterator[T]) Start() int {
|
||||||
|
return iter.start
|
||||||
|
}
|
||||||
|
|
||||||
|
// End returns the byte position after the current grapheme in the original data.
|
||||||
|
func (iter *Iterator[T]) End() int {
|
||||||
|
return iter.pos
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset resets the iterator to the beginning of the data.
|
||||||
|
func (iter *Iterator[T]) Reset() {
|
||||||
|
iter.start = 0
|
||||||
|
iter.pos = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetText sets the data for the iterator to operate on, and resets all state.
|
||||||
|
func (iter *Iterator[T]) SetText(data T) {
|
||||||
|
iter.data = data
|
||||||
|
iter.start = 0
|
||||||
|
iter.pos = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// First returns the first grapheme cluster without advancing the iterator.
|
||||||
|
func (iter *Iterator[T]) First() T {
|
||||||
|
if len(iter.data) == 0 {
|
||||||
|
return iter.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use a copy to leverage Next()'s ASCII optimization
|
||||||
|
cp := *iter
|
||||||
|
cp.pos = 0
|
||||||
|
cp.start = 0
|
||||||
|
cp.Next()
|
||||||
|
return cp.Value()
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-8
@@ -2,8 +2,6 @@ package graphemes
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
|
||||||
"github.com/clipperhouse/uax29/v2/internal/iterators"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// is determines if lookup intersects propert(ies)
|
// is determines if lookup intersects propert(ies)
|
||||||
@@ -13,12 +11,22 @@ func (lookup property) is(properties property) bool {
|
|||||||
|
|
||||||
const _Ignore = _Extend
|
const _Ignore = _Extend
|
||||||
|
|
||||||
|
// incbState tracks state for GB9c rule (Indic conjunct clusters)
|
||||||
|
// Pattern: Consonant (Extend|Linker)* Linker (Extend|Linker)* × Consonant
|
||||||
|
type incbState int
|
||||||
|
|
||||||
|
const (
|
||||||
|
incbNone incbState = iota // initial/reset
|
||||||
|
incbConsonant // seen Consonant, awaiting Linker
|
||||||
|
incbLinker // seen Consonant and Linker (conjunct ready)
|
||||||
|
)
|
||||||
|
|
||||||
// SplitFunc is a bufio.SplitFunc implementation of Unicode grapheme cluster segmentation, for use with bufio.Scanner.
|
// SplitFunc is a bufio.SplitFunc implementation of Unicode grapheme cluster segmentation, for use with bufio.Scanner.
|
||||||
//
|
//
|
||||||
// See https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries.
|
// See https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries.
|
||||||
var SplitFunc bufio.SplitFunc = splitFunc[[]byte]
|
var SplitFunc bufio.SplitFunc = splitFunc[[]byte]
|
||||||
|
|
||||||
func splitFunc[T iterators.Stringish](data T, atEOF bool) (advance int, token T, err error) {
|
func splitFunc[T ~string | ~[]byte](data T, atEOF bool) (advance int, token T, err error) {
|
||||||
var empty T
|
var empty T
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
return 0, empty, nil
|
return 0, empty, nil
|
||||||
@@ -30,6 +38,9 @@ func splitFunc[T iterators.Stringish](data T, atEOF bool) (advance int, token T,
|
|||||||
var lastLastExIgnore property = 0 // "last one before that"
|
var lastLastExIgnore property = 0 // "last one before that"
|
||||||
var regionalIndicatorCount int
|
var regionalIndicatorCount int
|
||||||
|
|
||||||
|
// GB9c state: tracking Indic conjunct clusters
|
||||||
|
var incb incbState
|
||||||
|
|
||||||
// Rules are usually of the form Cat1 × Cat2; "current" refers to the first property
|
// Rules are usually of the form Cat1 × Cat2; "current" refers to the first property
|
||||||
// to the right of the ×, from which we look back or forward
|
// to the right of the ×, from which we look back or forward
|
||||||
|
|
||||||
@@ -76,6 +87,23 @@ func splitFunc[T iterators.Stringish](data T, atEOF bool) (advance int, token T,
|
|||||||
lastExIgnore = last
|
lastExIgnore = last
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update GB9c state based on what we just advanced past
|
||||||
|
if last.is(_InCBConsonant | _InCBLinker | _InCBExtend) {
|
||||||
|
switch {
|
||||||
|
case last.is(_InCBConsonant):
|
||||||
|
if incb != incbLinker {
|
||||||
|
incb = incbConsonant
|
||||||
|
}
|
||||||
|
case last.is(_InCBLinker):
|
||||||
|
if incb >= incbConsonant {
|
||||||
|
incb = incbLinker
|
||||||
|
}
|
||||||
|
// case last.is(_InCBExtend): stay in current state
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
incb = incbNone
|
||||||
|
}
|
||||||
|
|
||||||
current, w = lookup(data[pos:])
|
current, w = lookup(data[pos:])
|
||||||
if w == 0 {
|
if w == 0 {
|
||||||
if atEOF {
|
if atEOF {
|
||||||
@@ -141,11 +169,14 @@ func splitFunc[T iterators.Stringish](data T, atEOF bool) (advance int, token T,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// https://unicode.org/reports/tr29/#GB9c
|
// https://unicode.org/reports/tr29/#GB9c
|
||||||
// TODO(clipperhouse):
|
// Do not break within certain combinations with Indic_Conjunct_Break (InCB)=Linker.
|
||||||
// It appears to be added in Unicode 15.1.0:
|
if incb == incbLinker && current.is(_InCBConsonant) {
|
||||||
// https://unicode.org/versions/Unicode15.1.0/#Migration
|
// After matching the pattern, reset state to start tracking a new pattern
|
||||||
// This package currently supports Unicode 15.0.0, so
|
// The current Consonant becomes the start of the new pattern
|
||||||
// out of scope for now
|
incb = incbConsonant
|
||||||
|
pos += w
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// https://unicode.org/reports/tr29/#GB11
|
// https://unicode.org/reports/tr29/#GB11
|
||||||
if current.is(_ExtendedPictographic) && last.is(_ZWJ) && lastLastExIgnore.is(_ExtendedPictographic) {
|
if current.is(_ExtendedPictographic) && last.is(_ZWJ) && lastLastExIgnore.is(_ExtendedPictographic) {
|
||||||
|
|||||||
+1323
-1015
File diff suppressed because it is too large
Load Diff
-85
@@ -1,85 +0,0 @@
|
|||||||
package iterators
|
|
||||||
|
|
||||||
type Stringish interface {
|
|
||||||
[]byte | string
|
|
||||||
}
|
|
||||||
|
|
||||||
type SplitFunc[T Stringish] func(T, bool) (int, T, error)
|
|
||||||
|
|
||||||
// Iterator is a generic iterator for words that are either []byte or string.
|
|
||||||
// Iterate while Next() is true, and access the word via Value().
|
|
||||||
type Iterator[T Stringish] struct {
|
|
||||||
split SplitFunc[T]
|
|
||||||
data T
|
|
||||||
start int
|
|
||||||
pos int
|
|
||||||
}
|
|
||||||
|
|
||||||
// New creates a new Iterator for the given data and SplitFunc.
|
|
||||||
func New[T Stringish](split SplitFunc[T], data T) *Iterator[T] {
|
|
||||||
return &Iterator[T]{
|
|
||||||
split: split,
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetText sets the text for the iterator to operate on, and resets all state.
|
|
||||||
func (iter *Iterator[T]) SetText(data T) {
|
|
||||||
iter.data = data
|
|
||||||
iter.start = 0
|
|
||||||
iter.pos = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Split sets the SplitFunc for the Iterator.
|
|
||||||
func (iter *Iterator[T]) Split(split SplitFunc[T]) {
|
|
||||||
iter.split = split
|
|
||||||
}
|
|
||||||
|
|
||||||
// Next advances the iterator to the next token. It returns false when there
|
|
||||||
// are no remaining tokens or an error occurred.
|
|
||||||
func (iter *Iterator[T]) Next() bool {
|
|
||||||
if iter.pos == len(iter.data) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if iter.pos > len(iter.data) {
|
|
||||||
panic("SplitFunc advanced beyond the end of the data")
|
|
||||||
}
|
|
||||||
|
|
||||||
iter.start = iter.pos
|
|
||||||
|
|
||||||
advance, _, err := iter.split(iter.data[iter.pos:], true)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if advance <= 0 {
|
|
||||||
panic("SplitFunc returned a zero or negative advance")
|
|
||||||
}
|
|
||||||
|
|
||||||
iter.pos += advance
|
|
||||||
if iter.pos > len(iter.data) {
|
|
||||||
panic("SplitFunc advanced beyond the end of the data")
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Value returns the current token.
|
|
||||||
func (iter *Iterator[T]) Value() T {
|
|
||||||
return iter.data[iter.start:iter.pos]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start returns the byte position of the current token in the original data.
|
|
||||||
func (iter *Iterator[T]) Start() int {
|
|
||||||
return iter.start
|
|
||||||
}
|
|
||||||
|
|
||||||
// End returns the byte position after the current token in the original data.
|
|
||||||
func (iter *Iterator[T]) End() int {
|
|
||||||
return iter.pos
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset resets the iterator to the beginning of the data.
|
|
||||||
func (iter *Iterator[T]) Reset() {
|
|
||||||
iter.start = 0
|
|
||||||
iter.pos = 0
|
|
||||||
}
|
|
||||||
+18
-6
@@ -147,7 +147,6 @@ func handleEnv() {
|
|||||||
if DefaultCondition.EastAsianWidth != EastAsianWidth {
|
if DefaultCondition.EastAsianWidth != EastAsianWidth {
|
||||||
DefaultCondition.EastAsianWidth = EastAsianWidth
|
DefaultCondition.EastAsianWidth = EastAsianWidth
|
||||||
if len(DefaultCondition.combinedLut) > 0 {
|
if len(DefaultCondition.combinedLut) > 0 {
|
||||||
DefaultCondition.combinedLut = DefaultCondition.combinedLut[:0]
|
|
||||||
CreateLUT()
|
CreateLUT()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -355,7 +354,12 @@ var nonprint = table{
|
|||||||
|
|
||||||
// Condition have flag EastAsianWidth whether the current locale is CJK or not.
|
// Condition have flag EastAsianWidth whether the current locale is CJK or not.
|
||||||
type Condition struct {
|
type Condition struct {
|
||||||
combinedLut []byte
|
combinedLut []byte
|
||||||
|
// The flags combinedLut was built from, so that CreateLUT can tell a
|
||||||
|
// table that is still current from one that has to be rebuilt.
|
||||||
|
lutEastAsianWidth bool
|
||||||
|
lutStrictEmojiNeutral bool
|
||||||
|
|
||||||
EastAsianWidth bool
|
EastAsianWidth bool
|
||||||
StrictEmojiNeutral bool
|
StrictEmojiNeutral bool
|
||||||
|
|
||||||
@@ -421,6 +425,11 @@ func (c *Condition) CreateLUT() {
|
|||||||
const max = 0x110000
|
const max = 0x110000
|
||||||
lut := c.combinedLut
|
lut := c.combinedLut
|
||||||
if len(c.combinedLut) != 0 {
|
if len(c.combinedLut) != 0 {
|
||||||
|
if c.lutEastAsianWidth == c.EastAsianWidth && c.lutStrictEmojiNeutral == c.StrictEmojiNeutral {
|
||||||
|
// The table still matches the flags, so rebuilding it
|
||||||
|
// would produce the same bytes.
|
||||||
|
return
|
||||||
|
}
|
||||||
// Remove so we don't use it.
|
// Remove so we don't use it.
|
||||||
c.combinedLut = nil
|
c.combinedLut = nil
|
||||||
} else {
|
} else {
|
||||||
@@ -433,6 +442,8 @@ func (c *Condition) CreateLUT() {
|
|||||||
lut[i] = uint8(x0) | uint8(x1)<<4
|
lut[i] = uint8(x0) | uint8(x1)<<4
|
||||||
}
|
}
|
||||||
c.combinedLut = lut
|
c.combinedLut = lut
|
||||||
|
c.lutEastAsianWidth = c.EastAsianWidth
|
||||||
|
c.lutStrictEmojiNeutral = c.StrictEmojiNeutral
|
||||||
}
|
}
|
||||||
|
|
||||||
// graphemeWidth returns the width of a single grapheme cluster: the sum of
|
// graphemeWidth returns the width of a single grapheme cluster: the sum of
|
||||||
@@ -566,7 +577,9 @@ func (c *Condition) TruncatePrefix(s string, w int, prefix string) string {
|
|||||||
func (c *Condition) Wrap(s string, w int) string {
|
func (c *Condition) Wrap(s string, w int) string {
|
||||||
width := 0
|
width := 0
|
||||||
var out strings.Builder
|
var out strings.Builder
|
||||||
out.Grow(len(s) + len(s)/w + 1)
|
// max keeps the capacity hint from dividing by zero when w is 0; a
|
||||||
|
// non-positive width breaks before every rune, as it always has.
|
||||||
|
out.Grow(len(s) + len(s)/max(w, 1) + 1)
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
cw := c.RuneWidth(r)
|
cw := c.RuneWidth(r)
|
||||||
if r == '\n' {
|
if r == '\n' {
|
||||||
@@ -664,9 +677,8 @@ func FillRight(s string, w int) string {
|
|||||||
|
|
||||||
// CreateLUT will create an in-memory lookup table of 557055 bytes for faster operation.
|
// CreateLUT will create an in-memory lookup table of 557055 bytes for faster operation.
|
||||||
// This should not be called concurrently with other operations.
|
// This should not be called concurrently with other operations.
|
||||||
|
// If flags in DefaultCondition are changed, CreateLUT should be called again;
|
||||||
|
// a call that finds the table already current is a no-op.
|
||||||
func CreateLUT() {
|
func CreateLUT() {
|
||||||
if len(DefaultCondition.combinedLut) > 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
DefaultCondition.CreateLUT()
|
DefaultCondition.CreateLUT()
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-1
@@ -2,6 +2,7 @@ package userns
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -23,7 +24,16 @@ var inUserNS = sync.OnceValue(runningInUserNS)
|
|||||||
func runningInUserNS() bool {
|
func runningInUserNS() bool {
|
||||||
var st syscall.Stat_t
|
var st syscall.Stat_t
|
||||||
if err := syscall.Stat("/proc/self/ns/user", &st); err == nil {
|
if err := syscall.Stat("/proc/self/ns/user", &st); err == nil {
|
||||||
return st.Ino != procUserInitIno
|
// The kernel's initial user namespace inode is definitive when it
|
||||||
|
// matches. OpenVZ virtualizes namespace inode numbers, so a mismatch
|
||||||
|
// must fall back to uid_map-based detection there.
|
||||||
|
if st.Ino == procUserInitIno {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if runningInOpenVZ() {
|
||||||
|
return runningInUserNSFromUIDMap()
|
||||||
|
}
|
||||||
|
return true
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
// As long as /proc/self/ns/user exists, we are on a modern kernel.
|
// As long as /proc/self/ns/user exists, we are on a modern kernel.
|
||||||
// Other errors indicate an unexpected procfs state, where assuming the
|
// Other errors indicate an unexpected procfs state, where assuming the
|
||||||
@@ -35,6 +45,10 @@ func runningInUserNS() bool {
|
|||||||
// through procfs at /proc/self/ns/user.
|
// through procfs at /proc/self/ns/user.
|
||||||
// TODO: Remove this fallback once Linux kernels older than 3.8 are no
|
// TODO: Remove this fallback once Linux kernels older than 3.8 are no
|
||||||
// longer supported.
|
// longer supported.
|
||||||
|
return runningInUserNSFromUIDMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
func runningInUserNSFromUIDMap() bool {
|
||||||
file, err := os.Open("/proc/self/uid_map")
|
file, err := os.Open("/proc/self/uid_map")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// This kernel-provided file only exists if user namespaces are supported.
|
// This kernel-provided file only exists if user namespaces are supported.
|
||||||
@@ -69,3 +83,19 @@ func uidMapInUserNS(uidMap string) bool {
|
|||||||
initNS := a == 0 && b == 0 && c == 4294967295
|
initNS := a == 0 && b == 0 && c == 4294967295
|
||||||
return !initNS
|
return !initNS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// runningInOpenVZ reports whether the process is running inside an OpenVZ
|
||||||
|
// container.
|
||||||
|
//
|
||||||
|
// OpenVZ exposes /proc/vz both on the host and inside containers, while
|
||||||
|
// /proc/bc is only exposed on the host. This follows systemd's OpenVZ
|
||||||
|
// detection:
|
||||||
|
// https://github.com/systemd/systemd/blob/v261.2/src/basic/virt.c#L642-L653
|
||||||
|
func runningInOpenVZ() bool {
|
||||||
|
var st syscall.Stat_t
|
||||||
|
if err := syscall.Stat("/proc/vz", &st); err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
err := syscall.Stat("/proc/bc", &st)
|
||||||
|
return errors.Is(err, syscall.ENOENT)
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -1678,7 +1678,7 @@ func (f *File) AddTool(path string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveTool removes a tool directive with the given path.
|
// DropTool removes a tool directive with the given path.
|
||||||
// It does nothing if no such tool directive exists.
|
// It does nothing if no such tool directive exists.
|
||||||
func (f *File) DropTool(path string) error {
|
func (f *File) DropTool(path string) error {
|
||||||
for _, t := range f.Tool {
|
for _, t := range f.Tool {
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,7 @@ func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup cleans up the file f after any edit operations.
|
// Cleanup cleans up the file f after any edit operations.
|
||||||
// To avoid quadratic behavior, modifications like [WorkFile.DropRequire]
|
// To avoid quadratic behavior, modifications like [WorkFile.DropUse]
|
||||||
// clear the entry but do not remove it from the slice.
|
// clear the entry but do not remove it from the slice.
|
||||||
// Cleanup cleans out all the cleared entries.
|
// Cleanup cleans out all the cleared entries.
|
||||||
func (f *WorkFile) Cleanup() {
|
func (f *WorkFile) Cleanup() {
|
||||||
|
|||||||
+13
-1
@@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
package http2
|
package http2
|
||||||
|
|
||||||
import "strings"
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
// The HTTP protocols are defined in terms of ASCII, not Unicode. This file
|
// The HTTP protocols are defined in terms of ASCII, not Unicode. This file
|
||||||
// contains helper functions which may use Unicode-aware functions which would
|
// contains helper functions which may use Unicode-aware functions which would
|
||||||
@@ -43,6 +45,16 @@ func isASCIIPrint(s string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isASCII returns whether s is ASCII.
|
||||||
|
func isASCII(s string) bool {
|
||||||
|
for i := 0; i < len(s); i++ {
|
||||||
|
if s[i] > 0x7f {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// asciiToLower returns the lowercase version of s if s is ASCII and printable,
|
// asciiToLower returns the lowercase version of s if s is ASCII and printable,
|
||||||
// and whether or not it was.
|
// and whether or not it was.
|
||||||
func asciiToLower(s string) (lower string, ok bool) {
|
func asciiToLower(s string) (lower string, ok bool) {
|
||||||
|
|||||||
+1
-4
@@ -121,10 +121,7 @@ func (b *dataBuffer) Write(p []byte) (int, error) {
|
|||||||
// If the last chunk is empty, allocate a new chunk. Try to allocate
|
// If the last chunk is empty, allocate a new chunk. Try to allocate
|
||||||
// enough to fully copy p plus any additional bytes we expect to
|
// enough to fully copy p plus any additional bytes we expect to
|
||||||
// receive. However, this may allocate less than len(p).
|
// receive. However, this may allocate less than len(p).
|
||||||
want := int64(len(p))
|
want := max(int64(len(p)), b.expected)
|
||||||
if b.expected > want {
|
|
||||||
want = b.expected
|
|
||||||
}
|
|
||||||
chunk := b.lastChunkOrAlloc(want)
|
chunk := b.lastChunkOrAlloc(want)
|
||||||
n := copy(chunk[b.w:], p)
|
n := copy(chunk[b.w:], p)
|
||||||
p = p[n:]
|
p = p[n:]
|
||||||
|
|||||||
+47
@@ -25,6 +25,8 @@ import (
|
|||||||
//
|
//
|
||||||
// https://golang.org/pkg/net/http/#ResponseWriter
|
// https://golang.org/pkg/net/http/#ResponseWriter
|
||||||
// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
|
// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.TrailerPrefix] instead.
|
||||||
const TrailerPrefix = "Trailer:"
|
const TrailerPrefix = "Trailer:"
|
||||||
|
|
||||||
// Push errors.
|
// Push errors.
|
||||||
@@ -38,16 +40,22 @@ var (
|
|||||||
// The configuration conf may be nil.
|
// The configuration conf may be nil.
|
||||||
//
|
//
|
||||||
// ConfigureServer must be called before s begins serving.
|
// ConfigureServer must be called before s begins serving.
|
||||||
|
//
|
||||||
|
// Deprecated: Set [http.Server.Protocols] instead.
|
||||||
func ConfigureServer(s *http.Server, conf *Server) error {
|
func ConfigureServer(s *http.Server, conf *Server) error {
|
||||||
return configureServer(s, conf)
|
return configureServer(s, conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server is an HTTP/2 server.
|
// Server is an HTTP/2 server.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server] instead.
|
||||||
type Server struct {
|
type Server struct {
|
||||||
// MaxHandlers limits the number of http.Handler ServeHTTP goroutines
|
// MaxHandlers limits the number of http.Handler ServeHTTP goroutines
|
||||||
// which may run at a time over all connections.
|
// which may run at a time over all connections.
|
||||||
// Negative or zero no limit.
|
// Negative or zero no limit.
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
//
|
||||||
|
// Deprecated: This field has never had any effect.
|
||||||
MaxHandlers int
|
MaxHandlers int
|
||||||
|
|
||||||
// MaxConcurrentStreams optionally specifies the number of
|
// MaxConcurrentStreams optionally specifies the number of
|
||||||
@@ -56,6 +64,9 @@ type Server struct {
|
|||||||
// which may be active globally, which is MaxHandlers.
|
// which may be active globally, which is MaxHandlers.
|
||||||
// If zero, MaxConcurrentStreams defaults to at least 100, per
|
// If zero, MaxConcurrentStreams defaults to at least 100, per
|
||||||
// the HTTP/2 spec's recommendations.
|
// the HTTP/2 spec's recommendations.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxConcurrentStreams] instead.
|
||||||
MaxConcurrentStreams uint32
|
MaxConcurrentStreams uint32
|
||||||
|
|
||||||
// MaxDecoderHeaderTableSize optionally specifies the http2
|
// MaxDecoderHeaderTableSize optionally specifies the http2
|
||||||
@@ -63,44 +74,67 @@ type Server struct {
|
|||||||
// informs the remote endpoint of the maximum size of the header compression
|
// informs the remote endpoint of the maximum size of the header compression
|
||||||
// table used to decode header blocks, in octets. If zero, the default value
|
// table used to decode header blocks, in octets. If zero, the default value
|
||||||
// of 4096 is used.
|
// of 4096 is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxDecoderHeaderTableSize] instead.
|
||||||
MaxDecoderHeaderTableSize uint32
|
MaxDecoderHeaderTableSize uint32
|
||||||
|
|
||||||
// MaxEncoderHeaderTableSize optionally specifies an upper limit for the
|
// MaxEncoderHeaderTableSize optionally specifies an upper limit for the
|
||||||
// header compression table used for encoding request headers. Received
|
// header compression table used for encoding request headers. Received
|
||||||
// SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero,
|
// SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero,
|
||||||
// the default value of 4096 is used.
|
// the default value of 4096 is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxEncoderHeaderTableSize] instead.
|
||||||
MaxEncoderHeaderTableSize uint32
|
MaxEncoderHeaderTableSize uint32
|
||||||
|
|
||||||
// MaxReadFrameSize optionally specifies the largest frame
|
// MaxReadFrameSize optionally specifies the largest frame
|
||||||
// this server is willing to read. A valid value is between
|
// this server is willing to read. A valid value is between
|
||||||
// 16k and 16M, inclusive. If zero or otherwise invalid, a
|
// 16k and 16M, inclusive. If zero or otherwise invalid, a
|
||||||
// default value is used.
|
// default value is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxReadFrameSize] instead.
|
||||||
MaxReadFrameSize uint32
|
MaxReadFrameSize uint32
|
||||||
|
|
||||||
// PermitProhibitedCipherSuites, if true, permits the use of
|
// PermitProhibitedCipherSuites, if true, permits the use of
|
||||||
// cipher suites prohibited by the HTTP/2 spec.
|
// cipher suites prohibited by the HTTP/2 spec.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.PermitProhibitedCipherSuites] instead.
|
||||||
PermitProhibitedCipherSuites bool
|
PermitProhibitedCipherSuites bool
|
||||||
|
|
||||||
// IdleTimeout specifies how long until idle clients should be
|
// IdleTimeout specifies how long until idle clients should be
|
||||||
// closed with a GOAWAY frame. PING frames are not considered
|
// closed with a GOAWAY frame. PING frames are not considered
|
||||||
// activity for the purposes of IdleTimeout.
|
// activity for the purposes of IdleTimeout.
|
||||||
// If zero or negative, there is no timeout.
|
// If zero or negative, there is no timeout.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.IdleTimeout] instead.
|
||||||
IdleTimeout time.Duration
|
IdleTimeout time.Duration
|
||||||
|
|
||||||
// ReadIdleTimeout is the timeout after which a health check using a ping
|
// ReadIdleTimeout is the timeout after which a health check using a ping
|
||||||
// frame will be carried out if no frame is received on the connection.
|
// frame will be carried out if no frame is received on the connection.
|
||||||
// If zero, no health check is performed.
|
// If zero, no health check is performed.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.SendPingTimeout] instead.
|
||||||
ReadIdleTimeout time.Duration
|
ReadIdleTimeout time.Duration
|
||||||
|
|
||||||
// PingTimeout is the timeout after which the connection will be closed
|
// PingTimeout is the timeout after which the connection will be closed
|
||||||
// if a response to a ping is not received.
|
// if a response to a ping is not received.
|
||||||
// If zero, a default of 15 seconds is used.
|
// If zero, a default of 15 seconds is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.PingTimeout] instead.
|
||||||
PingTimeout time.Duration
|
PingTimeout time.Duration
|
||||||
|
|
||||||
// WriteByteTimeout is the timeout after which a connection will be
|
// WriteByteTimeout is the timeout after which a connection will be
|
||||||
// closed if no data can be written to it. The timeout begins when data is
|
// closed if no data can be written to it. The timeout begins when data is
|
||||||
// available to write, and is extended whenever any bytes are written.
|
// available to write, and is extended whenever any bytes are written.
|
||||||
// If zero or negative, there is no timeout.
|
// If zero or negative, there is no timeout.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.WriteByteTimeout] instead.
|
||||||
WriteByteTimeout time.Duration
|
WriteByteTimeout time.Duration
|
||||||
|
|
||||||
// MaxUploadBufferPerConnection is the size of the initial flow
|
// MaxUploadBufferPerConnection is the size of the initial flow
|
||||||
@@ -108,12 +142,18 @@ type Server struct {
|
|||||||
// allow this to be smaller than 65535 or larger than 2^32-1.
|
// allow this to be smaller than 65535 or larger than 2^32-1.
|
||||||
// If the value is outside this range, a default value will be
|
// If the value is outside this range, a default value will be
|
||||||
// used instead.
|
// used instead.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxReceiveBufferPerConnection] instead.
|
||||||
MaxUploadBufferPerConnection int32
|
MaxUploadBufferPerConnection int32
|
||||||
|
|
||||||
// MaxUploadBufferPerStream is the size of the initial flow control
|
// MaxUploadBufferPerStream is the size of the initial flow control
|
||||||
// window for each stream. The HTTP/2 spec does not allow this to
|
// window for each stream. The HTTP/2 spec does not allow this to
|
||||||
// be larger than 2^32-1. If the value is zero or larger than the
|
// be larger than 2^32-1. If the value is zero or larger than the
|
||||||
// maximum, a default value will be used instead.
|
// maximum, a default value will be used instead.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxReceiveBufferPerStream] instead.
|
||||||
MaxUploadBufferPerStream int32
|
MaxUploadBufferPerStream int32
|
||||||
|
|
||||||
// NewWriteScheduler constructs a write scheduler for a connection.
|
// NewWriteScheduler constructs a write scheduler for a connection.
|
||||||
@@ -126,6 +166,9 @@ type Server struct {
|
|||||||
// It's intended to increment a metric for monitoring, such
|
// It's intended to increment a metric for monitoring, such
|
||||||
// as an expvar or Prometheus metric.
|
// as an expvar or Prometheus metric.
|
||||||
// The errType consists of only ASCII word characters.
|
// The errType consists of only ASCII word characters.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.HTTP2] and
|
||||||
|
// [http.HTTP2Config.CountError] instead.
|
||||||
CountError func(errType string)
|
CountError func(errType string)
|
||||||
|
|
||||||
// Internal state. This is a pointer (rather than embedded directly)
|
// Internal state. This is a pointer (rather than embedded directly)
|
||||||
@@ -135,6 +178,8 @@ type Server struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ServeConnOpts are options for the Server.ServeConn method.
|
// ServeConnOpts are options for the Server.ServeConn method.
|
||||||
|
//
|
||||||
|
// Deprecated: ServeConnOpts is deprecated.
|
||||||
type ServeConnOpts struct {
|
type ServeConnOpts struct {
|
||||||
// Context is the base context to use.
|
// Context is the base context to use.
|
||||||
// If nil, context.Background is used.
|
// If nil, context.Background is used.
|
||||||
@@ -178,6 +223,8 @@ type ServeConnOpts struct {
|
|||||||
// implemented in terms of providing a suitably-behaving net.Conn.
|
// implemented in terms of providing a suitably-behaving net.Conn.
|
||||||
//
|
//
|
||||||
// The opts parameter is optional. If nil, default values are used.
|
// The opts parameter is optional. If nil, default values are used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Server.Serve] or [http.Server.ServeTLS] instead.
|
||||||
func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
|
func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
opts = &ServeConnOpts{}
|
opts = &ServeConnOpts{}
|
||||||
|
|||||||
+2
@@ -184,6 +184,8 @@ func (t *Transport) initConnPool() {
|
|||||||
|
|
||||||
// ClientConn is the state of a single HTTP/2 client connection to an
|
// ClientConn is the state of a single HTTP/2 client connection to an
|
||||||
// HTTP/2 server.
|
// HTTP/2 server.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.ClientConn] instead.
|
||||||
type ClientConn struct {
|
type ClientConn struct {
|
||||||
t *Transport
|
t *Transport
|
||||||
tconn net.Conn // usually *tls.Conn, except specialized impls
|
tconn net.Conn // usually *tls.Conn, except specialized impls
|
||||||
|
|||||||
+74
-5
@@ -24,6 +24,8 @@ import (
|
|||||||
// It returns an error if t1 has already been HTTP/2-enabled.
|
// It returns an error if t1 has already been HTTP/2-enabled.
|
||||||
//
|
//
|
||||||
// Use ConfigureTransports instead to configure the HTTP/2 Transport.
|
// Use ConfigureTransports instead to configure the HTTP/2 Transport.
|
||||||
|
//
|
||||||
|
// Deprecated: Set [http.Transport.Protocols] instead.
|
||||||
func ConfigureTransport(t1 *http.Transport) error {
|
func ConfigureTransport(t1 *http.Transport) error {
|
||||||
return configureTransport(t1)
|
return configureTransport(t1)
|
||||||
}
|
}
|
||||||
@@ -31,6 +33,8 @@ func ConfigureTransport(t1 *http.Transport) error {
|
|||||||
// ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2.
|
// ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2.
|
||||||
// It returns a new HTTP/2 Transport for further configuration.
|
// It returns a new HTTP/2 Transport for further configuration.
|
||||||
// It returns an error if t1 has already been HTTP/2-enabled.
|
// It returns an error if t1 has already been HTTP/2-enabled.
|
||||||
|
//
|
||||||
|
// Deprecated: Set [http.Transport.Protocols] instead.
|
||||||
func ConfigureTransports(t1 *http.Transport) (*Transport, error) {
|
func ConfigureTransports(t1 *http.Transport) (*Transport, error) {
|
||||||
return configureTransports(t1)
|
return configureTransports(t1)
|
||||||
}
|
}
|
||||||
@@ -39,6 +43,8 @@ func ConfigureTransports(t1 *http.Transport) (*Transport, error) {
|
|||||||
//
|
//
|
||||||
// A Transport internally caches connections to servers. It is safe
|
// A Transport internally caches connections to servers. It is safe
|
||||||
// for concurrent use by multiple goroutines.
|
// for concurrent use by multiple goroutines.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport] instead.
|
||||||
type Transport struct {
|
type Transport struct {
|
||||||
// DialTLSContext specifies an optional dial function with context for
|
// DialTLSContext specifies an optional dial function with context for
|
||||||
// creating TLS connections for requests.
|
// creating TLS connections for requests.
|
||||||
@@ -47,6 +53,8 @@ type Transport struct {
|
|||||||
//
|
//
|
||||||
// If the returned net.Conn has a ConnectionState method like tls.Conn,
|
// If the returned net.Conn has a ConnectionState method like tls.Conn,
|
||||||
// it will be used to set http.Response.TLS.
|
// it will be used to set http.Response.TLS.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.DialTLSContext] instead.
|
||||||
DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error)
|
DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error)
|
||||||
|
|
||||||
// DialTLS specifies an optional dial function for creating
|
// DialTLS specifies an optional dial function for creating
|
||||||
@@ -54,17 +62,21 @@ type Transport struct {
|
|||||||
//
|
//
|
||||||
// If DialTLSContext and DialTLS is nil, tls.Dial is used.
|
// If DialTLSContext and DialTLS is nil, tls.Dial is used.
|
||||||
//
|
//
|
||||||
// Deprecated: Use DialTLSContext instead, which allows the transport
|
// Deprecated: Use [http.Transport.DialTLSContext] instead.
|
||||||
// to cancel dials as soon as they are no longer needed.
|
|
||||||
// If both are set, DialTLSContext takes priority.
|
|
||||||
DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error)
|
DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error)
|
||||||
|
|
||||||
// TLSClientConfig specifies the TLS configuration to use with
|
// TLSClientConfig specifies the TLS configuration to use with
|
||||||
// tls.Client. If nil, the default configuration is used.
|
// tls.Client. If nil, the default configuration is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.TLSClientConfig] instead.
|
||||||
TLSClientConfig *tls.Config
|
TLSClientConfig *tls.Config
|
||||||
|
|
||||||
// ConnPool optionally specifies an alternate connection pool to use.
|
// ConnPool optionally specifies an alternate connection pool to use.
|
||||||
// If nil, the default is used.
|
// If nil, the default is used.
|
||||||
|
//
|
||||||
|
// Deprecated: To create a custom connection pool, implement
|
||||||
|
// [http.RoundTripper]. Use [http.Transport.NewClientConn]
|
||||||
|
// to create connections for the pool.
|
||||||
ConnPool ClientConnPool
|
ConnPool ClientConnPool
|
||||||
|
|
||||||
// DisableCompression, if true, prevents the Transport from
|
// DisableCompression, if true, prevents the Transport from
|
||||||
@@ -75,10 +87,14 @@ type Transport struct {
|
|||||||
// decoded in the Response.Body. However, if the user
|
// decoded in the Response.Body. However, if the user
|
||||||
// explicitly requested gzip it is not automatically
|
// explicitly requested gzip it is not automatically
|
||||||
// uncompressed.
|
// uncompressed.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.DisableCompression] instead.
|
||||||
DisableCompression bool
|
DisableCompression bool
|
||||||
|
|
||||||
// AllowHTTP, if true, permits HTTP/2 requests using the insecure,
|
// AllowHTTP, if true, permits HTTP/2 requests using the insecure,
|
||||||
// plain-text "http" scheme. Note that this does not enable h2c support.
|
// plain-text "http" scheme. Note that this does not enable h2c support.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.Protocols] instead.
|
||||||
AllowHTTP bool
|
AllowHTTP bool
|
||||||
|
|
||||||
// MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to
|
// MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to
|
||||||
@@ -88,6 +104,8 @@ type Transport struct {
|
|||||||
// want to advertise an unlimited value to the peer, Transport
|
// want to advertise an unlimited value to the peer, Transport
|
||||||
// interprets the highest possible value here (0xffffffff or 1<<32-1)
|
// interprets the highest possible value here (0xffffffff or 1<<32-1)
|
||||||
// to mean no limit.
|
// to mean no limit.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.MaxResponseHeaderBytes] instead.
|
||||||
MaxHeaderListSize uint32
|
MaxHeaderListSize uint32
|
||||||
|
|
||||||
// MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the
|
// MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the
|
||||||
@@ -97,6 +115,9 @@ type Transport struct {
|
|||||||
// according to the spec:
|
// according to the spec:
|
||||||
// https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2.
|
// https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2.
|
||||||
// Values are bounded in the range 16k to 16M.
|
// Values are bounded in the range 16k to 16M.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxReadFrameSize] instead.
|
||||||
MaxReadFrameSize uint32
|
MaxReadFrameSize uint32
|
||||||
|
|
||||||
// MaxDecoderHeaderTableSize optionally specifies the http2
|
// MaxDecoderHeaderTableSize optionally specifies the http2
|
||||||
@@ -104,12 +125,18 @@ type Transport struct {
|
|||||||
// informs the remote endpoint of the maximum size of the header compression
|
// informs the remote endpoint of the maximum size of the header compression
|
||||||
// table used to decode header blocks, in octets. If zero, the default value
|
// table used to decode header blocks, in octets. If zero, the default value
|
||||||
// of 4096 is used.
|
// of 4096 is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxDecoderHeaderTableSize] instead.
|
||||||
MaxDecoderHeaderTableSize uint32
|
MaxDecoderHeaderTableSize uint32
|
||||||
|
|
||||||
// MaxEncoderHeaderTableSize optionally specifies an upper limit for the
|
// MaxEncoderHeaderTableSize optionally specifies an upper limit for the
|
||||||
// header compression table used for encoding request headers. Received
|
// header compression table used for encoding request headers. Received
|
||||||
// SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero,
|
// SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero,
|
||||||
// the default value of 4096 is used.
|
// the default value of 4096 is used.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.MaxEncoderHeaderTableSize] instead.
|
||||||
MaxEncoderHeaderTableSize uint32
|
MaxEncoderHeaderTableSize uint32
|
||||||
|
|
||||||
// StrictMaxConcurrentStreams controls whether the server's
|
// StrictMaxConcurrentStreams controls whether the server's
|
||||||
@@ -120,12 +147,17 @@ type Transport struct {
|
|||||||
// server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as
|
// server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as
|
||||||
// a global limit and callers of RoundTrip block when needed,
|
// a global limit and callers of RoundTrip block when needed,
|
||||||
// waiting for their turn.
|
// waiting for their turn.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.StrictMaxConcurrentRequests] instead.
|
||||||
StrictMaxConcurrentStreams bool
|
StrictMaxConcurrentStreams bool
|
||||||
|
|
||||||
// IdleConnTimeout is the maximum amount of time an idle
|
// IdleConnTimeout is the maximum amount of time an idle
|
||||||
// (keep-alive) connection will remain idle before closing
|
// (keep-alive) connection will remain idle before closing
|
||||||
// itself.
|
// itself.
|
||||||
// Zero means no limit.
|
// Zero means no limit.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.IdleConnTimeout] instead.
|
||||||
IdleConnTimeout time.Duration
|
IdleConnTimeout time.Duration
|
||||||
|
|
||||||
// ReadIdleTimeout is the timeout after which a health check using ping
|
// ReadIdleTimeout is the timeout after which a health check using ping
|
||||||
@@ -134,22 +166,34 @@ type Transport struct {
|
|||||||
// there is no other traffic on the connection, the health check will
|
// there is no other traffic on the connection, the health check will
|
||||||
// be performed every ReadIdleTimeout interval.
|
// be performed every ReadIdleTimeout interval.
|
||||||
// If zero, no health check is performed.
|
// If zero, no health check is performed.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.SendPingTimeout] instead.
|
||||||
ReadIdleTimeout time.Duration
|
ReadIdleTimeout time.Duration
|
||||||
|
|
||||||
// PingTimeout is the timeout after which the connection will be closed
|
// PingTimeout is the timeout after which the connection will be closed
|
||||||
// if a response to Ping is not received.
|
// if a response to Ping is not received.
|
||||||
// Defaults to 15s.
|
// Defaults to 15s.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.PingTimeout] instead.
|
||||||
PingTimeout time.Duration
|
PingTimeout time.Duration
|
||||||
|
|
||||||
// WriteByteTimeout is the timeout after which the connection will be
|
// WriteByteTimeout is the timeout after which the connection will be
|
||||||
// closed no data can be written to it. The timeout begins when data is
|
// closed no data can be written to it. The timeout begins when data is
|
||||||
// available to write, and is extended whenever any bytes are written.
|
// available to write, and is extended whenever any bytes are written.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.WriteByteTimeout] instead.
|
||||||
WriteByteTimeout time.Duration
|
WriteByteTimeout time.Duration
|
||||||
|
|
||||||
// CountError, if non-nil, is called on HTTP/2 transport errors.
|
// CountError, if non-nil, is called on HTTP/2 transport errors.
|
||||||
// It's intended to increment a metric for monitoring, such
|
// It's intended to increment a metric for monitoring, such
|
||||||
// as an expvar or Prometheus metric.
|
// as an expvar or Prometheus metric.
|
||||||
// The errType consists of only ASCII word characters.
|
// The errType consists of only ASCII word characters.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.HTTP2] and
|
||||||
|
// [http.HTTP2Config.CountError] instead.
|
||||||
CountError func(errType string)
|
CountError func(errType string)
|
||||||
|
|
||||||
// Internal state, differs between wrapped and non-wrapped implementations.
|
// Internal state, differs between wrapped and non-wrapped implementations.
|
||||||
@@ -165,6 +209,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ClientConnPool manages a pool of HTTP/2 client connections.
|
// ClientConnPool manages a pool of HTTP/2 client connections.
|
||||||
|
//
|
||||||
|
// Deprecated: To create a custom connection pool, implement
|
||||||
|
// [http.RoundTripper]. Use [http.Transport.NewClientConn]
|
||||||
|
// to create connections for the pool.
|
||||||
type ClientConnPool interface {
|
type ClientConnPool interface {
|
||||||
// GetClientConn returns a specific HTTP/2 connection (usually
|
// GetClientConn returns a specific HTTP/2 connection (usually
|
||||||
// a TLS-TCP connection) to an HTTP/2 server. On success, the
|
// a TLS-TCP connection) to an HTTP/2 server. On success, the
|
||||||
@@ -177,6 +225,8 @@ type ClientConnPool interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ClientConnState describes the state of a ClientConn.
|
// ClientConnState describes the state of a ClientConn.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.ClientConn] instead.
|
||||||
type ClientConnState struct {
|
type ClientConnState struct {
|
||||||
// Closed is whether the connection is closed.
|
// Closed is whether the connection is closed.
|
||||||
Closed bool
|
Closed bool
|
||||||
@@ -210,6 +260,8 @@ type ClientConnState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RoundTripOpt are options for the Transport.RoundTripOpt method.
|
// RoundTripOpt are options for the Transport.RoundTripOpt method.
|
||||||
|
//
|
||||||
|
// Deprecated: There are no options to set.
|
||||||
type RoundTripOpt struct {
|
type RoundTripOpt struct {
|
||||||
// OnlyCachedConn controls whether RoundTripOpt may
|
// OnlyCachedConn controls whether RoundTripOpt may
|
||||||
// create a new TCP connection. If set true and
|
// create a new TCP connection. If set true and
|
||||||
@@ -222,11 +274,14 @@ type RoundTripOpt struct {
|
|||||||
allowHTTP bool // allow http:// URLs
|
allowHTTP bool // allow http:// URLs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use [http.Transport.RoundTrip] instead.
|
||||||
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
|
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||||
return t.RoundTripOpt(req, RoundTripOpt{})
|
return t.RoundTripOpt(req, RoundTripOpt{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// RoundTripOpt is like RoundTrip, but takes options.
|
// RoundTripOpt is like RoundTrip, but takes options.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.RoundTrip] instead.
|
||||||
func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) {
|
func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) {
|
||||||
return t.roundTripOpt(req, opt)
|
return t.roundTripOpt(req, opt)
|
||||||
}
|
}
|
||||||
@@ -234,10 +289,15 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
|
|||||||
// CloseIdleConnections closes any connections which were previously
|
// CloseIdleConnections closes any connections which were previously
|
||||||
// connected from previous requests but are now sitting idle.
|
// connected from previous requests but are now sitting idle.
|
||||||
// It does not interrupt any connections currently in use.
|
// It does not interrupt any connections currently in use.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.CloseIdleConnections] instead.
|
||||||
func (t *Transport) CloseIdleConnections() {
|
func (t *Transport) CloseIdleConnections() {
|
||||||
t.closeIdleConnections()
|
t.closeIdleConnections()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewClientConn is deprecated.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.Transport.NewClientConn] instead.
|
||||||
func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
|
func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
|
||||||
return t.newUserClientConn(c)
|
return t.newUserClientConn(c)
|
||||||
}
|
}
|
||||||
@@ -256,8 +316,15 @@ func authorityAddr(scheme string, authority string) (addr string) {
|
|||||||
port = "80"
|
port = "80"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if a, err := idna.ToASCII(host); err == nil {
|
// Skip IDNA processing on hosts which are already ASCII.
|
||||||
host = a
|
// This is consistent with net/http and the WHATWG URL Specification.
|
||||||
|
// (We currently don't follow all of WHATWG, but we're aligned on
|
||||||
|
// permitting all-ASCII hostnames which fail IDNA validation.
|
||||||
|
// There are existing, valid domain names which TR #46 processing rejects.)
|
||||||
|
if !isASCII(host) {
|
||||||
|
if a, err := idna.Lookup.ToASCII(host); err == nil && a != "" {
|
||||||
|
host = a
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// IPv6 address literal, without a port:
|
// IPv6 address literal, without a port:
|
||||||
if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") {
|
if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") {
|
||||||
@@ -414,6 +481,8 @@ func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string
|
|||||||
|
|
||||||
// GoAwayError is returned by the Transport when the server closes the
|
// GoAwayError is returned by the Transport when the server closes the
|
||||||
// TCP connection after sending a GOAWAY frame.
|
// TCP connection after sending a GOAWAY frame.
|
||||||
|
//
|
||||||
|
// Deprecated: GoAwayError is deprecated.
|
||||||
type GoAwayError struct {
|
type GoAwayError struct {
|
||||||
LastStreamID uint32
|
LastStreamID uint32
|
||||||
ErrCode ErrCode
|
ErrCode ErrCode
|
||||||
|
|||||||
+2
@@ -216,6 +216,8 @@ func (t *Transport) newUserClientConn(c net.Conn) (*ClientConn, error) {
|
|||||||
|
|
||||||
// ClientConn is the state of a single HTTP/2 client connection to an
|
// ClientConn is the state of a single HTTP/2 client connection to an
|
||||||
// HTTP/2 server.
|
// HTTP/2 server.
|
||||||
|
//
|
||||||
|
// Deprecated: Use [http.ClientConn] instead.
|
||||||
type ClientConn struct {
|
type ClientConn struct {
|
||||||
cc *http.ClientConn
|
cc *http.ClientConn
|
||||||
tconn net.Conn
|
tconn net.Conn
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
These two packages are identical:
|
||||||
|
|
||||||
|
- net/http/internal/httpcommon
|
||||||
|
- golang.org/x/net/internal/httpcommon
|
||||||
|
|
||||||
|
The two are kept in sync manually.
|
||||||
|
Any change to one should be made in the other.
|
||||||
+31
-3
@@ -391,6 +391,7 @@ type ServerRequestParam struct {
|
|||||||
// ServerRequestResult is the result of NewServerRequest.
|
// ServerRequestResult is the result of NewServerRequest.
|
||||||
type ServerRequestResult struct {
|
type ServerRequestResult struct {
|
||||||
// Various http.Request fields.
|
// Various http.Request fields.
|
||||||
|
Host string
|
||||||
URL *url.URL
|
URL *url.URL
|
||||||
RequestURI string
|
RequestURI string
|
||||||
Trailer map[string][]string
|
Trailer map[string][]string
|
||||||
@@ -433,20 +434,46 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult {
|
|||||||
}
|
}
|
||||||
delete(rp.Header, "Trailer")
|
delete(rp.Header, "Trailer")
|
||||||
|
|
||||||
|
authority := rp.Authority
|
||||||
|
if host := rp.Header["Host"]; len(host) == 1 {
|
||||||
|
// HTTP/2 and HTTP/3 permit the Host header to be present,
|
||||||
|
// but it must match the :authority pseudo-header.
|
||||||
|
if authority == "" {
|
||||||
|
authority = host[0]
|
||||||
|
} else if host[0] != authority {
|
||||||
|
return ServerRequestResult{
|
||||||
|
InvalidReason: "authority_host_mismatch",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete(rp.Header, "Host")
|
||||||
|
} else if len(host) > 1 {
|
||||||
|
// HTTP/1.1 rejects any request containing more than one Host header.
|
||||||
|
// HTTP/2 and HTTP/3 don't use the Host header, but reject multiple anyway.
|
||||||
|
return ServerRequestResult{
|
||||||
|
InvalidReason: "multiple_host_headers",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// "':authority' MUST NOT include the deprecated userinfo subcomponent
|
// "':authority' MUST NOT include the deprecated userinfo subcomponent
|
||||||
// for "http" or "https" schemed URIs."
|
// for "http" or "https" schemed URIs."
|
||||||
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8
|
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8
|
||||||
if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") {
|
if strings.IndexByte(authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") {
|
||||||
return ServerRequestResult{
|
return ServerRequestResult{
|
||||||
InvalidReason: "userinfo_in_authority",
|
InvalidReason: "userinfo_in_authority",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if authority != "" && !httpguts.ValidHostHeader(authority) {
|
||||||
|
return ServerRequestResult{
|
||||||
|
InvalidReason: "invalid_authority",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var url_ *url.URL
|
var url_ *url.URL
|
||||||
var requestURI string
|
var requestURI string
|
||||||
if rp.Method == "CONNECT" && rp.Protocol == "" {
|
if rp.Method == "CONNECT" && rp.Protocol == "" {
|
||||||
url_ = &url.URL{Host: rp.Authority}
|
url_ = &url.URL{Host: authority}
|
||||||
requestURI = rp.Authority // mimic HTTP/1 server behavior
|
requestURI = authority // mimic HTTP/1 server behavior
|
||||||
} else {
|
} else {
|
||||||
// "[The :path] pseudo-header field MUST NOT be empty [...]"
|
// "[The :path] pseudo-header field MUST NOT be empty [...]"
|
||||||
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.4.2
|
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.4.2
|
||||||
@@ -467,6 +494,7 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ServerRequestResult{
|
return ServerRequestResult{
|
||||||
|
Host: authority,
|
||||||
URL: url_,
|
URL: url_,
|
||||||
NeedsContinue: needsContinue,
|
NeedsContinue: needsContinue,
|
||||||
RequestURI: requestURI,
|
RequestURI: requestURI,
|
||||||
|
|||||||
+1
-4
@@ -70,10 +70,7 @@ func log2(i int64) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getBucket(i int64) (index int) {
|
func getBucket(i int64) (index int) {
|
||||||
index = log2(i) - 1
|
index = max(log2(i)-1, 0)
|
||||||
if index < 0 {
|
|
||||||
index = 0
|
|
||||||
}
|
|
||||||
if index >= bucketCount {
|
if index >= bucketCount {
|
||||||
index = bucketCount - 1
|
index = bucketCount - 1
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -22,7 +22,13 @@ import (
|
|||||||
// fields can be get and set using the following methods:
|
// fields can be get and set using the following methods:
|
||||||
// - Uint16/SetUint16: flags
|
// - Uint16/SetUint16: flags
|
||||||
// - Uint32/SetUint32: ifindex, metric, mtu
|
// - Uint32/SetUint32: ifindex, metric, mtu
|
||||||
type Ifreq struct{ raw ifreq }
|
type Ifreq struct {
|
||||||
|
// Aligns the union for the accessors below, which cast it in place;
|
||||||
|
// the generated ifreq is all byte arrays, so its alignment is one.
|
||||||
|
_ [0]int64
|
||||||
|
|
||||||
|
raw ifreq
|
||||||
|
}
|
||||||
|
|
||||||
// NewIfreq creates an Ifreq with the input network interface name after
|
// NewIfreq creates an Ifreq with the input network interface name after
|
||||||
// validating the name does not exceed IFNAMSIZ-1 (trailing NULL required)
|
// validating the name does not exceed IFNAMSIZ-1 (trailing NULL required)
|
||||||
|
|||||||
+7
@@ -332,3 +332,10 @@ func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
|
|||||||
func IoctlLoopConfigure(fd int, value *LoopConfig) error {
|
func IoctlLoopConfigure(fd int, value *LoopConfig) error {
|
||||||
return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value))
|
return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IoctlPidfdInfo fetches information about a pidfd.
|
||||||
|
// The Mask field of the info argument indicates which
|
||||||
|
// values to fetch.
|
||||||
|
func IoctlPidfdInfo(fd int, info *PidfdInfo) error {
|
||||||
|
return ioctlPtr(fd, PIDFD_GET_INFO, unsafe.Pointer(info))
|
||||||
|
}
|
||||||
|
|||||||
+1
-8
@@ -290,14 +290,7 @@ struct ltchars {
|
|||||||
#include <mtd/mtd-user.h>
|
#include <mtd/mtd-user.h>
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
|
|
||||||
#if defined(__sparc__)
|
|
||||||
// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the
|
|
||||||
// definition in glibc. As only the error constants are needed here, include the
|
|
||||||
// generic termibits.h (which is included by termbits.h on sparc).
|
|
||||||
#include <asm-generic/termbits.h>
|
|
||||||
#else
|
|
||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PTRACE_GETREGS
|
#ifndef PTRACE_GETREGS
|
||||||
#define PTRACE_GETREGS 0xc
|
#define PTRACE_GETREGS 0xc
|
||||||
@@ -544,7 +537,7 @@ ccflags="$@"
|
|||||||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
||||||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
||||||
$2 == "LOOP_CONFIGURE" ||
|
$2 == "LOOP_CONFIGURE" ||
|
||||||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
|
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|MLOCK|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
|
||||||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
||||||
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
||||||
$2 ~ /^PTP_/ ||
|
$2 ~ /^PTP_/ ||
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ func BytePtrToString(p *byte) string {
|
|||||||
// Find NUL terminator.
|
// Find NUL terminator.
|
||||||
n := 0
|
n := 0
|
||||||
for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ {
|
for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ {
|
||||||
ptr = unsafe.Pointer(uintptr(ptr) + 1)
|
ptr = unsafe.Add(ptr, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(unsafe.Slice(p, n))
|
return string(unsafe.Slice(p, n))
|
||||||
|
|||||||
+1
-1
@@ -188,7 +188,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
|||||||
}
|
}
|
||||||
sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL
|
sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL
|
||||||
sa.raw.Family = AF_UNIX
|
sa.raw.Family = AF_UNIX
|
||||||
for i := 0; i < n; i++ {
|
for i := range n {
|
||||||
sa.raw.Path[i] = int8(name[i])
|
sa.raw.Path[i] = int8(name[i])
|
||||||
}
|
}
|
||||||
return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil
|
return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil
|
||||||
|
|||||||
+1
-1
@@ -2363,7 +2363,7 @@ func (fh *FileHandle) Bytes() []byte {
|
|||||||
if n == 0 {
|
if n == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n)
|
return unsafe.Slice((*byte)(unsafe.Add(unsafe.Pointer(&fh.fileHandle.Type), 4)), n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NameToHandleAt wraps the name_to_handle_at system call; it obtains
|
// NameToHandleAt wraps the name_to_handle_at system call; it obtains
|
||||||
|
|||||||
+2
@@ -2048,6 +2048,7 @@ const (
|
|||||||
MINIX3_SUPER_MAGIC = 0x4d5a
|
MINIX3_SUPER_MAGIC = 0x4d5a
|
||||||
MINIX_SUPER_MAGIC = 0x137f
|
MINIX_SUPER_MAGIC = 0x137f
|
||||||
MINIX_SUPER_MAGIC2 = 0x138f
|
MINIX_SUPER_MAGIC2 = 0x138f
|
||||||
|
MLOCK_ONFAULT = 0x1
|
||||||
MNT_DETACH = 0x2
|
MNT_DETACH = 0x2
|
||||||
MNT_EXPIRE = 0x4
|
MNT_EXPIRE = 0x4
|
||||||
MNT_FORCE = 0x1
|
MNT_FORCE = 0x1
|
||||||
@@ -3862,6 +3863,7 @@ const (
|
|||||||
TIOCPKT_NOSTOP = 0x10
|
TIOCPKT_NOSTOP = 0x10
|
||||||
TIOCPKT_START = 0x8
|
TIOCPKT_START = 0x8
|
||||||
TIOCPKT_STOP = 0x4
|
TIOCPKT_STOP = 0x4
|
||||||
|
TIOCSER_TEMT = 0x1
|
||||||
TIPC_ADDR_ID = 0x3
|
TIPC_ADDR_ID = 0x3
|
||||||
TIPC_ADDR_MCAST = 0x1
|
TIPC_ADDR_MCAST = 0x1
|
||||||
TIPC_ADDR_NAME = 0x2
|
TIPC_ADDR_NAME = 0x2
|
||||||
|
|||||||
-1
@@ -483,7 +483,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -484,7 +484,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -489,7 +489,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -483,7 +483,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -476,7 +476,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -481,7 +481,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5489
|
TIOCSERGWILD = 0x5489
|
||||||
TIOCSERSETMULTI = 0x5490
|
TIOCSERSETMULTI = 0x5490
|
||||||
TIOCSERSWILD = 0x548a
|
TIOCSERSWILD = 0x548a
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x7401
|
TIOCSETD = 0x7401
|
||||||
TIOCSETN = 0x740a
|
TIOCSETN = 0x740a
|
||||||
TIOCSETP = 0x7409
|
TIOCSETP = 0x7409
|
||||||
|
|||||||
-1
@@ -481,7 +481,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5489
|
TIOCSERGWILD = 0x5489
|
||||||
TIOCSERSETMULTI = 0x5490
|
TIOCSERSETMULTI = 0x5490
|
||||||
TIOCSERSWILD = 0x548a
|
TIOCSERSWILD = 0x548a
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x7401
|
TIOCSETD = 0x7401
|
||||||
TIOCSETN = 0x740a
|
TIOCSETN = 0x740a
|
||||||
TIOCSETP = 0x7409
|
TIOCSETP = 0x7409
|
||||||
|
|||||||
-1
@@ -481,7 +481,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5489
|
TIOCSERGWILD = 0x5489
|
||||||
TIOCSERSETMULTI = 0x5490
|
TIOCSERSETMULTI = 0x5490
|
||||||
TIOCSERSWILD = 0x548a
|
TIOCSERSWILD = 0x548a
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x7401
|
TIOCSETD = 0x7401
|
||||||
TIOCSETN = 0x740a
|
TIOCSETN = 0x740a
|
||||||
TIOCSETP = 0x7409
|
TIOCSETP = 0x7409
|
||||||
|
|||||||
-1
@@ -481,7 +481,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5489
|
TIOCSERGWILD = 0x5489
|
||||||
TIOCSERSETMULTI = 0x5490
|
TIOCSERSETMULTI = 0x5490
|
||||||
TIOCSERSWILD = 0x548a
|
TIOCSERSWILD = 0x548a
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x7401
|
TIOCSETD = 0x7401
|
||||||
TIOCSETN = 0x740a
|
TIOCSETN = 0x740a
|
||||||
TIOCSETP = 0x7409
|
TIOCSETP = 0x7409
|
||||||
|
|||||||
-1
@@ -535,7 +535,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETC = 0x80067411
|
TIOCSETC = 0x80067411
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSETN = 0x8006740a
|
TIOCSETN = 0x8006740a
|
||||||
|
|||||||
-1
@@ -539,7 +539,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETC = 0x80067411
|
TIOCSETC = 0x80067411
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSETN = 0x8006740a
|
TIOCSETN = 0x8006740a
|
||||||
|
|||||||
-1
@@ -539,7 +539,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETC = 0x80067411
|
TIOCSETC = 0x80067411
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSETN = 0x8006740a
|
TIOCSETN = 0x8006740a
|
||||||
|
|||||||
-1
@@ -486,7 +486,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
-1
@@ -545,7 +545,6 @@ const (
|
|||||||
TIOCSERGWILD = 0x5454
|
TIOCSERGWILD = 0x5454
|
||||||
TIOCSERSETMULTI = 0x545b
|
TIOCSERSETMULTI = 0x545b
|
||||||
TIOCSERSWILD = 0x5455
|
TIOCSERSWILD = 0x5455
|
||||||
TIOCSER_TEMT = 0x1
|
|
||||||
TIOCSETD = 0x5423
|
TIOCSETD = 0x5423
|
||||||
TIOCSIG = 0x40045436
|
TIOCSIG = 0x40045436
|
||||||
TIOCSISO7816 = 0xc0285443
|
TIOCSISO7816 = 0xc0285443
|
||||||
|
|||||||
+20
-15
@@ -14,21 +14,21 @@ const (
|
|||||||
ASI_LEON_DFLUSH = 0x11
|
ASI_LEON_DFLUSH = 0x11
|
||||||
ASI_LEON_IFLUSH = 0x10
|
ASI_LEON_IFLUSH = 0x10
|
||||||
ASI_LEON_MMUFLUSH = 0x18
|
ASI_LEON_MMUFLUSH = 0x18
|
||||||
B1000000 = 0x1008
|
B1000000 = 0x100c
|
||||||
B115200 = 0x1002
|
B115200 = 0x1002
|
||||||
B1152000 = 0x1009
|
B1152000 = 0x100d
|
||||||
B1500000 = 0x100a
|
B1500000 = 0x100e
|
||||||
B2000000 = 0x100b
|
B153600 = 0x1006
|
||||||
|
B2000000 = 0x100f
|
||||||
B230400 = 0x1003
|
B230400 = 0x1003
|
||||||
B2500000 = 0x100c
|
B307200 = 0x1007
|
||||||
B3000000 = 0x100d
|
|
||||||
B3500000 = 0x100e
|
|
||||||
B4000000 = 0x100f
|
|
||||||
B460800 = 0x1004
|
B460800 = 0x1004
|
||||||
B500000 = 0x1005
|
B500000 = 0x100a
|
||||||
B57600 = 0x1001
|
B57600 = 0x1001
|
||||||
B576000 = 0x1006
|
B576000 = 0x100b
|
||||||
B921600 = 0x1007
|
B614400 = 0x1008
|
||||||
|
B76800 = 0x1005
|
||||||
|
B921600 = 0x1009
|
||||||
BLKALIGNOFF = 0x2000127a
|
BLKALIGNOFF = 0x2000127a
|
||||||
BLKBSZGET = 0x40081270
|
BLKBSZGET = 0x40081270
|
||||||
BLKBSZSET = 0x80081271
|
BLKBSZSET = 0x80081271
|
||||||
@@ -91,7 +91,7 @@ const (
|
|||||||
FFDLY = 0x8000
|
FFDLY = 0x8000
|
||||||
FICLONE = 0x80049409
|
FICLONE = 0x80049409
|
||||||
FICLONERANGE = 0x8020940d
|
FICLONERANGE = 0x8020940d
|
||||||
FLUSHO = 0x1000
|
FLUSHO = 0x2000
|
||||||
FS_IOC_ENABLE_VERITY = 0x80806685
|
FS_IOC_ENABLE_VERITY = 0x80806685
|
||||||
FS_IOC_GETFLAGS = 0x40086601
|
FS_IOC_GETFLAGS = 0x40086601
|
||||||
FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b
|
FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b
|
||||||
@@ -563,6 +563,9 @@ const (
|
|||||||
TIOCM_CD = 0x40
|
TIOCM_CD = 0x40
|
||||||
TIOCM_CTS = 0x20
|
TIOCM_CTS = 0x20
|
||||||
TIOCM_DSR = 0x100
|
TIOCM_DSR = 0x100
|
||||||
|
TIOCM_LOOP = 0x8000
|
||||||
|
TIOCM_OUT1 = 0x2000
|
||||||
|
TIOCM_OUT2 = 0x4000
|
||||||
TIOCM_RI = 0x80
|
TIOCM_RI = 0x80
|
||||||
TIOCM_RNG = 0x80
|
TIOCM_RNG = 0x80
|
||||||
TIOCM_SR = 0x10
|
TIOCM_SR = 0x10
|
||||||
@@ -641,10 +644,11 @@ const (
|
|||||||
UBI_IOCVOLRMBLK = 0x20004f08
|
UBI_IOCVOLRMBLK = 0x20004f08
|
||||||
UBI_IOCVOLUP = 0x80084f00
|
UBI_IOCVOLUP = 0x80084f00
|
||||||
VDISCARD = 0xd
|
VDISCARD = 0xd
|
||||||
|
VDSUSP = 0xb
|
||||||
VEOF = 0x4
|
VEOF = 0x4
|
||||||
VEOL = 0xb
|
VEOL = 0x5
|
||||||
VEOL2 = 0x10
|
VEOL2 = 0x6
|
||||||
VMIN = 0x6
|
VMIN = 0x4
|
||||||
VREPRINT = 0xc
|
VREPRINT = 0xc
|
||||||
VSTART = 0x8
|
VSTART = 0x8
|
||||||
VSTOP = 0x9
|
VSTOP = 0x9
|
||||||
@@ -664,6 +668,7 @@ const (
|
|||||||
WDIOC_KEEPALIVE = 0x40045705
|
WDIOC_KEEPALIVE = 0x40045705
|
||||||
WDIOC_SETOPTIONS = 0x40045704
|
WDIOC_SETOPTIONS = 0x40045704
|
||||||
WORDSIZE = 0x40
|
WORDSIZE = 0x40
|
||||||
|
WRAP = 0x20000
|
||||||
XCASE = 0x4
|
XCASE = 0x4
|
||||||
XTABS = 0x1800
|
XTABS = 0x1800
|
||||||
_HIDIOCGRAWNAME = 0x40804804
|
_HIDIOCGRAWNAME = 0x40804804
|
||||||
|
|||||||
+79
-7
@@ -4264,19 +4264,29 @@ type HwTstampConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HWTSTAMP_FILTER_NONE = 0x0
|
HWTSTAMP_FILTER_NONE = 0x0
|
||||||
HWTSTAMP_FILTER_ALL = 0x1
|
HWTSTAMP_FILTER_ALL = 0x1
|
||||||
HWTSTAMP_FILTER_SOME = 0x2
|
HWTSTAMP_FILTER_SOME = 0x2
|
||||||
HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3
|
HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3
|
||||||
HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6
|
HWTSTAMP_FILTER_PTP_V1_L4_SYNC = 0x4
|
||||||
HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9
|
HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ = 0x5
|
||||||
HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc
|
HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_L4_SYNC = 0x7
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ = 0x8
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_L2_SYNC = 0xa
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ = 0xb
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_SYNC = 0xd
|
||||||
|
HWTSTAMP_FILTER_PTP_V2_DELAY_REQ = 0xe
|
||||||
|
HWTSTAMP_FILTER_NTP_ALL = 0xf
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HWTSTAMP_TX_OFF = 0x0
|
HWTSTAMP_TX_OFF = 0x0
|
||||||
HWTSTAMP_TX_ON = 0x1
|
HWTSTAMP_TX_ON = 0x1
|
||||||
HWTSTAMP_TX_ONESTEP_SYNC = 0x2
|
HWTSTAMP_TX_ONESTEP_SYNC = 0x2
|
||||||
|
HWTSTAMP_TX_ONESTEP_P2P = 0x3
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -4541,6 +4551,48 @@ const (
|
|||||||
LANDLOCK_RULE_PATH_BENEATH = 0x1
|
LANDLOCK_RULE_PATH_BENEATH = 0x1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
PIDFD_SIGNAL_THREAD = 0x1
|
||||||
|
PIDFD_SIGNAL_THREAD_GROUP = 0x2
|
||||||
|
PIDFD_SIGNAL_PROCESS_GROUP = 0x4
|
||||||
|
PIDFD_SELF_THREAD = -0x2710
|
||||||
|
PIDFD_SELF_THREAD_GROUP = -0x2711
|
||||||
|
PIDFD_SELF = -0x2710
|
||||||
|
PIDFD_SELF_PROCESS = -0x2711
|
||||||
|
PIDFD_INFO_PID = 0x1
|
||||||
|
PIDFD_INFO_CREDS = 0x2
|
||||||
|
PIDFD_INFO_CGROUPID = 0x4
|
||||||
|
PIDFD_INFO_EXIT = 0x8
|
||||||
|
PIDFD_INFO_COREDUMP = 0x10
|
||||||
|
PIDFD_COREDUMPED = 0x1
|
||||||
|
PIDFD_COREDUMP_SKIP = 0x2
|
||||||
|
PIDFD_COREDUMP_USER = 0x4
|
||||||
|
PIDFD_COREDUMP_ROOT = 0x8
|
||||||
|
PIDFD_INFO_SIZE_VER0 = 0x40
|
||||||
|
PIDFD_GET_INFO = 0xc048ff0b
|
||||||
|
)
|
||||||
|
|
||||||
|
const SizeofPidfdInfo = 0x48
|
||||||
|
|
||||||
|
type PidfdInfo struct {
|
||||||
|
Mask uint64
|
||||||
|
Cgroupid uint64
|
||||||
|
Pid uint32
|
||||||
|
Tgid uint32
|
||||||
|
Ppid uint32
|
||||||
|
Ruid uint32
|
||||||
|
Rgid uint32
|
||||||
|
Euid uint32
|
||||||
|
Egid uint32
|
||||||
|
Suid uint32
|
||||||
|
Sgid uint32
|
||||||
|
Fsuid uint32
|
||||||
|
Fsgid uint32
|
||||||
|
Exit_code int32
|
||||||
|
Coredump_mask uint32
|
||||||
|
_ uint32
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
IPC_CREAT = 0x200
|
IPC_CREAT = 0x200
|
||||||
IPC_EXCL = 0x400
|
IPC_EXCL = 0x400
|
||||||
@@ -6473,3 +6525,23 @@ type GPIOV2LineEvent struct {
|
|||||||
Line_seqno uint32
|
Line_seqno uint32
|
||||||
_ [6]uint32
|
_ [6]uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMI_MAX_ADDR_SIZE = 0x20
|
||||||
|
IPMI_SYSTEM_INTERFACE_ADDR_TYPE = 0xc
|
||||||
|
IPMI_BMC_CHANNEL = 0xf
|
||||||
|
IPMI_RESPONSE_RECV_TYPE = 0x1
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMISystemInterfaceAddr struct {
|
||||||
|
Type int32
|
||||||
|
Channel int16
|
||||||
|
Lun uint8
|
||||||
|
_ [1]byte
|
||||||
|
}
|
||||||
|
type IPMIMsg struct {
|
||||||
|
Netfn uint8
|
||||||
|
Cmd uint8
|
||||||
|
Len uint16
|
||||||
|
Data *uint8
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -680,7 +680,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -715,3 +726,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8014690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc018690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -697,7 +697,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -729,3 +740,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -674,7 +674,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -709,3 +720,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8014690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc018690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -676,7 +676,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -708,3 +719,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -677,7 +677,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -709,3 +720,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -680,7 +680,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x80
|
PIDFD_NONBLOCK = 0x80
|
||||||
|
PIDFD_THREAD = 0x400
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -714,3 +725,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4014690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc018690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -679,7 +679,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x80
|
PIDFD_NONBLOCK = 0x80
|
||||||
|
PIDFD_THREAD = 0x400
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -711,3 +722,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -679,7 +679,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x80
|
PIDFD_NONBLOCK = 0x80
|
||||||
|
PIDFD_THREAD = 0x400
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -711,3 +722,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -680,7 +680,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x80
|
PIDFD_NONBLOCK = 0x80
|
||||||
|
PIDFD_THREAD = 0x400
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -714,3 +725,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4014690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc018690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -686,7 +686,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -722,3 +733,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4014690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc018690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int32
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -686,7 +686,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -717,3 +728,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -686,7 +686,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -717,3 +728,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -704,7 +704,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -796,3 +807,22 @@ const (
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -700,7 +700,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x800
|
PIDFD_NONBLOCK = 0x800
|
||||||
|
PIDFD_THREAD = 0x80
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0xff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0xff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0xff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0xff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0xff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0xff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0xff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0xff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -731,3 +742,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x8028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+31
-1
@@ -681,7 +681,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PIDFD_NONBLOCK = 0x4000
|
PIDFD_NONBLOCK = 0x4000
|
||||||
|
PIDFD_THREAD = 0x800
|
||||||
|
PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01
|
||||||
|
PIDFD_GET_IPC_NAMESPACE = 0x2000ff02
|
||||||
|
PIDFD_GET_MNT_NAMESPACE = 0x2000ff03
|
||||||
|
PIDFD_GET_NET_NAMESPACE = 0x2000ff04
|
||||||
|
PIDFD_GET_PID_NAMESPACE = 0x2000ff05
|
||||||
|
PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06
|
||||||
|
PIDFD_GET_TIME_NAMESPACE = 0x2000ff07
|
||||||
|
PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08
|
||||||
|
PIDFD_GET_USER_NAMESPACE = 0x2000ff09
|
||||||
|
PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysvIpcPerm struct {
|
type SysvIpcPerm struct {
|
||||||
@@ -712,3 +723,22 @@ type SysvShmDesc struct {
|
|||||||
const (
|
const (
|
||||||
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
IPMICTL_SEND_COMMAND = 0x4028690d
|
||||||
|
IPMICTL_RECEIVE_MSG = 0xc030690c
|
||||||
|
)
|
||||||
|
|
||||||
|
type IPMIReq struct {
|
||||||
|
Addr *uint8
|
||||||
|
Len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
type IPMIRecv struct {
|
||||||
|
Recv_type int32
|
||||||
|
Addr *uint8
|
||||||
|
Addr_len uint32
|
||||||
|
Msgid int64
|
||||||
|
Msg IPMIMsg
|
||||||
|
}
|
||||||
|
|||||||
+1
@@ -1065,6 +1065,7 @@ const (
|
|||||||
SO_BROADCAST = 32
|
SO_BROADCAST = 32
|
||||||
SO_LINGER = 128
|
SO_LINGER = 128
|
||||||
SO_RCVBUF = 0x1002
|
SO_RCVBUF = 0x1002
|
||||||
|
SO_SNDTIMEO = 0x1005
|
||||||
SO_RCVTIMEO = 0x1006
|
SO_RCVTIMEO = 0x1006
|
||||||
SO_SNDBUF = 0x1001
|
SO_SNDBUF = 0x1001
|
||||||
SO_UPDATE_ACCEPT_CONTEXT = 0x700b
|
SO_UPDATE_ACCEPT_CONTEXT = 0x700b
|
||||||
|
|||||||
+17
-7
@@ -106,6 +106,9 @@ type Terminal struct {
|
|||||||
// a read. It aliases into inBuf.
|
// a read. It aliases into inBuf.
|
||||||
remainder []byte
|
remainder []byte
|
||||||
inBuf [256]byte
|
inBuf [256]byte
|
||||||
|
// readErr is an error returned by a read that also returned data. It is
|
||||||
|
// reported after all of that data has been processed.
|
||||||
|
readErr error
|
||||||
|
|
||||||
// History records and retrieves lines of input read by [ReadLine] which
|
// History records and retrieves lines of input read by [ReadLine] which
|
||||||
// a user can retrieve and navigate using the up and down arrow keys.
|
// a user can retrieve and navigate using the up and down arrow keys.
|
||||||
@@ -788,7 +791,11 @@ func (t *Terminal) ReadPassword(prompt string) (line string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadLine returns a line of input from the terminal.
|
// ReadLine returns a line of input from the terminal, excluding the
|
||||||
|
// trailing newline. It may return partial data along with an error.
|
||||||
|
// An [io.EOF] error indicates the end of the stream. For other errors,
|
||||||
|
// such as [ErrPasteIndicator] in bracketed paste mode, a subsequent
|
||||||
|
// call may return more data.
|
||||||
func (t *Terminal) ReadLine() (line string, err error) {
|
func (t *Terminal) ReadLine() (line string, err error) {
|
||||||
t.lock.Lock()
|
t.lock.Lock()
|
||||||
defer t.lock.Unlock()
|
defer t.lock.Unlock()
|
||||||
@@ -863,21 +870,24 @@ func (t *Terminal) readLine() (line string, err error) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if t.readErr != nil {
|
||||||
|
err = t.readErr
|
||||||
|
t.readErr = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// t.remainder is a slice at the beginning of t.inBuf
|
// t.remainder is a slice at the beginning of t.inBuf
|
||||||
// containing a partial key sequence
|
// containing a partial key sequence
|
||||||
readBuf := t.inBuf[len(t.remainder):]
|
readBuf := t.inBuf[len(t.remainder):]
|
||||||
var n int
|
|
||||||
|
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
n, err = t.c.Read(readBuf)
|
n, readErr := t.c.Read(readBuf)
|
||||||
t.lock.Lock()
|
t.lock.Lock()
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
t.remainder = t.inBuf[:n+len(t.remainder)]
|
t.remainder = t.inBuf[:n+len(t.remainder)]
|
||||||
|
if readErr != nil {
|
||||||
|
t.readErr = readErr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -6,7 +6,6 @@ package bidi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// This implementation is a port based on the reference implementation found at:
|
// This implementation is a port based on the reference implementation found at:
|
||||||
@@ -248,7 +247,7 @@ func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level {
|
|||||||
} else if t.in(FSI, LRI, RLI) {
|
} else if t.in(FSI, LRI, RLI) {
|
||||||
i = p.matchingPDI[i] // skip over to the matching PDI
|
i = p.matchingPDI[i] // skip over to the matching PDI
|
||||||
if i > end {
|
if i > end {
|
||||||
log.Panic("assert (i <= end)")
|
panic("assert (i <= end)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -729,7 +728,7 @@ loop:
|
|||||||
continue loop
|
continue loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i])
|
panic(fmt.Errorf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-15
@@ -449,6 +449,16 @@ func (rb *reorderBuffer) combineHangul(s, i, k int) {
|
|||||||
// ACxx plus 11Ax to LVT
|
// ACxx plus 11Ax to LVT
|
||||||
rb.assignRune(s, l+v-jamoTBase)
|
rb.assignRune(s, l+v-jamoTBase)
|
||||||
default:
|
default:
|
||||||
|
// Not a Hangul composition. The segment may still
|
||||||
|
// contain regular canonical compositions, such as
|
||||||
|
// combining marks following a Hangul syllable, so
|
||||||
|
// fall back to the composition table.
|
||||||
|
if b[i].combinesBackward() {
|
||||||
|
if combined := combine(l, v); combined != 0 {
|
||||||
|
rb.assignRune(s, combined)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
b[k] = b[i]
|
b[k] = b[i]
|
||||||
k++
|
k++
|
||||||
}
|
}
|
||||||
@@ -484,25 +494,27 @@ func (rb *reorderBuffer) compose() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
ii := b[i]
|
ii := b[i]
|
||||||
|
// Track the last starter unconditionally: b[i] must be blocked by
|
||||||
|
// any starter between it and s, even one that b[i] itself cannot
|
||||||
|
// combine with, and even if the runes in between never enter the
|
||||||
|
// combinesBackward branch below.
|
||||||
|
cccB := b[k-1].ccc
|
||||||
|
cccC := ii.ccc
|
||||||
|
blocked := false // b[i] blocked by starter or greater or equal CCC?
|
||||||
|
if cccB == 0 {
|
||||||
|
s = k - 1
|
||||||
|
} else {
|
||||||
|
blocked = s != k-1 && cccB >= cccC
|
||||||
|
}
|
||||||
// We can only use combineForward as a filter if we later
|
// We can only use combineForward as a filter if we later
|
||||||
// get the info for the combined character. This is more
|
// get the info for the combined character. This is more
|
||||||
// expensive than using the filter. Using combinesBackward()
|
// expensive than using the filter. Using combinesBackward()
|
||||||
// is safe.
|
// is safe.
|
||||||
if ii.combinesBackward() {
|
if ii.combinesBackward() && !blocked {
|
||||||
cccB := b[k-1].ccc
|
combined := combine(rb.runeAt(s), rb.runeAt(i))
|
||||||
cccC := ii.ccc
|
if combined != 0 {
|
||||||
blocked := false // b[i] blocked by starter or greater or equal CCC?
|
rb.assignRune(s, combined)
|
||||||
if cccB == 0 {
|
continue
|
||||||
s = k - 1
|
|
||||||
} else {
|
|
||||||
blocked = s != k-1 && cccB >= cccC
|
|
||||||
}
|
|
||||||
if !blocked {
|
|
||||||
combined := combine(rb.runeAt(s), rb.runeAt(i))
|
|
||||||
if combined != 0 {
|
|
||||||
rb.assignRune(s, combined)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b[k] = b[i]
|
b[k] = b[i]
|
||||||
|
|||||||
+12
-12
@@ -191,30 +191,30 @@ func (p Properties) TrailCCC() uint8 {
|
|||||||
return ccc[p.tccc]
|
return ccc[p.tccc]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recomposition
|
||||||
|
// Each entry of recompMapPacked holds the two runes of the key and the
|
||||||
|
// composed rune of the value packed into a big-endian uint64 as three
|
||||||
|
// 21-bit fields, which is wide enough for any rune.
|
||||||
|
// Note that the recomposition map for NFC and NFKC are identical.
|
||||||
|
|
||||||
|
const recompShift = 21
|
||||||
|
|
||||||
func buildRecompMap() {
|
func buildRecompMap() {
|
||||||
recompMap = make(map[uint32]rune, len(recompMapPacked)/8)
|
recompMap = make(map[uint64]rune, len(recompMapPacked)/8)
|
||||||
var buf [8]byte
|
var buf [8]byte
|
||||||
for i := 0; i < len(recompMapPacked); i += 8 {
|
for i := 0; i < len(recompMapPacked); i += 8 {
|
||||||
copy(buf[:], recompMapPacked[i:i+8])
|
copy(buf[:], recompMapPacked[i:i+8])
|
||||||
key := binary.BigEndian.Uint32(buf[:4])
|
e := binary.BigEndian.Uint64(buf[:])
|
||||||
val := binary.BigEndian.Uint32(buf[4:])
|
recompMap[e>>recompShift] = rune(e & (1<<recompShift - 1))
|
||||||
recompMap[key] = rune(val)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recomposition
|
|
||||||
// We use 32-bit keys instead of 64-bit for the two codepoint keys.
|
|
||||||
// This clips off the bits of three entries, but we know this will not
|
|
||||||
// result in a collision. In the unlikely event that changes to
|
|
||||||
// UnicodeData.txt introduce collisions, the compiler will catch it.
|
|
||||||
// Note that the recomposition map for NFC and NFKC are identical.
|
|
||||||
|
|
||||||
// combine returns the combined rune or 0 if it doesn't exist.
|
// combine returns the combined rune or 0 if it doesn't exist.
|
||||||
//
|
//
|
||||||
// The caller is responsible for calling
|
// The caller is responsible for calling
|
||||||
// recompMapOnce.Do(buildRecompMap) sometime before this is called.
|
// recompMapOnce.Do(buildRecompMap) sometime before this is called.
|
||||||
func combine(a, b rune) rune {
|
func combine(a, b rune) rune {
|
||||||
key := uint32(uint16(a))<<16 + uint32(uint16(b))
|
key := uint64(a)<<recompShift | uint64(b)
|
||||||
if recompMap == nil {
|
if recompMap == nil {
|
||||||
panic("caller error") // see func comment
|
panic("caller error") // see func comment
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -505,7 +505,10 @@ func decomposeSegment(rb *reorderBuffer, sp int, atEOF bool) int {
|
|||||||
// Force one character to be consumed.
|
// Force one character to be consumed.
|
||||||
info := rb.f.info(rb.src, sp)
|
info := rb.f.info(rb.src, sp)
|
||||||
if info.isInvalid() {
|
if info.isInvalid() {
|
||||||
return 0
|
// Consume the invalid character.
|
||||||
|
// Perhaps this should return iShortSrc instead?
|
||||||
|
// May not matter, this path does not appear to be reachable in practice.
|
||||||
|
return sp + 1
|
||||||
}
|
}
|
||||||
if s := rb.ss.next(info); s == ssStarter {
|
if s := rb.ss.next(info); s == ssStarter {
|
||||||
// TODO: this could be removed if we don't support merging.
|
// TODO: this could be removed if we don't support merging.
|
||||||
|
|||||||
+942
-942
File diff suppressed because it is too large
Load Diff
+962
-962
File diff suppressed because it is too large
Load Diff
+3
-2
@@ -33,7 +33,7 @@ func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
|
|||||||
return nDst + n, nSrc + n, err
|
return nDst + n, nSrc + n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil && n < len(src) && !atEOF {
|
if err == nil && n < len(src) {
|
||||||
err = transform.ErrShortSrc
|
err = transform.ErrShortSrc
|
||||||
}
|
}
|
||||||
return n, n, err
|
return n, n, err
|
||||||
@@ -67,6 +67,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
|
|||||||
nSrc = end
|
nSrc = end
|
||||||
|
|
||||||
// Next quickSpan.
|
// Next quickSpan.
|
||||||
|
var err error
|
||||||
end = rb.nsrc
|
end = rb.nsrc
|
||||||
eof := atEOF
|
eof := atEOF
|
||||||
if n := nSrc + len(dst) - nDst; n < end {
|
if n := nSrc + len(dst) - nDst; n < end {
|
||||||
@@ -79,7 +80,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
|
|||||||
nSrc += n
|
nSrc += n
|
||||||
nDst += n
|
nDst += n
|
||||||
if ok {
|
if ok {
|
||||||
if err == nil && n < rb.nsrc && !atEOF {
|
if err == nil && nSrc < rb.nsrc {
|
||||||
err = transform.ErrShortSrc
|
err = transform.ErrShortSrc
|
||||||
}
|
}
|
||||||
return nDst, nSrc, err
|
return nDst, nSrc, err
|
||||||
|
|||||||
Vendored
+19
-20
@@ -21,10 +21,9 @@ github.com/cenkalti/backoff/v5
|
|||||||
# github.com/cespare/xxhash/v2 v2.3.0
|
# github.com/cespare/xxhash/v2 v2.3.0
|
||||||
## explicit; go 1.11
|
## explicit; go 1.11
|
||||||
github.com/cespare/xxhash/v2
|
github.com/cespare/xxhash/v2
|
||||||
# github.com/clipperhouse/uax29/v2 v2.2.0
|
# github.com/clipperhouse/uax29/v2 v2.7.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/clipperhouse/uax29/v2/graphemes
|
github.com/clipperhouse/uax29/v2/graphemes
|
||||||
github.com/clipperhouse/uax29/v2/internal/iterators
|
|
||||||
# github.com/containerd/errdefs v1.0.0
|
# github.com/containerd/errdefs v1.0.0
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/containerd/errdefs
|
github.com/containerd/errdefs
|
||||||
@@ -156,7 +155,7 @@ github.com/klauspost/compress/internal/le
|
|||||||
github.com/klauspost/compress/internal/snapref
|
github.com/klauspost/compress/internal/snapref
|
||||||
github.com/klauspost/compress/zstd
|
github.com/klauspost/compress/zstd
|
||||||
github.com/klauspost/compress/zstd/internal/xxhash
|
github.com/klauspost/compress/zstd/internal/xxhash
|
||||||
# github.com/mattn/go-runewidth v0.0.28
|
# github.com/mattn/go-runewidth v0.0.29
|
||||||
## explicit; go 1.23
|
## explicit; go 1.23
|
||||||
github.com/mattn/go-runewidth
|
github.com/mattn/go-runewidth
|
||||||
# github.com/moby/docker-image-spec v1.3.1
|
# github.com/moby/docker-image-spec v1.3.1
|
||||||
@@ -231,7 +230,7 @@ github.com/moby/sys/symlink
|
|||||||
# github.com/moby/sys/user v0.4.1
|
# github.com/moby/sys/user v0.4.1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/moby/sys/user
|
github.com/moby/sys/user
|
||||||
# github.com/moby/sys/userns v0.2.0
|
# github.com/moby/sys/userns v0.2.1
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/moby/sys/userns
|
github.com/moby/sys/userns
|
||||||
# github.com/moby/term v0.5.2
|
# github.com/moby/term v0.5.2
|
||||||
@@ -391,14 +390,14 @@ go.opentelemetry.io/proto/otlp/trace/v1
|
|||||||
# go.yaml.in/yaml/v3 v3.0.5
|
# go.yaml.in/yaml/v3 v3.0.5
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
go.yaml.in/yaml/v3
|
go.yaml.in/yaml/v3
|
||||||
# golang.org/x/mod v0.40.0
|
# golang.org/x/mod v0.41.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/mod/internal/lazyregexp
|
golang.org/x/mod/internal/lazyregexp
|
||||||
golang.org/x/mod/modfile
|
golang.org/x/mod/modfile
|
||||||
golang.org/x/mod/module
|
golang.org/x/mod/module
|
||||||
golang.org/x/mod/semver
|
golang.org/x/mod/semver
|
||||||
# golang.org/x/net v0.58.0
|
# golang.org/x/net v0.59.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/net/http/httpguts
|
golang.org/x/net/http/httpguts
|
||||||
golang.org/x/net/http2
|
golang.org/x/net/http2
|
||||||
golang.org/x/net/http2/hpack
|
golang.org/x/net/http2/hpack
|
||||||
@@ -407,20 +406,20 @@ golang.org/x/net/internal/httpcommon
|
|||||||
golang.org/x/net/internal/httpsfv
|
golang.org/x/net/internal/httpsfv
|
||||||
golang.org/x/net/internal/timeseries
|
golang.org/x/net/internal/timeseries
|
||||||
golang.org/x/net/trace
|
golang.org/x/net/trace
|
||||||
# golang.org/x/sync v0.22.0
|
# golang.org/x/sync v0.23.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/sync/errgroup
|
golang.org/x/sync/errgroup
|
||||||
# golang.org/x/sys v0.47.0
|
# golang.org/x/sys v0.48.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/sys/plan9
|
golang.org/x/sys/plan9
|
||||||
golang.org/x/sys/unix
|
golang.org/x/sys/unix
|
||||||
golang.org/x/sys/windows
|
golang.org/x/sys/windows
|
||||||
golang.org/x/sys/windows/registry
|
golang.org/x/sys/windows/registry
|
||||||
# golang.org/x/term v0.45.0
|
# golang.org/x/term v0.46.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/term
|
golang.org/x/term
|
||||||
# golang.org/x/text v0.41.0
|
# golang.org/x/text v0.42.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/text/feature/plural
|
golang.org/x/text/feature/plural
|
||||||
golang.org/x/text/internal
|
golang.org/x/text/internal
|
||||||
golang.org/x/text/internal/catmsg
|
golang.org/x/text/internal/catmsg
|
||||||
@@ -438,8 +437,8 @@ golang.org/x/text/transform
|
|||||||
golang.org/x/text/unicode/bidi
|
golang.org/x/text/unicode/bidi
|
||||||
golang.org/x/text/unicode/norm
|
golang.org/x/text/unicode/norm
|
||||||
golang.org/x/text/width
|
golang.org/x/text/width
|
||||||
# golang.org/x/time v0.15.0
|
# golang.org/x/time v0.16.0
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.26.0
|
||||||
golang.org/x/time/rate
|
golang.org/x/time/rate
|
||||||
# google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5
|
# google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5
|
||||||
## explicit; go 1.25.0
|
## explicit; go 1.25.0
|
||||||
@@ -574,6 +573,6 @@ gotest.tools/v3/internal/format
|
|||||||
gotest.tools/v3/internal/source
|
gotest.tools/v3/internal/source
|
||||||
gotest.tools/v3/poll
|
gotest.tools/v3/poll
|
||||||
gotest.tools/v3/skip
|
gotest.tools/v3/skip
|
||||||
# tags.cncf.io/container-device-interface v1.1.0
|
# tags.cncf.io/container-device-interface v1.1.1
|
||||||
## explicit; go 1.21
|
## explicit; go 1.23
|
||||||
tags.cncf.io/container-device-interface/pkg/parser
|
tags.cncf.io/container-device-interface/pkg/parser
|
||||||
|
|||||||
+9
-7
@@ -83,13 +83,12 @@ func ParseDevice(device string) (string, string, string) {
|
|||||||
return "", "", device
|
return "", "", device
|
||||||
}
|
}
|
||||||
|
|
||||||
parts := strings.SplitN(device, "=", 2)
|
qualifier, name, ok := strings.Cut(device, "=")
|
||||||
if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
|
if !ok || qualifier == "" || name == "" {
|
||||||
return "", "", device
|
return "", "", device
|
||||||
}
|
}
|
||||||
|
|
||||||
name := parts[1]
|
vendor, class := ParseQualifier(qualifier)
|
||||||
vendor, class := ParseQualifier(parts[0])
|
|
||||||
if vendor == "" {
|
if vendor == "" {
|
||||||
return "", "", device
|
return "", "", device
|
||||||
}
|
}
|
||||||
@@ -105,11 +104,11 @@ func ParseDevice(device string) (string, string, string) {
|
|||||||
// If parsing fails, an empty vendor and the class set to the
|
// If parsing fails, an empty vendor and the class set to the
|
||||||
// verbatim input is returned.
|
// verbatim input is returned.
|
||||||
func ParseQualifier(kind string) (string, string) {
|
func ParseQualifier(kind string) (string, string) {
|
||||||
parts := strings.SplitN(kind, "/", 2)
|
qualifier, value, ok := strings.Cut(kind, "/")
|
||||||
if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
|
if !ok || qualifier == "" || value == "" {
|
||||||
return "", kind
|
return "", kind
|
||||||
}
|
}
|
||||||
return parts[0], parts[1]
|
return qualifier, value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateVendorName checks the validity of a vendor name.
|
// ValidateVendorName checks the validity of a vendor name.
|
||||||
@@ -150,6 +149,9 @@ func validateVendorOrClassName(name string) error {
|
|||||||
if !IsLetter(rune(name[0])) {
|
if !IsLetter(rune(name[0])) {
|
||||||
return fmt.Errorf("%q, should start with letter", name)
|
return fmt.Errorf("%q, should start with letter", name)
|
||||||
}
|
}
|
||||||
|
if len(name) == 1 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for _, c := range string(name[1 : len(name)-1]) {
|
for _, c := range string(name[1 : len(name)-1]) {
|
||||||
switch {
|
switch {
|
||||||
case IsAlphaNumeric(c):
|
case IsAlphaNumeric(c):
|
||||||
|
|||||||
Reference in New Issue
Block a user