diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3d2128..a2633b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,100 +1,109 @@ name: Test on: - pull_request: - branches: - - main + pull_request: + branches: + - main permissions: - contents: read - statuses: write - pull-requests: write + contents: read + statuses: write + pull-requests: write jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.25" + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.25" - - name: Run tests - run: make test coverage-test + - name: Run tests + run: make test - - name: Extract coverage percentage - id: coverage - run: | - COVERAGE="$(awk '/^total:/{print $3}' build/coverage.txt | tr -d '%')" - echo "coverage=${COVERAGE}" >> "$GITHUB_OUTPUT" + - name: Extract coverage percentage + id: coverage + if: always() + run: | + if [ -f build/coverage.txt ]; then + COVERAGE="$(awk '/^total:/{print $3}' build/coverage.txt | tr -d '%')" + else + COVERAGE="" + fi + echo "coverage=${COVERAGE}" >> "$GITHUB_OUTPUT" - - name: Publish coverage summary - if: always() - run: | - echo "## Test Coverage" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo "Total: **${{ steps.coverage.outputs.coverage }}%**" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo "\`\`\`text" >> "$GITHUB_STEP_SUMMARY" - tail -n 20 build/coverage.txt >> "$GITHUB_STEP_SUMMARY" - echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY" + - name: Publish coverage summary + if: always() + run: | + echo "## Test Coverage" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + if [ -f build/coverage.txt ]; then + echo "Total: **${{ steps.coverage.outputs.coverage }}%**" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "\`\`\`text" >> "$GITHUB_STEP_SUMMARY" + tail -n 20 build/coverage.txt >> "$GITHUB_STEP_SUMMARY" + echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY" + else + echo "Coverage report was not generated (build/coverage.txt not found)." >> "$GITHUB_STEP_SUMMARY" + fi - - name: Set commit coverage status - if: always() && steps.coverage.outputs.coverage != '' - uses: actions/github-script@v7 - env: - COVERAGE: ${{ steps.coverage.outputs.coverage }} - with: - script: | - const sha = context.payload.pull_request?.head?.sha || context.sha; - const state = '${{ job.status }}' === 'success' ? 'success' : 'failure'; - await github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha, - state, - context: 'go-pg/coverage', - description: `Coverage ${process.env.COVERAGE}%`, - target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, - }); + - name: Set commit coverage status + if: always() && steps.coverage.outputs.coverage != '' + uses: actions/github-script@v7 + env: + COVERAGE: ${{ steps.coverage.outputs.coverage }} + with: + script: | + const sha = context.payload.pull_request?.head?.sha || context.sha; + const state = '${{ job.status }}' === 'success' ? 'success' : 'failure'; + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha, + state, + context: 'go-pg/coverage', + description: `Coverage ${process.env.COVERAGE}%`, + target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + }); - - name: Comment coverage on pull request - if: always() && github.event_name == 'pull_request' && steps.coverage.outputs.coverage != '' - uses: actions/github-script@v7 - env: - COVERAGE: ${{ steps.coverage.outputs.coverage }} - with: - script: | - const body = [ - '', - `Coverage for this change: **${process.env.COVERAGE}%**`, - ].join('\n'); + - name: Comment coverage on pull request + if: always() && github.event_name == 'pull_request' && steps.coverage.outputs.coverage != '' + uses: actions/github-script@v7 + env: + COVERAGE: ${{ steps.coverage.outputs.coverage }} + with: + script: | + const body = [ + '', + `Coverage for this change: **${process.env.COVERAGE}%**`, + ].join('\n'); - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); - const previous = comments.find(c => - c.user?.type === 'Bot' && c.body?.includes('') - ); + const previous = comments.find(c => + c.user?.type === 'Bot' && c.body?.includes('') + ); - if (previous) { - await github.rest.issues.updateComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: previous.id, - body, - }); - } else { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body, - }); - } + if (previous) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: previous.id, + body, + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body, + }); + } diff --git a/go.mod b/go.mod index b373266..39dce3a 100644 --- a/go.mod +++ b/go.mod @@ -5,22 +5,22 @@ go 1.25.0 require ( github.com/djthorpe/go-wasmbuild v0.0.6 github.com/jackc/pgx/v5 v5.10.0 - github.com/mutablelogic/go-client v1.4.9 - github.com/mutablelogic/go-llm v0.4.4 - github.com/mutablelogic/go-server v1.6.36 + github.com/mutablelogic/go-client v1.4.10 + github.com/mutablelogic/go-llm v0.4.5 + github.com/mutablelogic/go-server v1.7.3 github.com/stretchr/testify v1.11.1 - github.com/testcontainers/testcontainers-go v0.42.0 - go.opentelemetry.io/otel v1.44.0 - go.opentelemetry.io/otel/metric v1.44.0 - go.opentelemetry.io/otel/trace v1.44.0 - golang.org/x/sync v0.21.0 + github.com/testcontainers/testcontainers-go v0.43.0 + go.opentelemetry.io/otel v1.45.0 + go.opentelemetry.io/otel/metric v1.45.0 + go.opentelemetry.io/otel/trace v1.45.0 + golang.org/x/sync v0.22.0 ) require ( dario.cat/mergo v1.0.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/alecthomas/kong v1.15.0 // indirect + github.com/alecthomas/kong v1.16.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect @@ -36,49 +36,49 @@ require ( github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect - github.com/coreos/go-oidc/v3 v3.18.0 // indirect + github.com/coreos/go-oidc/v3 v3.20.0 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/docker/go-connections v0.7.0 // indirect + github.com/docker/go-connections v0.8.1 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/ebitengine/purego v0.10.1 // indirect + github.com/ebitengine/purego v0.10.2 // indirect github.com/felixge/httpsnoop v1.1.0 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/goccy/go-json v0.10.6 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/google/jsonschema-go v0.4.3 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect - github.com/klauspost/compress v1.18.6 // indirect + github.com/klauspost/compress v1.19.2 // indirect github.com/lestrrat-go/blackmagic v1.0.4 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc v1.0.6 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect - github.com/lestrrat-go/jwx/v2 v2.1.6 // indirect + github.com/lestrrat-go/jwx/v2 v2.1.7 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/lucasb-eyer/go-colorful v1.4.0 // indirect - github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e // indirect - github.com/magiconair/properties v1.8.10 // indirect - github.com/mattn/go-isatty v0.0.22 // indirect - github.com/mattn/go-runewidth v0.0.24 // indirect + github.com/lucasb-eyer/go-colorful v1.4.1 // indirect + github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect + github.com/magiconair/properties v1.18.11 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + github.com/mattn/go-runewidth v0.0.27 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect - github.com/moby/go-archive v0.2.0 // indirect - github.com/moby/moby/api v1.54.2 // indirect - github.com/moby/moby/client v0.4.1 // indirect + github.com/moby/go-archive v0.3.3 // indirect + github.com/moby/moby/api v1.55.0 // indirect + github.com/moby/moby/client v0.5.1 // indirect github.com/moby/patternmatcher v0.6.1 // indirect github.com/moby/sys/sequential v0.7.0 // indirect - github.com/moby/sys/user v0.4.0 // indirect + github.com/moby/sys/user v0.4.1 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/moby/term v0.5.2 // indirect - github.com/modelcontextprotocol/go-sdk v1.6.1 // indirect + github.com/modelcontextprotocol/go-sdk v1.7.0 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/mutablelogic/go-auth v0.0.14 // indirect github.com/mutablelogic/go-tokenizer v0.0.3 // indirect @@ -86,11 +86,11 @@ require ( github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/segmentio/asm v1.2.1 // indirect github.com/segmentio/encoding v0.5.4 // indirect - github.com/shirou/gopsutil/v4 v4.26.5 // indirect + github.com/shirou/gopsutil/v4 v4.26.7 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/tklauser/go-sysconf v0.4.0 // indirect github.com/tklauser/numcpus v0.12.0 // indirect @@ -98,29 +98,30 @@ require ( github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/bridges/otelslog v0.19.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect - go.opentelemetry.io/otel/log v0.20.0 // indirect - go.opentelemetry.io/otel/sdk v1.44.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.20.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect - go.opentelemetry.io/proto/otlp v1.10.0 // indirect - golang.org/x/crypto v0.53.0 // indirect - golang.org/x/net v0.56.0 // indirect + go.opentelemetry.io/contrib/bridges/otelslog v0.20.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0 // indirect + go.opentelemetry.io/otel/log v0.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.45.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.21.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.45.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + golang.org/x/crypto v0.54.0 // indirect + golang.org/x/net v0.57.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.46.0 // indirect - golang.org/x/term v0.44.0 // indirect - golang.org/x/text v0.38.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad // indirect - google.golang.org/grpc v1.81.1 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/term v0.45.0 // indirect + golang.org/x/text v0.40.0 // indirect + golang.org/x/time v0.15.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect + google.golang.org/grpc v1.83.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 00686aa..1e6854e 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8v github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/kong v1.15.0 h1:BVJstKbpO73zKpmIu+m/aLRrNmWwxXPIGTNin9VmLVI= github.com/alecthomas/kong v1.15.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I= +github.com/alecthomas/kong v1.16.0 h1:g92/kUxBcdcTPOM79yE63viJgtcp5dNyrB3/O2cjYT4= +github.com/alecthomas/kong v1.16.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I= github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -48,6 +50,8 @@ github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpS github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/coreos/go-oidc/v3 v3.18.0 h1:V9orjXynvu5wiC9SemFTWnG4F45v403aIcjWo0d41+A= github.com/coreos/go-oidc/v3 v3.18.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= +github.com/coreos/go-oidc/v3 v3.20.0 h1:EtE0WIBHk03N+DqGkY4+UONzzZHk7amKt6IyNd7OsZE= +github.com/coreos/go-oidc/v3 v3.20.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= @@ -63,12 +67,14 @@ github.com/djthorpe/go-wasmbuild v0.0.6 h1:GwcXGsObsC4IqpOlLppK2eX8T480AWIA9oNEl github.com/djthorpe/go-wasmbuild v0.0.6/go.mod h1:aFsyWZA+tyJmGpL1ZQvvdzi9k3dEXGoDZpj4lODjuzk= github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c= github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= +github.com/docker/go-connections v0.8.1 h1:JibmG5hULs5qXSr/cp/w3Pw5fZuStt4MOHMUExb29/M= +github.com/docker/go-connections v0.8.1/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/ebitengine/purego v0.10.1 h1:dewVBCBT2GaMu1SrNTYxQhgQBethzfhiwvZiLGP/qyY= github.com/ebitengine/purego v0.10.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= +github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= @@ -76,6 +82,8 @@ github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9 github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -95,6 +103,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= @@ -107,6 +117,8 @@ github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi26R8= +github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -121,50 +133,76 @@ github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzlt github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVfecA= github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU= +github.com/lestrrat-go/jwx/v2 v2.1.7 h1:bnYeET+S8IOyAw6W4LTc6SEeK7Xs58SKKZkR7scb3Ko= +github.com/lestrrat-go/jwx/v2 v2.1.7/go.mod h1:exQ9ZBuN1cMLYmxwhTlHUru08ykONG0z+HbLEeDG9qo= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss= +github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e h1:Q6MvJtQK/iRcRtzAscm/zF23XxJlbECiGPyRicsX+Ak= github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.18.11 h1:j5ozYZl0zCjG7ahMDH0GWIobOvvUzT0BdAguG0ViKy0= +github.com/magiconair/properties v1.18.11/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/mattn/go-runewidth v0.0.27 h1:Feg/Oou5zI/wnpgDF6omIU0OokC9GxLC/WRknhVlIR0= +github.com/mattn/go-runewidth v0.0.27/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/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.2.0 h1:zg5QDUM2mi0JIM9fdQZWC7U8+2ZfixfTYoHL7rWUcP8= github.com/moby/go-archive v0.2.0/go.mod h1:mNeivT14o8xU+5q1YnNrkQVpK+dnNe/K6fHqnTg4qPU= +github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME= +github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE= github.com/moby/moby/api v1.54.2 h1:wiat9QAhnDQjA7wk1kh/TqHz2I1uUA7M7t9SAl/JNXg= github.com/moby/moby/api v1.54.2/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= +github.com/moby/moby/api v1.55.0 h1:2/sexvQyqIWS8pRSCFddBfpW2qE7vR7FCL+vN8pxwMc= +github.com/moby/moby/api v1.55.0/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= github.com/moby/moby/client v0.4.1 h1:DMQgisVoMkmMs7fp3ROSdiBnoAu8+vo3GggFl06M/wY= github.com/moby/moby/client v0.4.1/go.mod h1:z52C9O2POPOsnxZAy//WtKcQ32P+jT/NGeXu/7nfjGQ= +github.com/moby/moby/client v0.5.1 h1:tYNaJno4c0HXz12y5BiqEDy0rVTYkWzI26lGvnTMiJw= +github.com/moby/moby/client v0.5.1/go.mod h1:odLstlZ6uSnfvAgVxMpvgmb8SUdd+siH2T0GBuxVAlM= github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U= github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/sequential v0.7.0 h1:ASQNGNROJSuOO6LL6bPHbKvuZu6NU8P4ldPWk31zj/8= github.com/moby/sys/sequential v0.7.0/go.mod h1:NfSTAp6V3fw4tmkD62PEcOKeZKquXT8VKCkf7aVR79o= github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +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/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= 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/modelcontextprotocol/go-sdk v1.6.0 h1:PPLS3kn7WtOEnR+Af4X5H96SG0qSab8R/ZQT/HkhPkY= -github.com/modelcontextprotocol/go-sdk v1.6.0/go.mod h1:kzm3kzFL1/+AziGOE0nUs3gvPoNxMCvkxokMkuFapXQ= github.com/modelcontextprotocol/go-sdk v1.6.1 h1:0zOSupjKUxPKSocPT1Wtago+mUHU2/uZ4xSOY0FGReU= github.com/modelcontextprotocol/go-sdk v1.6.1/go.mod h1:kzm3kzFL1/+AziGOE0nUs3gvPoNxMCvkxokMkuFapXQ= +github.com/modelcontextprotocol/go-sdk v1.7.0 h1:yqjY2dsbKAC0LSuWZVBMrHgiG8ukXv6NRo0JiALay44= +github.com/modelcontextprotocol/go-sdk v1.7.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/mutablelogic/go-auth v0.0.14 h1:4oK+NOuTLLVb7LxlCI3fuzuuCer4hG5/nfdaMbnecKE= github.com/mutablelogic/go-auth v0.0.14/go.mod h1:LVy12hxaci0i+zCEtmu35GJctvJHylsNHvkRjpjs7Lc= github.com/mutablelogic/go-client v1.4.9 h1:1JHLha6u0u0mEQEHc4K0Pq6EJMwd8F0DR/ahQrzTAlA= github.com/mutablelogic/go-client v1.4.9/go.mod h1:g8c6RlvIC0wC5rpoqtqk7eznBxormwrxArxH9I5rNRQ= +github.com/mutablelogic/go-client v1.4.10 h1:Jb+H9QWiAEIieMzl/WcsPfwnZgT3nTRVOwOd7+sN0Z8= +github.com/mutablelogic/go-client v1.4.10/go.mod h1:g8c6RlvIC0wC5rpoqtqk7eznBxormwrxArxH9I5rNRQ= github.com/mutablelogic/go-llm v0.4.4 h1:uvC2hfvL95v8E53iwBFsMTCwZqSHgMf1Vm1ZtRW/lKU= github.com/mutablelogic/go-llm v0.4.4/go.mod h1:J1DetK4aP+JstDM5Z3b4H+HKRFKMRjCBcsdml+tYKvI= +github.com/mutablelogic/go-llm v0.4.5 h1:SVZpuqPXM3rrRMiR3UV6LBDRnhe1NC3y2D8m4jhdPVg= +github.com/mutablelogic/go-llm v0.4.5/go.mod h1:J1DetK4aP+JstDM5Z3b4H+HKRFKMRjCBcsdml+tYKvI= github.com/mutablelogic/go-server v1.6.36 h1:zJl6Fju8Q0XEa/D3jRWeKNskMCd9LjSC8UyUJAzQC7A= github.com/mutablelogic/go-server v1.6.36/go.mod h1:WEitTi2S39tM0xkmhm0aMNzb7NqhkaqJmwfHpaVtycw= +github.com/mutablelogic/go-server v1.7.3 h1:7TwCM69rI91QSHdi363eZu6wPj4xSPu4wsj/G8Dk8Hw= +github.com/mutablelogic/go-server v1.7.3/go.mod h1:jgP5lOCe0KCcwzCYdxAxWlZ25Os+QiyQKWDxTE4FRug= github.com/mutablelogic/go-tokenizer v0.0.3 h1:6oaa80TaAl+nVpd+M9QhlJPbP7y5/thq4d0dKjreiLs= github.com/mutablelogic/go-tokenizer v0.0.3/go.mod h1:zdAyIhfqUKxFXb8MwChbXNwMOZt/5NlUylmx6Qjr4v8= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -178,6 +216,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 h1:jL3a8soXdzuTCcRnKhOmtcsVOObdDTFf4O2B403HPRU= +github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= @@ -188,6 +228,8 @@ github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfv github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0= github.com/shirou/gopsutil/v4 v4.26.5 h1:RPcBXkpz7kOj9PqGFQOlBPZHsyaPvPVQc098y9RmCNM= github.com/shirou/gopsutil/v4 v4.26.5/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/shirou/gopsutil/v4 v4.26.7 h1:IXzpHz/dkMRYAhKkOXr1HB6SuzWU3eoyyeWe7g3bNZc= +github.com/shirou/gopsutil/v4 v4.26.7/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -201,6 +243,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/testcontainers/testcontainers-go v0.42.0 h1:He3IhTzTZOygSXLJPMX7n44XtK+qhjat1nI9cneBbUY= github.com/testcontainers/testcontainers-go v0.42.0/go.mod h1:vZjdY1YmUA1qEForxOIOazfsrdyORJAbhi0bp8plN30= +github.com/testcontainers/testcontainers-go v0.43.0 h1:oEQx5MW2DGd9z3AeEQfB2lPM0eLs7ztyaGRu75bFo5A= +github.com/testcontainers/testcontainers-go v0.43.0/go.mod h1:+VxkT2NQnKOZPKi6praMuMKYHYyOGXr0XSBSlSMCzFo= github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU= github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI= github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4= @@ -215,74 +259,131 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/bridges/otelslog v0.19.0 h1:5RgvxieNq9tS3ewrV1vnODvbHPfKUIJcYtF9Cvz+6aQ= go.opentelemetry.io/contrib/bridges/otelslog v0.19.0/go.mod h1:iTBIdNwx/xmUhfgJs6+84S4dIK059811cO1eUBjKcHY= +go.opentelemetry.io/contrib/bridges/otelslog v0.20.0 h1:oEl2Pw/i4OQwhAuda2pAHFAcOMivA+Xa+iTccBfab/g= +go.opentelemetry.io/contrib/bridges/otelslog v0.20.0/go.mod h1:yMSQaiiq5dpfrSJCYLBcqFeJkFFI67seT4ngvx6jfVo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04= go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= +go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU= +go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.20.0 h1:rydZ9sxbcFdm/oWrVyfLTjHIygMgv0bEeMd+3B/BvoM= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.20.0/go.mod h1:earQ25dooT0Hhspq59DZ8YCC50jWfOlFEeWoxy/P444= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0 h1:WseeVYf5dJZTsyPiyW5L14k5qsSibqXAMTSiFEDiWr0= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0/go.mod h1:SiLZnQS6Qk2eCpvr2CH/XMAOa64TWGXxEZJZCpD2Lmc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.20.0 h1:owlhcJ3QO3X0YTDTCcDZ4V+6aVDkWbNmBoQ5NUp7Oww= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.20.0/go.mod h1:MP4eemTiI9zC8fgg+DYynhYDYf3ba72S376TvP+Ye0Q= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.21.0 h1:fvNHGyo3CdRv/DQveXqhqBxnKTDyRaC5sMSQxilX/A0= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.21.0/go.mod h1:zyGrjRKL2B/6+Jc/m4/otPoZqV2MY9ZjC/aBraRO7zc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0 h1:SUplec5dp06reu1zaXmOXdvqH398taqrDXqUl99jxSc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0/go.mod h1:ho2g4N+ane+swq5I/VBkKWnRDY4kUINH3FuqyZqX/Ug= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.45.0 h1:klTViGcsvLCd1xN3rZzfZ12NslC/OimbmR+k+A006RI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.45.0/go.mod h1:jRsK04CWmXuY8A0O+wMpSf+t90RHZ53o5Qmxn2PQPfk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0 h1:RuynHbfU8JUEw7DyONgkVYg2SVtsoF28y0LGIr69jgA= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0/go.mod h1:qZF+/lBs71APw8mlnEZcqZHMzqrYrsFiJOv83lX1OGo= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.45.0 h1:pnxy6c/kvNBWdNNFzqpjuJLm9Hjhgk/Q0nY221rwuk0= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.45.0/go.mod h1:qw6YsFapotRwoDhXRZvljzaOvCQB7UfnafEJagpN2TA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 h1:QRefszxJmfPdjXUUm3j6iDzY03mTPXMjqErFqQ67vUg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0/go.mod h1:Tiz03lTBVBrm7eWZBOidzEaYaJa8tjwGUGv6d8mlTyk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJlUOQzhCpzQpFETGby7EdqjI1wsd0W+6Gg1SCTU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 h1:fG5MCxGz8+2VtrN/WgqSpJFctVz24gpxj8CxkKmc8Ww= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0/go.mod h1:BmAYTn+3ysbRe+IU2msxmf5Rx3g6DHvex+tWI3LdhYI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 h1:lgh3PiVrRUWMLOVSkQicxzZll5NjF1r+AtsX1XRIHw0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0/go.mod h1:5Cnhth3m/AgOeTgE3ex12pPmiu/gGtZit03kSzx9X7s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0 h1:QBajQ2SrwQijzHyZbQlPsuIzpl/ll8DY6wPWsajeGcI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0/go.mod h1:08ZQLjrPLQ6R4kAXvuOvODEer5Yh4CoFvll5qB2BCI8= go.opentelemetry.io/otel/log v0.20.0 h1:/5i0vuHxCLWUfChWG41K9wkM0jafruPw9NU1/RCJirs= go.opentelemetry.io/otel/log v0.20.0/go.mod h1:wOcMcjsZpG8x7Bak7IhSi/lg8wscV2C1VdrKCLPlt0E= +go.opentelemetry.io/otel/log v0.21.0 h1:SLsVDGmtyBrdw8/a2Z0bOIxou/+bN4z56GebH7T0LvA= +go.opentelemetry.io/otel/log v0.21.0/go.mod h1:iReetQrZL9Wyg84cCkOoCmqDHS5RCFfyxC7J+r8fn8g= go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M= +go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s= go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= +go.opentelemetry.io/otel/metric/x v0.67.0 h1:PcicCNZFkZ4bXfSooXdo3WN7RBOVOtjVdo1wD358Uns= go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw= +go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA= go.opentelemetry.io/otel/sdk/log v0.20.0 h1:vM3xI7TQgKPiSghe6urZtAkyFY7SodrSpC83CffDFuY= go.opentelemetry.io/otel/sdk/log v0.20.0/go.mod h1:Knej2nmsTUzN79T2eeXdRsjjPcoxoq2pUyUHz9TFyyU= +go.opentelemetry.io/otel/sdk/log v0.21.0 h1:QsE7XSR0ktQdKmRKGnR+f1ObGF32WG+7MER/P9KgmYc= +go.opentelemetry.io/otel/sdk/log v0.21.0/go.mod h1:m9mApjCoD2/1QuKCAptjv+BrG9WKOvQLVdNx+iBldTo= go.opentelemetry.io/otel/sdk/log/logtest v0.20.0 h1:OqdRZ1guyzamK3M6LlRsmGqRrjkHWw6WZOKKli5ELpg= go.opentelemetry.io/otel/sdk/log/logtest v0.20.0/go.mod h1:PuMIlm7zAt7c3z8zfOI5ox4iT1Z87We+PF6YoINux/M= +go.opentelemetry.io/otel/sdk/log/logtest v0.21.0 h1:X+JBBgKlswCGYsmgL0CnoUUtlE//VB345c84jYAYkdQ= go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o= +go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA= go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag= +go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc= go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= +golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad h1:3iLyITS/sySRwbUKoC7ogfj2Yr1Cjs0pfaRKj5U5HEw= google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:KdNqO+rCIWgFumrNBSEDlDNrkrQnpkax7Tv1WxNY8V4= +google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d h1:FarXi840EJWSHYTN3ERkADbPWjl307+FGrA22KAVjjc= +google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d/go.mod h1:K/+WGbmBY7aNW1HDw1fJnKYo10i0DkAX6pows00dLig= google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad h1:45WmJvIV6C2+O/jjLkPUH+F3aOj/1miDoU2DD0+NWbg= google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d h1:IL4hdHzcUv2l/gcg98/Rj3FbtE6axwqslOW8SW0C+S0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ= +google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pgmanager/cmd/client.go b/pgmanager/cmd/client.go index c97a9a8..58e8c04 100644 --- a/pgmanager/cmd/client.go +++ b/pgmanager/cmd/client.go @@ -318,7 +318,7 @@ func (cmd *RoleListCmd) Run(ctx server.Cmd) error { } // Roles list summary - summary := tui.TableSummary("roles", uint(roles.Count), roles.Offset, roles.Limit) + summary := tui.TableSummary("roles", uint(roles.Count), uint(len(roles.Body)), roles.Offset, roles.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -397,7 +397,7 @@ func (cmd *DatabaseListCmd) Run(ctx server.Cmd) error { } // Databases list summary - summary := tui.TableSummary("databases", uint(databases.Count), databases.Offset, databases.Limit) + summary := tui.TableSummary("databases", uint(databases.Count), uint(len(databases.Body)), databases.Offset, databases.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -473,7 +473,7 @@ func (cmd *SchemaListCmd) Run(ctx server.Cmd) error { } // Schemas list summary - summary := tui.TableSummary("schemas", uint(schemas.Count), schemas.Offset, schemas.Limit) + summary := tui.TableSummary("schemas", uint(schemas.Count), uint(len(schemas.Body)), schemas.Offset, schemas.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -552,7 +552,7 @@ func (cmd *ObjectListCmd) Run(ctx server.Cmd) error { } // Objects list summary - summary := tui.TableSummary("objects", uint(objects.Count), objects.Offset, objects.Limit) + summary := tui.TableSummary("objects", uint(objects.Count), uint(len(objects.Body)), objects.Offset, objects.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -593,7 +593,7 @@ func (cmd *StatementListCmd) Run(ctx server.Cmd) error { } // Statements list summary - summary := tui.TableSummary("statements", uint(statements.Count), statements.Offset, statements.Limit) + summary := tui.TableSummary("statements", uint(statements.Count), uint(len(statements.Body)), statements.Offset, statements.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -629,7 +629,7 @@ func (cmd *TablespaceListCmd) Run(ctx server.Cmd) error { } // Tablespaces list summary - summary := tui.TableSummary("tablespaces", uint(tablespaces.Count), tablespaces.Offset, tablespaces.Limit) + summary := tui.TableSummary("tablespaces", uint(tablespaces.Count), uint(len(tablespaces.Body)), tablespaces.Offset, tablespaces.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -705,7 +705,7 @@ func (cmd *ConnectionListCmd) Run(ctx server.Cmd) error { } // Connections list summary - summary := tui.TableSummary("connections", uint(connections.Count), connections.Offset, connections.Limit) + summary := tui.TableSummary("connections", uint(connections.Count), uint(len(connections.Body)), connections.Offset, connections.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -753,7 +753,7 @@ func (cmd *ReplicationSlotListCmd) Run(ctx server.Cmd) error { } // Replication slots list summary - summary := tui.TableSummary("replication slots", uint(slots.Count), slots.Offset, slots.Limit) + summary := tui.TableSummary("replication slots", uint(slots.Count), uint(len(slots.Body)), slots.Offset, slots.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -813,7 +813,7 @@ func (cmd *ExtensionListCmd) Run(ctx server.Cmd) error { } // Extensions list summary - summary := tui.TableSummary("extensions", uint(extensions.Count), extensions.Offset, extensions.Limit) + summary := tui.TableSummary("extensions", uint(extensions.Count), uint(len(extensions.Body)), extensions.Offset, extensions.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -867,7 +867,7 @@ func (cmd *SettingListCmd) Run(ctx server.Cmd) error { } // Settings list summary - summary := tui.TableSummary("settings", uint(settings.Count), settings.Offset, settings.Limit) + summary := tui.TableSummary("settings", uint(settings.Count), uint(len(settings.Body)), settings.Offset, settings.Limit) if _, err := summary.Write(os.Stdout); err != nil { return err } @@ -900,7 +900,7 @@ func (cmd *SettingCategoryListCmd) Run(ctx server.Cmd) error { } // Categories list summary - summary := tui.TableSummary("categories", uint(categories.Count), 0, nil) + summary := tui.TableSummary("categories", uint(categories.Count), uint(len(categoryNames)), 0, nil) if _, err := summary.Write(os.Stdout); err != nil { return err } diff --git a/pgmanager/cmd/server.go b/pgmanager/cmd/server.go index d9ab9f8..08d8c22 100644 --- a/pgmanager/cmd/server.go +++ b/pgmanager/cmd/server.go @@ -89,9 +89,13 @@ func (runner *RunServer) Run(ctx server.Cmd) error { // Serve the MCP endpoint handler := mcpServer.Handler() - return router.RegisterPath("/mcp", nil, httprequest.NewPathItem("MCP", "Management Control Protocol endpoint"). - Post(handler.ServeHTTP, "Send a message to the MCP server"). - Delete(handler.ServeHTTP, "Close an MCP session"), + return router.RegisterPath("/mcp", nil, httprequest.NewPathItem("MCP", "Management Control Protocol endpoint").Tag("MCP"). + Post(handler.ServeHTTP, func(op httprequest.PathOperation) { + op.Summary("Send a message to the MCP server") + }). + Delete(handler.ServeHTTP, func(op httprequest.PathOperation) { + op.Summary("Close an MCP session") + }), ) }) diff --git a/pgmanager/httphandlers/connection.go b/pgmanager/httphandlers/connection.go index 5a0ea0f..c2eaee6 100644 --- a/pgmanager/httphandlers/connection.go +++ b/pgmanager/httphandlers/connection.go @@ -13,7 +13,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -30,35 +29,38 @@ func RegisterConnectionHandlers(manager *manager.Manager, router *httprouter.Rou router.Spec().AddTag("Connections", "Cluster Connection Operations") return errors.Join( - router.RegisterPath("connection", nil, httprequest.NewPathItem("Connections", "Manage PostgreSQL connections"). + router.RegisterPath("connection", nil, httprequest.NewPathItem("Connections", "Manage PostgreSQL connections").Tag("Connections"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListConnections(w, r, manager) }, - "List connections", - openapi.WithTags("Connections"), - openapi.WithQuery(jsonschema.MustFor[schema.ConnectionListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ConnectionList]()), + func(op httprequest.PathOperation) { + op.Summary("List connections") + op.Query(jsonschema.MustFor[schema.ConnectionListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ConnectionList]()) + }, ), ), - router.RegisterPath("connection/{pid}", jsonschema.MustFor[ConnectionPathParams](), httprequest.NewPathItem("Connection", "Manage a PostgreSQL connection"). + router.RegisterPath("connection/{pid}", jsonschema.MustFor[ConnectionPathParams](), httprequest.NewPathItem("Connection", "Manage a PostgreSQL connection").Tag("Connections"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetConnection(w, r, manager, r.PathValue("pid")) }, - "Get connection", - openapi.WithTags("Connections"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Connection]()), - openapi.WithErrorResponse(http.StatusNotFound, "Process not found"), + func(op httprequest.PathOperation) { + op.Summary("Get connection") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Connection]()) + op.ErrorResponse(http.StatusNotFound, "Process not found") + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteConnection(w, r, manager, r.PathValue("pid")) }, - "Drop a connection", - openapi.WithTags("Connections"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Connection]()), - openapi.WithErrorResponse(http.StatusNotFound, "Process not found"), + func(op httprequest.PathOperation) { + op.Summary("Drop a connection") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Connection]()) + op.ErrorResponse(http.StatusNotFound, "Process not found") + }, ), ), ) diff --git a/pgmanager/httphandlers/database.go b/pgmanager/httphandlers/database.go index 6cad021..cde38bf 100644 --- a/pgmanager/httphandlers/database.go +++ b/pgmanager/httphandlers/database.go @@ -12,10 +12,9 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // TYPES type DatabasePathParams struct { @@ -26,68 +25,73 @@ type ForceQueryParams struct { Force bool `json:"force" query:"force" help:"Force the operation, even when there are active connections to the database."` } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // LIFECYCLE func RegisterDatabaseHandlers(manager *manager.Manager, router *httprouter.Router) error { router.Spec().AddTag("Databases", "Database Operations") return errors.Join( - router.RegisterPath("database", nil, httprequest.NewPathItem("Databases", "Manage PostgreSQL databases"). + router.RegisterPath("database", nil, httprequest.NewPathItem("Databases", "Manage PostgreSQL databases").Tag("Databases"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListDatabases(w, r, manager) }, - "List databases", - openapi.WithTags("Databases"), - openapi.WithQuery(jsonschema.MustFor[schema.DatabaseListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.DatabaseList]()), + func(op httprequest.PathOperation) { + op.Summary("List databases") + op.Query(jsonschema.MustFor[schema.DatabaseListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.DatabaseList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateDatabase(w, r, manager) }, - "Create database", - openapi.WithTags("Databases"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.DatabaseMeta]()), - openapi.WithJSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Database]()), + func(op httprequest.PathOperation) { + op.Summary("Create database") + op.RequestBody(jsonschema.MustFor[schema.DatabaseMeta]()) + op.JSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Database]()) + }, ), ), - router.RegisterPath("database/{database}", jsonschema.MustFor[DatabasePathParams](), httprequest.NewPathItem("Database", "Manage a PostgreSQL database"). + router.RegisterPath("database/{database}", jsonschema.MustFor[DatabasePathParams](), httprequest.NewPathItem("Database", "Manage a PostgreSQL database").Tag("Databases"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetDatabase(w, r, manager, r.PathValue("database")) }, - "Get database", - openapi.WithTags("Databases"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()), - openapi.WithErrorResponse(http.StatusNotFound, "Database not found"), + func(op httprequest.PathOperation) { + op.Summary("Get database") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()) + op.ErrorResponse(http.StatusNotFound, "Database not found") + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteDatabase(w, r, manager, r.PathValue("database")) }, - "Delete database", - openapi.WithTags("Databases"), - openapi.WithQuery(jsonschema.MustFor[ForceQueryParams]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()), - openapi.WithErrorResponse(http.StatusNotFound, "Database not found"), + func(op httprequest.PathOperation) { + op.Summary("Delete database") + op.Query(jsonschema.MustFor[ForceQueryParams]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()) + op.ErrorResponse(http.StatusNotFound, "Database not found") + }, ). Patch( func(w http.ResponseWriter, r *http.Request) { _ = UpdateDatabase(w, r, manager, r.PathValue("database")) }, - "Update database", - openapi.WithTags("Databases"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.DatabaseMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()), - openapi.WithErrorResponse(http.StatusNotFound, "Database not found"), + func(op httprequest.PathOperation) { + op.Summary("Update database") + op.RequestBody(jsonschema.MustFor[schema.DatabaseMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Database]()) + op.ErrorResponse(http.StatusNotFound, "Database not found") + }, ), ), ) } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // PUBLIC METHODS func ListDatabases(w http.ResponseWriter, r *http.Request, manager *manager.Manager) error { diff --git a/pgmanager/httphandlers/extension.go b/pgmanager/httphandlers/extension.go index 9f7318d..af1d937 100644 --- a/pgmanager/httphandlers/extension.go +++ b/pgmanager/httphandlers/extension.go @@ -12,7 +12,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -34,42 +33,47 @@ func RegisterExtensionHandlers(manager *manager.Manager, router *httprouter.Rout router.Spec().AddTag("Extensions", "Database Extension Operations") return errors.Join( - router.RegisterPath("extension", nil, httprequest.NewPathItem("Extensions", "Manage PostgreSQL extensions"). + router.RegisterPath("extension", nil, httprequest.NewPathItem("Extensions", "Manage PostgreSQL extensions").Tag("Extensions"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListExtensions(w, r, manager) }, - "List extensions", - openapi.WithTags("Extensions"), - openapi.WithQuery(jsonschema.MustFor[schema.ExtensionListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ExtensionList]()), + func(op httprequest.PathOperation) { + op.Summary("List extensions") + op.Query(jsonschema.MustFor[schema.ExtensionListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ExtensionList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateExtension(w, r, manager) }, - "Install extension into a database", - openapi.WithTags("Extensions"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.ExtensionMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Extension]()), + func(op httprequest.PathOperation) { + op.Summary("Install extension into a database") + op.RequestBody(jsonschema.MustFor[schema.ExtensionMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Extension]()) + }, ), ), - router.RegisterPath("extension/{extension}", jsonschema.MustFor[ExtensionPathParams](), httprequest.NewPathItem("Extension", "Manage a PostgreSQL extension"). + router.RegisterPath("extension/{extension}", jsonschema.MustFor[ExtensionPathParams](), httprequest.NewPathItem("Extension", "Manage a PostgreSQL extension").Tag("Extensions"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetExtension(w, r, manager, r.PathValue("extension")) }, - "Get extension", - openapi.WithTags("Extensions"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Extension]()), + func(op httprequest.PathOperation) { + op.Summary("Get extension") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Extension]()) + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteExtension(w, r, manager, r.PathValue("extension")) }, - "Uninstall extension from one or more databases", - openapi.WithTags("Extensions"), - openapi.WithQuery(jsonschema.MustFor[ExtensionDeleteQueryParams]()), + func(op httprequest.PathOperation) { + op.Summary("Uninstall extension from one or more databases") + op.Query(jsonschema.MustFor[ExtensionDeleteQueryParams]()) + op.Description("Delete an extension from the specified databases") + }, ), ), ) diff --git a/pgmanager/httphandlers/object.go b/pgmanager/httphandlers/object.go index b1cf7d1..c1ffc3e 100644 --- a/pgmanager/httphandlers/object.go +++ b/pgmanager/httphandlers/object.go @@ -11,7 +11,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -30,25 +29,27 @@ func RegisterObjectHandlers(manager *manager.Manager, router *httprouter.Router) router.Spec().AddTag("Objects", "Object Operations") return errors.Join( - router.RegisterPath("object", nil, httprequest.NewPathItem("Objects", "Manage PostgreSQL objects"). + router.RegisterPath("object", nil, httprequest.NewPathItem("Objects", "Manage PostgreSQL objects").Tag("Objects"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListObjects(w, r, manager) }, - "List objects", - openapi.WithTags("Objects"), - openapi.WithQuery(jsonschema.MustFor[schema.ObjectListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ObjectList]()), + func(op httprequest.PathOperation) { + op.Summary("List objects") + op.Query(jsonschema.MustFor[schema.ObjectListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ObjectList]()) + }, ), ), - router.RegisterPath("object/{database}/{schema}/{name}", jsonschema.MustFor[ObjectPathParams](), httprequest.NewPathItem("Objects", "Manage PostgreSQL objects"). + router.RegisterPath("object/{database}/{schema}/{name}", jsonschema.MustFor[ObjectPathParams](), httprequest.NewPathItem("Objects", "Manage PostgreSQL objects").Tag("Objects"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetObject(w, r, manager, r.PathValue("database"), r.PathValue("schema"), r.PathValue("name")) }, - "Get object", - openapi.WithTags("Objects"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Object]()), + func(op httprequest.PathOperation) { + op.Summary("Get object") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Object]()) + }, ), ), ) diff --git a/pgmanager/httphandlers/replicationslot.go b/pgmanager/httphandlers/replicationslot.go index 5fe2d0a..95b556b 100644 --- a/pgmanager/httphandlers/replicationslot.go +++ b/pgmanager/httphandlers/replicationslot.go @@ -13,7 +13,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -30,44 +29,48 @@ func RegisterReplicationSlotHandlers(manager *manager.Manager, router *httproute router.Spec().AddTag("Replication Slots", "Manage PostgreSQL replication slots") return errors.Join( - router.RegisterPath("replication-slot", nil, httprequest.NewPathItem("Replication Slots", "Manage PostgreSQL replication slots"). + router.RegisterPath("replication-slot", nil, httprequest.NewPathItem("Replication Slots", "Manage PostgreSQL replication slots").Tag("Replication Slots"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListReplicationSlots(w, r, manager) }, - "List replication slots", - openapi.WithTags("Replication Slots"), - openapi.WithQuery(jsonschema.MustFor[schema.ReplicationSlotListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlotList]()), + func(op httprequest.PathOperation) { + op.Summary("List replication slots") + op.Query(jsonschema.MustFor[schema.ReplicationSlotListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlotList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateReplicationSlot(w, r, manager) }, - "Create replication slot", - openapi.WithTags("Replication Slots"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.ReplicationSlotMeta]()), - openapi.WithJSONResponse(http.StatusCreated, jsonschema.MustFor[schema.ReplicationSlot]()), + func(op httprequest.PathOperation) { + op.Summary("Create replication slot") + op.RequestBody(jsonschema.MustFor[schema.ReplicationSlotMeta]()) + op.JSONResponse(http.StatusCreated, jsonschema.MustFor[schema.ReplicationSlot]()) + }, ), ), - router.RegisterPath("replication-slot/{name}", jsonschema.MustFor[ReplicationSlotPathParams](), httprequest.NewPathItem("Replication Slot", "Manage a PostgreSQL replication slot"). + router.RegisterPath("replication-slot/{name}", jsonschema.MustFor[ReplicationSlotPathParams](), httprequest.NewPathItem("Replication Slot", "Manage a PostgreSQL replication slot").Tag("Replication Slots"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetReplicationSlot(w, r, manager, r.PathValue("name")) }, - "Get replication slot", - openapi.WithTags("Replication Slots"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlot]()), - openapi.WithErrorResponse(http.StatusNotFound, "Replication slot not found"), + func(op httprequest.PathOperation) { + op.Summary("Get replication slot") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlot]()) + op.ErrorResponse(http.StatusNotFound, "Replication slot not found") + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteReplicationSlot(w, r, manager, r.PathValue("name")) }, - "Drop a replication slot", - openapi.WithTags("Replication Slots"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlot]()), - openapi.WithErrorResponse(http.StatusNotFound, "Replication slot not found"), + func(op httprequest.PathOperation) { + op.Summary("Drop a replication slot") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.ReplicationSlot]()) + op.ErrorResponse(http.StatusNotFound, "Replication slot not found") + }, ), ), ) diff --git a/pgmanager/httphandlers/role.go b/pgmanager/httphandlers/role.go index 0804edf..9804be8 100644 --- a/pgmanager/httphandlers/role.go +++ b/pgmanager/httphandlers/role.go @@ -12,77 +12,81 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // TYPES type RolePathParams struct { Role string `json:"role"` } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // LIFECYCLE func RegisterRoleHandlers(manager *manager.Manager, router *httprouter.Router) error { router.Spec().AddTag("Roles", "Role Operations") return errors.Join( - router.RegisterPath("role", nil, httprequest.NewPathItem("Roles", "Manage PostgreSQL roles"). + router.RegisterPath("role", nil, httprequest.NewPathItem("Roles", "Manage PostgreSQL roles").Tag("Roles"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListRoles(w, r, manager) }, - "List roles", - openapi.WithTags("Roles"), - openapi.WithQuery(jsonschema.MustFor[schema.RoleListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.RoleList]()), + func(op httprequest.PathOperation) { + op.Summary("List roles") + op.Query(jsonschema.MustFor[schema.RoleListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.RoleList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateRole(w, r, manager) }, - "Create role", - openapi.WithTags("Roles"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.RoleMeta]()), - openapi.WithJSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Role]()), + func(op httprequest.PathOperation) { + op.Summary("Create role") + op.RequestBody(jsonschema.MustFor[schema.RoleMeta]()) + op.JSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Role]()) + }, ), ), - router.RegisterPath("role/{role}", jsonschema.MustFor[RolePathParams](), httprequest.NewPathItem("Role", "Manage a PostgreSQL role"). + router.RegisterPath("role/{role}", jsonschema.MustFor[RolePathParams](), httprequest.NewPathItem("Role", "Manage a PostgreSQL role").Tag("Roles"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetRole(w, r, manager, r.PathValue("role")) }, - "Get role", - openapi.WithTags("Roles"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()), - openapi.WithErrorResponse(http.StatusNotFound, "Role not found"), + func(op httprequest.PathOperation) { + op.Summary("Get role") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()) + op.ErrorResponse(http.StatusNotFound, "Role not found") + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteRole(w, r, manager, r.PathValue("role")) }, - "Delete role", - openapi.WithTags("Roles"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()), - openapi.WithErrorResponse(http.StatusNotFound, "Role not found"), + func(op httprequest.PathOperation) { + op.Summary("Delete role") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()) + op.ErrorResponse(http.StatusNotFound, "Role not found") + }, ). Patch( func(w http.ResponseWriter, r *http.Request) { _ = UpdateRole(w, r, manager, r.PathValue("role")) }, - "Update role", - openapi.WithTags("Roles"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.RoleMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()), - openapi.WithErrorResponse(http.StatusNotFound, "Role not found"), + func(op httprequest.PathOperation) { + op.Summary("Update role") + op.RequestBody(jsonschema.MustFor[schema.RoleMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Role]()) + op.ErrorResponse(http.StatusNotFound, "Role not found") + }, ), ), ) } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // PUBLIC METHODS func ListRoles(w http.ResponseWriter, r *http.Request, manager *manager.Manager) error { diff --git a/pgmanager/httphandlers/schema.go b/pgmanager/httphandlers/schema.go index 4d7036b..37b1b4b 100644 --- a/pgmanager/httphandlers/schema.go +++ b/pgmanager/httphandlers/schema.go @@ -12,7 +12,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" types "github.com/mutablelogic/go-server/pkg/types" ) @@ -31,72 +30,78 @@ func RegisterSchemaHandlers(manager *manager.Manager, router *httprouter.Router) router.Spec().AddTag("Schemas", "Schema Operations") return errors.Join( - router.RegisterPath("schema", nil, httprequest.NewPathItem("Schemas", "Manage PostgreSQL schemas"). + router.RegisterPath("schema", nil, httprequest.NewPathItem("Schemas", "Manage PostgreSQL schemas").Tag("Schemas"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListSchemas(w, r, manager, nil) }, - "List all schemas", - openapi.WithTags("Schemas"), - openapi.WithQuery(jsonschema.MustFor[pg.OffsetLimit]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.SchemaList]()), + func(op httprequest.PathOperation) { + op.Summary("List all schemas") + op.Query(jsonschema.MustFor[pg.OffsetLimit]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.SchemaList]()) + }, ), ), - router.RegisterPath("schema/{database}", nil, httprequest.NewPathItem("Schemas", "Manage PostgreSQL schemas"). + router.RegisterPath("schema/{database}", nil, httprequest.NewPathItem("Schemas", "Manage PostgreSQL schemas").Tag("Schemas"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListSchemas(w, r, manager, types.Ptr(r.PathValue("database"))) }, - "List schemas in a specific database", - openapi.WithTags("Schemas"), - openapi.WithQuery(jsonschema.MustFor[pg.OffsetLimit]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.SchemaList]()), + func(op httprequest.PathOperation) { + op.Summary("List schemas in a specific database") + op.Query(jsonschema.MustFor[pg.OffsetLimit]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.SchemaList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateSchema(w, r, manager, r.PathValue("database")) }, - "Create a new schema in a specific database", - openapi.WithTags("Schemas"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.SchemaMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()), - openapi.WithErrorResponse(http.StatusBadRequest, "Invalid request body"), - openapi.WithErrorResponse(http.StatusNotFound, "Database not found"), + func(op httprequest.PathOperation) { + op.Summary("Create a new schema in a specific database") + op.RequestBody(jsonschema.MustFor[schema.SchemaMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()) + op.ErrorResponse(http.StatusBadRequest, "Invalid request body") + op.ErrorResponse(http.StatusNotFound, "Database not found") + }, ), ), - router.RegisterPath("schema/{database}/{namespace}", nil, httprequest.NewPathItem("Schema", "Manage a specific PostgreSQL schema"). + router.RegisterPath("schema/{database}/{namespace}", nil, httprequest.NewPathItem("Schema", "Manage a specific PostgreSQL schema").Tag("Schemas"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetSchema(w, r, manager, r.PathValue("database"), r.PathValue("namespace")) }, - "Get a schema in a specific database", - openapi.WithTags("Schemas"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()), + func(op httprequest.PathOperation) { + op.Summary("Get a schema in a specific database") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()) + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteSchema(w, r, manager, r.PathValue("database"), r.PathValue("namespace")) }, - "Delete a schema in a specific database", - openapi.WithTags("Schemas"), - openapi.WithQuery(jsonschema.MustFor[ForceQueryParams]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()), - openapi.WithErrorResponse(http.StatusNotFound, "Schema not found"), - openapi.WithErrorResponse(http.StatusBadRequest, "Invalid query parameters"), - openapi.WithErrorResponse(http.StatusConflict, "Schema has dependent objects"), + func(op httprequest.PathOperation) { + op.Summary("Delete a schema in a specific database") + op.Query(jsonschema.MustFor[ForceQueryParams]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()) + op.ErrorResponse(http.StatusNotFound, "Schema not found") + op.ErrorResponse(http.StatusBadRequest, "Invalid query parameters") + op.ErrorResponse(http.StatusConflict, "Schema has dependent objects") + }, ). Patch( func(w http.ResponseWriter, r *http.Request) { _ = UpdateSchema(w, r, manager, r.PathValue("database"), r.PathValue("namespace")) }, - "Update a schema in a specific database", - openapi.WithTags("Schemas"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.SchemaMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()), - openapi.WithErrorResponse(http.StatusBadRequest, "Invalid request body"), - openapi.WithErrorResponse(http.StatusNotFound, "Schema not found"), - openapi.WithErrorResponse(http.StatusBadRequest, "Invalid query parameters"), - openapi.WithErrorResponse(http.StatusConflict, "Schema has dependent objects"), + func(op httprequest.PathOperation) { + op.Summary("Update a schema in a specific database") + op.RequestBody(jsonschema.MustFor[schema.SchemaMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Schema]()) + op.ErrorResponse(http.StatusBadRequest, "Invalid request body") + op.ErrorResponse(http.StatusNotFound, "Schema not found") + op.ErrorResponse(http.StatusBadRequest, "Invalid query parameters") + op.ErrorResponse(http.StatusConflict, "Schema has dependent objects") + }, ), ), ) diff --git a/pgmanager/httphandlers/setting.go b/pgmanager/httphandlers/setting.go index b665650..5f857a5 100644 --- a/pgmanager/httphandlers/setting.go +++ b/pgmanager/httphandlers/setting.go @@ -12,7 +12,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -22,45 +21,49 @@ func RegisterSettingHandlers(manager *manager.Manager, router *httprouter.Router router.Spec().AddTag("Settings", "Settings Operations") return errors.Join( - router.RegisterPath("setting", nil, httprequest.NewPathItem("Settings", "Manage PostgreSQL settings"). + router.RegisterPath("setting", nil, httprequest.NewPathItem("Settings", "Manage PostgreSQL settings").Tag("Settings"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListSettings(w, r, manager) }, - "List settings", - openapi.WithTags("Settings"), - openapi.WithQuery(jsonschema.MustFor[schema.SettingListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.SettingList]()), + func(op httprequest.PathOperation) { + op.Summary("List settings") + op.Query(jsonschema.MustFor[schema.SettingListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.SettingList]()) + }, ), ), - router.RegisterPath("setting/category", nil, httprequest.NewPathItem("Settings", "Manage PostgreSQL setting categories"). + router.RegisterPath("setting/category", nil, httprequest.NewPathItem("Settings", "Manage PostgreSQL setting categories").Tag("Settings"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListSettingCategories(w, r, manager) }, - "List setting categories", - openapi.WithTags("Settings"), - openapi.WithQuery(jsonschema.MustFor[schema.SettingCategoryListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.SettingCategoryList]()), + func(op httprequest.PathOperation) { + op.Summary("List setting categories") + op.Query(jsonschema.MustFor[schema.SettingCategoryListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.SettingCategoryList]()) + }, ), ), - router.RegisterPath("setting/{setting}", nil, httprequest.NewPathItem("Settings", "Manage a PostgreSQL setting"). + router.RegisterPath("setting/{setting}", nil, httprequest.NewPathItem("Settings", "Manage a PostgreSQL setting").Tag("Settings"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetSetting(w, r, manager, r.PathValue("setting")) }, - "Get a setting by name", - openapi.WithTags("Settings"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Setting]()), + func(op httprequest.PathOperation) { + op.Summary("Get a setting by name") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Setting]()) + }, ). Patch( func(w http.ResponseWriter, r *http.Request) { _ = UpdateSetting(w, r, manager, r.PathValue("setting")) }, - "Update a setting by name", - openapi.WithTags("Settings"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.SettingMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Setting]()), + func(op httprequest.PathOperation) { + op.Summary("Update a setting by name") + op.RequestBody(jsonschema.MustFor[schema.SettingMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Setting]()) + }, ), ), ) diff --git a/pgmanager/httphandlers/statement.go b/pgmanager/httphandlers/statement.go index 619c305..82b1201 100644 --- a/pgmanager/httphandlers/statement.go +++ b/pgmanager/httphandlers/statement.go @@ -12,7 +12,6 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -22,22 +21,24 @@ func RegisterStatementHandlers(manager *manager.Manager, router *httprouter.Rout router.Spec().AddTag("Statements", "Observe PostgreSQL statement execution statistics") return errors.Join( - router.RegisterPath("statement", nil, httprequest.NewPathItem("Statements", "Observe PostgreSQL statement execution statistics"). + router.RegisterPath("statement", nil, httprequest.NewPathItem("Statements", "Observe PostgreSQL statement execution statistics").Tag("Statements"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListStatements(w, r, manager) }, - "List statements", - openapi.WithTags("Statements"), - openapi.WithQuery(jsonschema.MustFor[schema.StatementListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.StatementList]()), + func(op httprequest.PathOperation) { + op.Summary("List statements") + op.Query(jsonschema.MustFor[schema.StatementListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.StatementList]()) + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = ResetStatementStats(w, r, manager) }, - "Reset statement statistics", - openapi.WithTags("Statements"), + func(op httprequest.PathOperation) { + op.Summary("Reset statement statistics") + }, ), ), ) diff --git a/pgmanager/httphandlers/status.go b/pgmanager/httphandlers/status.go index 901637a..fb0296d 100644 --- a/pgmanager/httphandlers/status.go +++ b/pgmanager/httphandlers/status.go @@ -10,7 +10,6 @@ import ( httprequest "github.com/mutablelogic/go-server/pkg/httprequest" httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) /////////////////////////////////////////////////////////////////////////////// @@ -21,14 +20,14 @@ func RegisterStatusHandlers(manager *manager.Manager, router *httprouter.Router) return errors.Join( // Register Ping Handler - router.RegisterPath("health", nil, httprequest.NewPathItem("Health", "Determine the health of the PostgreSQL server"). + router.RegisterPath("health", nil, httprequest.NewPathItem("Health", "Determine the health of the PostgreSQL server").Tag("Status"). Get( func(w http.ResponseWriter, r *http.Request) { _ = Ping(w, r, manager) }, - "Ping the postgresql server", - openapi.WithTags("Status"), - openapi.WithNoContentResponse(http.StatusNoContent, "PostgreSQL server is healthy"), + func(op httprequest.PathOperation) { + op.Summary("Ping the postgresql server") + }, ), ), ) diff --git a/pgmanager/httphandlers/tablespace.go b/pgmanager/httphandlers/tablespace.go index e9d8066..442838b 100644 --- a/pgmanager/httphandlers/tablespace.go +++ b/pgmanager/httphandlers/tablespace.go @@ -12,10 +12,9 @@ import ( httpresponse "github.com/mutablelogic/go-server/pkg/httpresponse" httprouter "github.com/mutablelogic/go-server/pkg/httprouter" jsonschema "github.com/mutablelogic/go-server/pkg/jsonschema" - openapi "github.com/mutablelogic/go-server/pkg/openapi" ) -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // TYPES type TablespacePathParams struct { @@ -27,67 +26,72 @@ type TablespaceCreateMeta struct { Location string `json:"location" validate:"required" help:"Location for the tablespace"` } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // LIFECYCLE func RegisterTablespaceHandlers(manager *manager.Manager, router *httprouter.Router) error { router.Spec().AddTag("Tablespaces", "Cluster Tablespace Operations") return errors.Join( - router.RegisterPath("tablespace", nil, httprequest.NewPathItem("Tablespaces", "Manage PostgreSQL tablespaces"). + router.RegisterPath("tablespace", nil, httprequest.NewPathItem("Tablespaces", "Manage PostgreSQL tablespaces").Tag("Tablespaces"). Get( func(w http.ResponseWriter, r *http.Request) { _ = ListTablespaces(w, r, manager) }, - "List tablespaces", - openapi.WithTags("Tablespaces"), - openapi.WithQuery(jsonschema.MustFor[schema.TablespaceListRequest]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.TablespaceList]()), + func(op httprequest.PathOperation) { + op.Summary("List tablespaces") + op.Query(jsonschema.MustFor[schema.TablespaceListRequest]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.TablespaceList]()) + }, ). Post( func(w http.ResponseWriter, r *http.Request) { _ = CreateTablespace(w, r, manager) }, - "Create tablespace", - openapi.WithTags("Tablespaces"), - openapi.WithJSONRequest(jsonschema.MustFor[TablespaceCreateMeta]()), - openapi.WithJSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Tablespace]()), + func(op httprequest.PathOperation) { + op.Summary("Create tablespace") + op.RequestBody(jsonschema.MustFor[TablespaceCreateMeta]()) + op.JSONResponse(http.StatusCreated, jsonschema.MustFor[schema.Tablespace]()) + }, ), ), - router.RegisterPath("tablespace/{name}", jsonschema.MustFor[TablespacePathParams](), httprequest.NewPathItem("Tablespace", "Manage a PostgreSQL tablespace"). + router.RegisterPath("tablespace/{name}", jsonschema.MustFor[TablespacePathParams](), httprequest.NewPathItem("Tablespace", "Manage a PostgreSQL tablespace").Tag("Tablespaces"). Get( func(w http.ResponseWriter, r *http.Request) { _ = GetTablespace(w, r, manager, r.PathValue("name")) }, - "Get tablespace", - openapi.WithTags("Tablespaces"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()), - openapi.WithErrorResponse(http.StatusNotFound, "Tablespace not found"), + func(op httprequest.PathOperation) { + op.Summary("Get tablespace") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()) + op.ErrorResponse(http.StatusNotFound, "Tablespace not found") + }, ). Delete( func(w http.ResponseWriter, r *http.Request) { _ = DeleteTablespace(w, r, manager, r.PathValue("name")) }, - "Drop a tablespace", - openapi.WithTags("Tablespaces"), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()), - openapi.WithErrorResponse(http.StatusNotFound, "Tablespace not found"), + func(op httprequest.PathOperation) { + op.Summary("Drop a tablespace") + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()) + op.ErrorResponse(http.StatusNotFound, "Tablespace not found") + }, ). Patch( func(w http.ResponseWriter, r *http.Request) { _ = UpdateTablespace(w, r, manager, r.PathValue("name")) }, - "Update a tablespace", - openapi.WithTags("Tablespaces"), - openapi.WithJSONRequest(jsonschema.MustFor[schema.TablespaceMeta]()), - openapi.WithJSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()), - openapi.WithErrorResponse(http.StatusNotFound, "Tablespace not found"), + func(op httprequest.PathOperation) { + op.Summary("Update a tablespace") + op.RequestBody(jsonschema.MustFor[schema.TablespaceMeta]()) + op.JSONResponse(http.StatusOK, jsonschema.MustFor[schema.Tablespace]()) + op.ErrorResponse(http.StatusNotFound, "Tablespace not found") + }, ), ), ) } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // PUBLIC METHODS func ListTablespaces(w http.ResponseWriter, r *http.Request, manager *manager.Manager) error { diff --git a/pkg/test/container.go b/pkg/test/container.go index 43c7516..5b23692 100644 --- a/pkg/test/container.go +++ b/pkg/test/container.go @@ -25,8 +25,8 @@ type Container struct { // NewContainer creates a new container with the given name and image. func NewContainer(ctx context.Context, name, image string, opt ...Opt) (*Container, error) { - // The name has _unixtime appended to it - name = fmt.Sprintf("%s_%v", name, time.Now().Unix()) + // The name has a high-resolution timestamp appended to reduce collisions between test runs. + name = fmt.Sprintf("%s_%v", name, time.Now().UnixNano()) // Apply the options var o opts diff --git a/pkg/test/opt.go b/pkg/test/opt.go index e9bea76..0dc566d 100644 --- a/pkg/test/opt.go +++ b/pkg/test/opt.go @@ -5,6 +5,7 @@ import ( "strings" // Packages + network "github.com/moby/moby/api/types/network" testcontainers "github.com/testcontainers/testcontainers-go" wait "github.com/testcontainers/testcontainers-go/wait" @@ -107,8 +108,8 @@ func OptPostgres(user, password, database string) Opt { if err := OptPorts(pgxPort)(o); err != nil { return err } - o.appendWaitStrategy(wait.ForSQL(pgxPort, "pgx", func(host string, port string) string { - return postgresURL(user, password, database, host, port) + o.appendWaitStrategy(wait.ForSQL(pgxPort, "pgx", func(host string, port network.Port) string { + return postgresURL(user, password, database, host, port.Port()) })) return nil }