diff --git a/.github/actions/setup-build-deps/action.yml b/.github/actions/setup-build-deps/action.yml new file mode 100644 index 000000000..283eb5c5e --- /dev/null +++ b/.github/actions/setup-build-deps/action.yml @@ -0,0 +1,58 @@ +name: 'Setup Build Dependencies' +description: 'Install dependencies and generate protobuf files for building backrest' + +inputs: + go-version: + description: 'Go version to use' + required: false + default: '1.24' + node-version: + description: 'Node.js version to use' + required: false + default: '20' + setup-pnpm: + description: 'Whether to setup pnpm' + required: false + default: 'false' + pnpm-version: + description: 'pnpm version to use when setup-pnpm is true' + required: false + default: '9' + +runs: + using: 'composite' + steps: + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ inputs.go-version }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + + - name: Setup pnpm + if: ${{ inputs.setup-pnpm == 'true' }} + uses: pnpm/action-setup@v4 + with: + version: ${{ inputs.pnpm-version }} + + - name: Install buf + shell: bash + run: go install github.com/bufbuild/buf/cmd/buf@latest + + - name: Install protoc plugins + shell: bash + run: | + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest + + - name: Install protoc-gen-es + shell: bash + run: npm install -g @bufbuild/protoc-gen-es + + - name: Generate protobuf files + shell: bash + run: cd proto && buf generate diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 1a1536c12..f7ba38174 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -26,20 +26,13 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Set up Go - uses: actions/setup-go@v4 + - name: Setup build dependencies + uses: ./.github/actions/setup-build-deps with: go-version: "1.24" - - - name: Setup NodeJS - uses: actions/setup-node@v4 - with: node-version: "20" - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 + setup-pnpm: "true" + pnpm-version: "9" - name: Login to Docker Hub if: ${{ !inputs.snapshot }} @@ -65,6 +58,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }} + GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} + PROJECT_NAME: ${{ github.event.repository.name }} - name: Upload Build Artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d60d1d07..e3e18b843 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,10 +22,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 + - name: Setup build dependencies + uses: ./.github/actions/setup-build-deps with: go-version: "1.24" + node-version: "20" - name: Install gotestsum run: go install gotest.tools/gotestsum@latest @@ -37,20 +38,21 @@ jobs: gzip -c /dev/null > webui/dist/index.html.gz - name: Build - run: go build ./... + run: go build -tags=sqlite3_dotlk ./... - name: Test - run: PATH=$(pwd):$PATH gotestsum ./... -- --race + run: PATH=$(pwd):$PATH gotestsum ./... -- --race -tags=sqlite3_dotlk test-win: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v4 + - name: Setup build dependencies + uses: ./.github/actions/setup-build-deps with: go-version: "1.24" + node-version: "20" - name: Create Fake WebUI Sources run: | diff --git a/.gitignore b/.gitignore index 70945c657..bb8c42473 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ cmd/backrest/backrest .idea/ .pnpm-store/ webui/dist-backup/ +gen/go/ +webui/gen/ts/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d4f2a32c1..81edf1fc4 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -10,6 +10,8 @@ version: 1 env: - BACKREST_BUILD_VERSION={{.Version}} + - GITHUB_OWNER={{ if index .Env "GITHUB_REPOSITORY_OWNER" }}{{ .Env.GITHUB_REPOSITORY_OWNER }}{{ else }}garethgeorge{{ end }} + - PROJECT_NAME={{ if index .Env "PROJECT_NAME" }}{{ .Env.PROJECT_NAME }}{{ else }}backrest{{ end }} before: hooks: @@ -77,8 +79,8 @@ archives: dockers: - image_templates: - - garethgeorge/backrest:{{ .Tag }}-alpine-amd64 - - ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64 + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" dockerfile: Dockerfile.alpine use: buildx build_flag_templates: @@ -88,8 +90,8 @@ dockers: - ./ - image_templates: - - garethgeorge/backrest:{{ .Tag }}-alpine-arm64 - - ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64 + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" dockerfile: Dockerfile.alpine goarch: arm64 use: buildx @@ -100,8 +102,8 @@ dockers: - ./ - image_templates: - - garethgeorge/backrest:{{ .Tag }}-scratch-arm64 - - ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64 + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" dockerfile: Dockerfile.scratch goarch: arm64 use: buildx @@ -112,8 +114,8 @@ dockers: - ./ - image_templates: - - garethgeorge/backrest:{{ .Tag }}-scratch-amd64 - - ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64 + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" dockerfile: Dockerfile.scratch use: buildx build_flag_templates: @@ -123,8 +125,8 @@ dockers: - ./ - image_templates: - - garethgeorge/backrest:{{ .Tag }}-scratch-armv6 - - ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6 + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" dockerfile: Dockerfile.scratch use: buildx goarch: arm @@ -136,100 +138,100 @@ dockers: - ./ docker_manifests: - - name_template: "garethgeorge/backrest:latest" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "ghcr.io/garethgeorge/backrest:latest" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "garethgeorge/backrest:v{{ .Major }}" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "garethgeorge/backrest:{{ .Tag }}" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "ghcr.io/garethgeorge/backrest:{{ .Tag }}" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "garethgeorge/backrest:latest-alpine" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "ghcr.io/garethgeorge/backrest:latest-alpine" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64" - - name_template: "garethgeorge/backrest:scratch" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "ghcr.io/garethgeorge/backrest:scratch" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "garethgeorge/backrest:v{{ .Major }}-scratch" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}-scratch" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}-scratch" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}-scratch" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "garethgeorge/backrest:{{ .Tag }}-scratch" - image_templates: - - "garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "garethgeorge/backrest:{{ .Tag }}-scratch-armv6" - - name_template: "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch" - image_templates: - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64" - - "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:latest" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:latest" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}.{{ .Minor }}" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}.{{ .Minor }}" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:latest-alpine" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:latest-alpine" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-alpine-arm64" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:scratch" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:scratch" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}-scratch" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}-scratch" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}.{{ .Minor }}-scratch" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:v{{ .Major }}.{{ .Minor }}-scratch" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch" + image_templates: + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" + - name_template: "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-amd64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-arm64" + - "ghcr.io/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}:{{ .Tag }}-scratch-armv6" brews: - - name: backrest - homepage: https://github.com/garethgeorge/backrest + - name: "{{ .Env.PROJECT_NAME }}" + homepage: "https://github.com/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}" description: "Backrest is a web UI and orchestrator for restic backup." - url_template: "https://github.com/garethgeorge/backrest/releases/download/{{ .Tag }}/{{ .ArtifactName }}" + url_template: "https://github.com/{{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}/releases/download/{{ .Tag }}/{{ .ArtifactName }}" commit_author: name: goreleaserbot email: bot@goreleaser.com repository: - owner: garethgeorge + owner: "{{ .Env.GITHUB_OWNER }}" name: homebrew-backrest-tap branch: main token: "{{ .Env.HOMEBREW_GITHUB_TOKEN }}" @@ -248,5 +250,5 @@ changelog: release: github: - owner: garethgeorge - name: backrest + owner: "{{ .Env.GITHUB_OWNER }}" + name: "{{ .Env.PROJECT_NAME }}" diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..52aa9a905 --- /dev/null +++ b/Makefile @@ -0,0 +1,90 @@ +.PHONY: all clean build build-go build-ui build-ui-windows generate-proto install-deps install-deps-go install-deps-ui test test-go run dev help + +# Default target +all: build + +# Help target +help: + @echo "Backrest Build System" + @echo "=====================" + @echo "" + @echo "Main targets:" + @echo " all - Build everything (default)" + @echo " build - Build the complete application (UI + Go backend)" + @echo " run - Run the application (builds if needed, Unix/Linux/macOS only)" + @echo " dev - Start development servers (UI dev server)" + @echo "" + @echo "Component builds:" + @echo " build-go - Build the Go backend only" + @echo " build-ui - Build the web UI (Unix)" + @echo " build-ui-windows - Build the web UI (Windows)" + @echo "" + @echo "Code generation:" + @echo " generate-proto - Generate protobuf files (requires buf/protoc tools)" + @echo "" + @echo "Dependencies:" + @echo " install-deps - Install all dependencies (Go + UI)" + @echo " install-deps-go - Install Go dependencies" + @echo " install-deps-ui - Install UI dependencies (pnpm)" + @echo "" + @echo "Testing:" + @echo " test - Run all tests" + @echo " test-go - Run Go tests only" + @echo "" + @echo "Cleanup:" + @echo " clean - Clean build artifacts" + @echo "" + @echo "Note: Generated protobuf files (gen/go/, webui/gen/ts/) are not tracked in git." + @echo " They are automatically generated when running 'make build' or 'make all'." + @echo " Run 'make generate-proto' manually if you only want to regenerate proto files." + +# Install all dependencies +install-deps: install-deps-go install-deps-ui + +# Install Go dependencies +install-deps-go: + go mod download + +# Install UI dependencies +install-deps-ui: + cd webui && pnpm install + +# Generate protobuf files (requires buf and protoc tools) +generate-proto: + cd proto && buf generate + +# Build web UI for Unix +build-ui: + cd webui && pnpm run build + +# Build web UI for Windows +build-ui-windows: + cd webui && pnpm run build-windows + +# Build Go backend (requires UI build artifacts to embed) +build-go: build-ui + cd cmd/backrest && go build -tags=sqlite3_dotlk . + +# Build everything +build: generate-proto build-go + +# Run tests +test: test-go + +# Run Go tests +test-go: + go test ./... -tags=sqlite3_dotlk + +# Run the application (Unix/Linux/macOS) +run: build + ./cmd/backrest/backrest + +# Start development mode (UI dev server) +dev: + cd webui && pnpm run start + +# Clean build artifacts +clean: + cd webui && pnpm run clean + rm -f cmd/backrest/backrest + rm -f backrest diff --git a/README.md b/README.md index 9dbf9aa42..fadd5fbed 100644 --- a/README.md +++ b/README.md @@ -269,11 +269,28 @@ npm install -g @bufbuild/protoc-gen-es ## Compiling +You can use the provided Makefile for a streamlined build process: + +```sh +# Install dependencies and build everything +make install-deps +make build + +# Or simply +make all +``` + +For manual builds: + ```sh -(cd webui && npm i && npm run build) +(cd webui && pnpm i && pnpm run build) (cd cmd/backrest && go build .) ``` +Run `make help` to see all available build targets. + +**Note**: Generated protobuf files (`gen/go/`, `webui/gen/ts/`) are not tracked in git. They are generated locally and are required for builds. The `make build` command automatically generates these files, so you can simply run `make build` on a fresh clone. Run `make generate-proto` manually if you only want to regenerate proto files without building. + ## Using VSCode Dev Containers You can also use VSCode with [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension to quickly get up and running with a working development and debugging environment. diff --git a/gen/go/google/api/annotations.pb.go b/gen/go/google/api/annotations.pb.go deleted file mode 100644 index 9c17136ea..000000000 --- a/gen/go/google/api/annotations.pb.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: google/api/annotations.proto - -package annotations - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*HttpRule)(nil), - Field: 72295728, - Name: "google.api.http", - Tag: "bytes,72295728,opt,name=http", - Filename: "google/api/annotations.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // See `HttpRule`. - // - // optional google.api.HttpRule http = 72295728; - E_Http = &file_google_api_annotations_proto_extTypes[0] -) - -var File_google_api_annotations_proto protoreflect.FileDescriptor - -const file_google_api_annotations_proto_rawDesc = "" + - "\n" + - "\x1cgoogle/api/annotations.proto\x12\n" + - "google.api\x1a\x15google/api/http.proto\x1a google/protobuf/descriptor.proto:K\n" + - "\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0ΚΌ\" \x01(\v2\x14.google.api.HttpRuleR\x04httpBn\n" + - "\x0ecom.google.apiB\x10AnnotationsProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3" - -var file_google_api_annotations_proto_goTypes = []any{ - (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*HttpRule)(nil), // 1: google.api.HttpRule -} -var file_google_api_annotations_proto_depIdxs = []int32{ - 0, // 0: google.api.http:extendee -> google.protobuf.MethodOptions - 1, // 1: google.api.http:type_name -> google.api.HttpRule - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_annotations_proto_init() } -func file_google_api_annotations_proto_init() { - if File_google_api_annotations_proto != nil { - return - } - file_google_api_http_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_api_annotations_proto_rawDesc), len(file_google_api_annotations_proto_rawDesc)), - NumEnums: 0, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_annotations_proto_goTypes, - DependencyIndexes: file_google_api_annotations_proto_depIdxs, - ExtensionInfos: file_google_api_annotations_proto_extTypes, - }.Build() - File_google_api_annotations_proto = out.File - file_google_api_annotations_proto_goTypes = nil - file_google_api_annotations_proto_depIdxs = nil -} diff --git a/gen/go/google/api/http.pb.go b/gen/go/google/api/http.pb.go deleted file mode 100644 index 212e065e5..000000000 --- a/gen/go/google/api/http.pb.go +++ /dev/null @@ -1,724 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: google/api/http.proto - -package annotations - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -type Http struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Http) Reset() { - *x = Http{} - mi := &file_google_api_http_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Http) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Http) ProtoMessage() {} - -func (x *Http) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Http.ProtoReflect.Descriptor instead. -func (*Http) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{0} -} - -func (x *Http) GetRules() []*HttpRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *Http) GetFullyDecodeReservedExpansion() bool { - if x != nil { - return x.FullyDecodeReservedExpansion - } - return false -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They -// are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL -// query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP -// request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -type HttpRule struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax - // details. - Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - // - // Types that are valid to be assigned to Pattern: - // - // *HttpRule_Get - // *HttpRule_Put - // *HttpRule_Post - // *HttpRule_Delete - // *HttpRule_Patch - // *HttpRule_Custom - Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HttpRule) Reset() { - *x = HttpRule{} - mi := &file_google_api_http_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HttpRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HttpRule) ProtoMessage() {} - -func (x *HttpRule) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HttpRule.ProtoReflect.Descriptor instead. -func (*HttpRule) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{1} -} - -func (x *HttpRule) GetSelector() string { - if x != nil { - return x.Selector - } - return "" -} - -func (x *HttpRule) GetPattern() isHttpRule_Pattern { - if x != nil { - return x.Pattern - } - return nil -} - -func (x *HttpRule) GetGet() string { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Get); ok { - return x.Get - } - } - return "" -} - -func (x *HttpRule) GetPut() string { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Put); ok { - return x.Put - } - } - return "" -} - -func (x *HttpRule) GetPost() string { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Post); ok { - return x.Post - } - } - return "" -} - -func (x *HttpRule) GetDelete() string { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Delete); ok { - return x.Delete - } - } - return "" -} - -func (x *HttpRule) GetPatch() string { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Patch); ok { - return x.Patch - } - } - return "" -} - -func (x *HttpRule) GetCustom() *CustomHttpPattern { - if x != nil { - if x, ok := x.Pattern.(*HttpRule_Custom); ok { - return x.Custom - } - } - return nil -} - -func (x *HttpRule) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *HttpRule) GetResponseBody() string { - if x != nil { - return x.ResponseBody - } - return "" -} - -func (x *HttpRule) GetAdditionalBindings() []*HttpRule { - if x != nil { - return x.AdditionalBindings - } - return nil -} - -type isHttpRule_Pattern interface { - isHttpRule_Pattern() -} - -type HttpRule_Get struct { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"` -} - -type HttpRule_Put struct { - // Maps to HTTP PUT. Used for replacing a resource. - Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"` -} - -type HttpRule_Post struct { - // Maps to HTTP POST. Used for creating a resource or performing an action. - Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"` -} - -type HttpRule_Delete struct { - // Maps to HTTP DELETE. Used for deleting a resource. - Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` -} - -type HttpRule_Patch struct { - // Maps to HTTP PATCH. Used for updating a resource. - Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"` -} - -type HttpRule_Custom struct { - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"` -} - -func (*HttpRule_Get) isHttpRule_Pattern() {} - -func (*HttpRule_Put) isHttpRule_Pattern() {} - -func (*HttpRule_Post) isHttpRule_Pattern() {} - -func (*HttpRule_Delete) isHttpRule_Pattern() {} - -func (*HttpRule_Patch) isHttpRule_Pattern() {} - -func (*HttpRule_Custom) isHttpRule_Pattern() {} - -// A custom pattern is used for defining custom HTTP verb. -type CustomHttpPattern struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The name of this custom HTTP verb. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // The path matched by this custom verb. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CustomHttpPattern) Reset() { - *x = CustomHttpPattern{} - mi := &file_google_api_http_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CustomHttpPattern) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CustomHttpPattern) ProtoMessage() {} - -func (x *CustomHttpPattern) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CustomHttpPattern.ProtoReflect.Descriptor instead. -func (*CustomHttpPattern) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{2} -} - -func (x *CustomHttpPattern) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -func (x *CustomHttpPattern) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -var File_google_api_http_proto protoreflect.FileDescriptor - -const file_google_api_http_proto_rawDesc = "" + - "\n" + - "\x15google/api/http.proto\x12\n" + - "google.api\"y\n" + - "\x04Http\x12*\n" + - "\x05rules\x18\x01 \x03(\v2\x14.google.api.HttpRuleR\x05rules\x12E\n" + - "\x1ffully_decode_reserved_expansion\x18\x02 \x01(\bR\x1cfullyDecodeReservedExpansion\"\xda\x02\n" + - "\bHttpRule\x12\x1a\n" + - "\bselector\x18\x01 \x01(\tR\bselector\x12\x12\n" + - "\x03get\x18\x02 \x01(\tH\x00R\x03get\x12\x12\n" + - "\x03put\x18\x03 \x01(\tH\x00R\x03put\x12\x14\n" + - "\x04post\x18\x04 \x01(\tH\x00R\x04post\x12\x18\n" + - "\x06delete\x18\x05 \x01(\tH\x00R\x06delete\x12\x16\n" + - "\x05patch\x18\x06 \x01(\tH\x00R\x05patch\x127\n" + - "\x06custom\x18\b \x01(\v2\x1d.google.api.CustomHttpPatternH\x00R\x06custom\x12\x12\n" + - "\x04body\x18\a \x01(\tR\x04body\x12#\n" + - "\rresponse_body\x18\f \x01(\tR\fresponseBody\x12E\n" + - "\x13additional_bindings\x18\v \x03(\v2\x14.google.api.HttpRuleR\x12additionalBindingsB\t\n" + - "\apattern\";\n" + - "\x11CustomHttpPattern\x12\x12\n" + - "\x04kind\x18\x01 \x01(\tR\x04kind\x12\x12\n" + - "\x04path\x18\x02 \x01(\tR\x04pathBj\n" + - "\x0ecom.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3" - -var ( - file_google_api_http_proto_rawDescOnce sync.Once - file_google_api_http_proto_rawDescData []byte -) - -func file_google_api_http_proto_rawDescGZIP() []byte { - file_google_api_http_proto_rawDescOnce.Do(func() { - file_google_api_http_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_api_http_proto_rawDesc), len(file_google_api_http_proto_rawDesc))) - }) - return file_google_api_http_proto_rawDescData -} - -var file_google_api_http_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_google_api_http_proto_goTypes = []any{ - (*Http)(nil), // 0: google.api.Http - (*HttpRule)(nil), // 1: google.api.HttpRule - (*CustomHttpPattern)(nil), // 2: google.api.CustomHttpPattern -} -var file_google_api_http_proto_depIdxs = []int32{ - 1, // 0: google.api.Http.rules:type_name -> google.api.HttpRule - 2, // 1: google.api.HttpRule.custom:type_name -> google.api.CustomHttpPattern - 1, // 2: google.api.HttpRule.additional_bindings:type_name -> google.api.HttpRule - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_google_api_http_proto_init() } -func file_google_api_http_proto_init() { - if File_google_api_http_proto != nil { - return - } - file_google_api_http_proto_msgTypes[1].OneofWrappers = []any{ - (*HttpRule_Get)(nil), - (*HttpRule_Put)(nil), - (*HttpRule_Post)(nil), - (*HttpRule_Delete)(nil), - (*HttpRule_Patch)(nil), - (*HttpRule_Custom)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_api_http_proto_rawDesc), len(file_google_api_http_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_api_http_proto_goTypes, - DependencyIndexes: file_google_api_http_proto_depIdxs, - MessageInfos: file_google_api_http_proto_msgTypes, - }.Build() - File_google_api_http_proto = out.File - file_google_api_http_proto_goTypes = nil - file_google_api_http_proto_depIdxs = nil -} diff --git a/gen/go/types/value.pb.go b/gen/go/types/value.pb.go deleted file mode 100644 index 7bf66a30a..000000000 --- a/gen/go/types/value.pb.go +++ /dev/null @@ -1,398 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: types/value.proto - -package types - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type BoolValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BoolValue) Reset() { - *x = BoolValue{} - mi := &file_types_value_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BoolValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BoolValue) ProtoMessage() {} - -func (x *BoolValue) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BoolValue.ProtoReflect.Descriptor instead. -func (*BoolValue) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{0} -} - -func (x *BoolValue) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type StringValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StringValue) Reset() { - *x = StringValue{} - mi := &file_types_value_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StringValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringValue) ProtoMessage() {} - -func (x *StringValue) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StringValue.ProtoReflect.Descriptor instead. -func (*StringValue) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{1} -} - -func (x *StringValue) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type BytesValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BytesValue) Reset() { - *x = BytesValue{} - mi := &file_types_value_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BytesValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BytesValue) ProtoMessage() {} - -func (x *BytesValue) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BytesValue.ProtoReflect.Descriptor instead. -func (*BytesValue) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{2} -} - -func (x *BytesValue) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type StringList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StringList) Reset() { - *x = StringList{} - mi := &file_types_value_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StringList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringList) ProtoMessage() {} - -func (x *StringList) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StringList.ProtoReflect.Descriptor instead. -func (*StringList) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{3} -} - -func (x *StringList) GetValues() []string { - if x != nil { - return x.Values - } - return nil -} - -type Int64Value struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Int64Value) Reset() { - *x = Int64Value{} - mi := &file_types_value_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Int64Value) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Int64Value) ProtoMessage() {} - -func (x *Int64Value) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Int64Value.ProtoReflect.Descriptor instead. -func (*Int64Value) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{4} -} - -func (x *Int64Value) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} - -type Int64List struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []int64 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Int64List) Reset() { - *x = Int64List{} - mi := &file_types_value_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Int64List) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Int64List) ProtoMessage() {} - -func (x *Int64List) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Int64List.ProtoReflect.Descriptor instead. -func (*Int64List) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{5} -} - -func (x *Int64List) GetValues() []int64 { - if x != nil { - return x.Values - } - return nil -} - -type Empty struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Empty) Reset() { - *x = Empty{} - mi := &file_types_value_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Empty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Empty) ProtoMessage() {} - -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_types_value_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_types_value_proto_rawDescGZIP(), []int{6} -} - -var File_types_value_proto protoreflect.FileDescriptor - -const file_types_value_proto_rawDesc = "" + - "\n" + - "\x11types/value.proto\x12\x05types\"!\n" + - "\tBoolValue\x12\x14\n" + - "\x05value\x18\x01 \x01(\bR\x05value\"#\n" + - "\vStringValue\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\"\"\n" + - "\n" + - "BytesValue\x12\x14\n" + - "\x05value\x18\x01 \x01(\fR\x05value\"$\n" + - "\n" + - "StringList\x12\x16\n" + - "\x06values\x18\x01 \x03(\tR\x06values\"\"\n" + - "\n" + - "Int64Value\x12\x14\n" + - "\x05value\x18\x01 \x01(\x03R\x05value\"#\n" + - "\tInt64List\x12\x16\n" + - "\x06values\x18\x01 \x03(\x03R\x06values\"\a\n" + - "\x05EmptyB/Z-github.com/garethgeorge/backrest/gen/go/typesb\x06proto3" - -var ( - file_types_value_proto_rawDescOnce sync.Once - file_types_value_proto_rawDescData []byte -) - -func file_types_value_proto_rawDescGZIP() []byte { - file_types_value_proto_rawDescOnce.Do(func() { - file_types_value_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_types_value_proto_rawDesc), len(file_types_value_proto_rawDesc))) - }) - return file_types_value_proto_rawDescData -} - -var file_types_value_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_types_value_proto_goTypes = []any{ - (*BoolValue)(nil), // 0: types.BoolValue - (*StringValue)(nil), // 1: types.StringValue - (*BytesValue)(nil), // 2: types.BytesValue - (*StringList)(nil), // 3: types.StringList - (*Int64Value)(nil), // 4: types.Int64Value - (*Int64List)(nil), // 5: types.Int64List - (*Empty)(nil), // 6: types.Empty -} -var file_types_value_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_types_value_proto_init() } -func file_types_value_proto_init() { - if File_types_value_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_types_value_proto_rawDesc), len(file_types_value_proto_rawDesc)), - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_types_value_proto_goTypes, - DependencyIndexes: file_types_value_proto_depIdxs, - MessageInfos: file_types_value_proto_msgTypes, - }.Build() - File_types_value_proto = out.File - file_types_value_proto_goTypes = nil - file_types_value_proto_depIdxs = nil -} diff --git a/gen/go/v1/authentication.pb.go b/gen/go/v1/authentication.pb.go deleted file mode 100644 index 4c5246056..000000000 --- a/gen/go/v1/authentication.pb.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: v1/authentication.proto - -package v1 - -import ( - types "github.com/garethgeorge/backrest/gen/go/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type LoginRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginRequest) Reset() { - *x = LoginRequest{} - mi := &file_v1_authentication_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginRequest) ProtoMessage() {} - -func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authentication_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. -func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_v1_authentication_proto_rawDescGZIP(), []int{0} -} - -func (x *LoginRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *LoginRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type LoginResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // JWT token - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginResponse) Reset() { - *x = LoginResponse{} - mi := &file_v1_authentication_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginResponse) ProtoMessage() {} - -func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_authentication_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. -func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_v1_authentication_proto_rawDescGZIP(), []int{1} -} - -func (x *LoginResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -var File_v1_authentication_proto protoreflect.FileDescriptor - -const file_v1_authentication_proto_rawDesc = "" + - "\n" + - "\x17v1/authentication.proto\x12\x02v1\x1a\x0fv1/config.proto\x1a\x11types/value.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/api/annotations.proto\"F\n" + - "\fLoginRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\"%\n" + - "\rLoginResponse\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token2z\n" + - "\x0eAuthentication\x12.\n" + - "\x05Login\x12\x10.v1.LoginRequest\x1a\x11.v1.LoginResponse\"\x00\x128\n" + - "\fHashPassword\x12\x12.types.StringValue\x1a\x12.types.StringValue\"\x00B,Z*github.com/garethgeorge/backrest/gen/go/v1b\x06proto3" - -var ( - file_v1_authentication_proto_rawDescOnce sync.Once - file_v1_authentication_proto_rawDescData []byte -) - -func file_v1_authentication_proto_rawDescGZIP() []byte { - file_v1_authentication_proto_rawDescOnce.Do(func() { - file_v1_authentication_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_authentication_proto_rawDesc), len(file_v1_authentication_proto_rawDesc))) - }) - return file_v1_authentication_proto_rawDescData -} - -var file_v1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v1_authentication_proto_goTypes = []any{ - (*LoginRequest)(nil), // 0: v1.LoginRequest - (*LoginResponse)(nil), // 1: v1.LoginResponse - (*types.StringValue)(nil), // 2: types.StringValue -} -var file_v1_authentication_proto_depIdxs = []int32{ - 0, // 0: v1.Authentication.Login:input_type -> v1.LoginRequest - 2, // 1: v1.Authentication.HashPassword:input_type -> types.StringValue - 1, // 2: v1.Authentication.Login:output_type -> v1.LoginResponse - 2, // 3: v1.Authentication.HashPassword:output_type -> types.StringValue - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_v1_authentication_proto_init() } -func file_v1_authentication_proto_init() { - if File_v1_authentication_proto != nil { - return - } - file_v1_config_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_authentication_proto_rawDesc), len(file_v1_authentication_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_authentication_proto_goTypes, - DependencyIndexes: file_v1_authentication_proto_depIdxs, - MessageInfos: file_v1_authentication_proto_msgTypes, - }.Build() - File_v1_authentication_proto = out.File - file_v1_authentication_proto_goTypes = nil - file_v1_authentication_proto_depIdxs = nil -} diff --git a/gen/go/v1/authentication_grpc.pb.go b/gen/go/v1/authentication_grpc.pb.go deleted file mode 100644 index 9be66eda6..000000000 --- a/gen/go/v1/authentication_grpc.pb.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc (unknown) -// source: v1/authentication.proto - -package v1 - -import ( - context "context" - types "github.com/garethgeorge/backrest/gen/go/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Authentication_Login_FullMethodName = "/v1.Authentication/Login" - Authentication_HashPassword_FullMethodName = "/v1.Authentication/HashPassword" -) - -// AuthenticationClient is the client API for Authentication service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AuthenticationClient interface { - Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) - HashPassword(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringValue, error) -} - -type authenticationClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient { - return &authenticationClient{cc} -} - -func (c *authenticationClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LoginResponse) - err := c.cc.Invoke(ctx, Authentication_Login_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authenticationClient) HashPassword(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringValue, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(types.StringValue) - err := c.cc.Invoke(ctx, Authentication_HashPassword_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthenticationServer is the server API for Authentication service. -// All implementations must embed UnimplementedAuthenticationServer -// for forward compatibility. -type AuthenticationServer interface { - Login(context.Context, *LoginRequest) (*LoginResponse, error) - HashPassword(context.Context, *types.StringValue) (*types.StringValue, error) - mustEmbedUnimplementedAuthenticationServer() -} - -// UnimplementedAuthenticationServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAuthenticationServer struct{} - -func (UnimplementedAuthenticationServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") -} -func (UnimplementedAuthenticationServer) HashPassword(context.Context, *types.StringValue) (*types.StringValue, error) { - return nil, status.Errorf(codes.Unimplemented, "method HashPassword not implemented") -} -func (UnimplementedAuthenticationServer) mustEmbedUnimplementedAuthenticationServer() {} -func (UnimplementedAuthenticationServer) testEmbeddedByValue() {} - -// UnsafeAuthenticationServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthenticationServer will -// result in compilation errors. -type UnsafeAuthenticationServer interface { - mustEmbedUnimplementedAuthenticationServer() -} - -func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer) { - // If the following call pancis, it indicates UnimplementedAuthenticationServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Authentication_ServiceDesc, srv) -} - -func _Authentication_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LoginRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthenticationServer).Login(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Authentication_Login_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthenticationServer).Login(ctx, req.(*LoginRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Authentication_HashPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.StringValue) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthenticationServer).HashPassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Authentication_HashPassword_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthenticationServer).HashPassword(ctx, req.(*types.StringValue)) - } - return interceptor(ctx, in, info, handler) -} - -// Authentication_ServiceDesc is the grpc.ServiceDesc for Authentication service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Authentication_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Authentication", - HandlerType: (*AuthenticationServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Login", - Handler: _Authentication_Login_Handler, - }, - { - MethodName: "HashPassword", - Handler: _Authentication_HashPassword_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "v1/authentication.proto", -} diff --git a/gen/go/v1/crypto.pb.go b/gen/go/v1/crypto.pb.go deleted file mode 100644 index ce064c0ee..000000000 --- a/gen/go/v1/crypto.pb.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: v1/crypto.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SignedMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Keyid string `protobuf:"bytes,1,opt,name=keyid,proto3" json:"keyid,omitempty"` // a unique identifier generated as the SHA256 of the public key used to sign the message. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // the payload - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // the signature of the payload - TimestampMillis int64 `protobuf:"varint,4,opt,name=timestampMillis,proto3" json:"timestampMillis,omitempty"` // the timestamp in milliseconds since epoch when the message was signed. Must be within 5 minutes of the current time. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SignedMessage) Reset() { - *x = SignedMessage{} - mi := &file_v1_crypto_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SignedMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedMessage) ProtoMessage() {} - -func (x *SignedMessage) ProtoReflect() protoreflect.Message { - mi := &file_v1_crypto_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignedMessage.ProtoReflect.Descriptor instead. -func (*SignedMessage) Descriptor() ([]byte, []int) { - return file_v1_crypto_proto_rawDescGZIP(), []int{0} -} - -func (x *SignedMessage) GetKeyid() string { - if x != nil { - return x.Keyid - } - return "" -} - -func (x *SignedMessage) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *SignedMessage) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *SignedMessage) GetTimestampMillis() int64 { - if x != nil { - return x.TimestampMillis - } - return 0 -} - -type PublicKey struct { - state protoimpl.MessageState `protogen:"open.v1"` - Keyid string `protobuf:"bytes,1,opt,name=keyid,json=keyId,proto3" json:"keyid,omitempty"` // a unique identifier generated as the SHA256 of the public key. - Ed25519Pub string `protobuf:"bytes,2,opt,name=ed25519pub,proto3" json:"ed25519pub,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PublicKey) Reset() { - *x = PublicKey{} - mi := &file_v1_crypto_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PublicKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublicKey) ProtoMessage() {} - -func (x *PublicKey) ProtoReflect() protoreflect.Message { - mi := &file_v1_crypto_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PublicKey.ProtoReflect.Descriptor instead. -func (*PublicKey) Descriptor() ([]byte, []int) { - return file_v1_crypto_proto_rawDescGZIP(), []int{1} -} - -func (x *PublicKey) GetKeyid() string { - if x != nil { - return x.Keyid - } - return "" -} - -func (x *PublicKey) GetEd25519Pub() string { - if x != nil { - return x.Ed25519Pub - } - return "" -} - -type PrivateKey struct { - state protoimpl.MessageState `protogen:"open.v1"` - Keyid string `protobuf:"bytes,1,opt,name=keyid,json=keyId,proto3" json:"keyid,omitempty"` // a unique identifier generated as the SHA256 of the public key - Ed25519Priv string `protobuf:"bytes,2,opt,name=ed25519priv,proto3" json:"ed25519priv,omitempty"` - Ed25519Pub string `protobuf:"bytes,3,opt,name=ed25519pub,proto3" json:"ed25519pub,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PrivateKey) Reset() { - *x = PrivateKey{} - mi := &file_v1_crypto_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PrivateKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrivateKey) ProtoMessage() {} - -func (x *PrivateKey) ProtoReflect() protoreflect.Message { - mi := &file_v1_crypto_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrivateKey.ProtoReflect.Descriptor instead. -func (*PrivateKey) Descriptor() ([]byte, []int) { - return file_v1_crypto_proto_rawDescGZIP(), []int{2} -} - -func (x *PrivateKey) GetKeyid() string { - if x != nil { - return x.Keyid - } - return "" -} - -func (x *PrivateKey) GetEd25519Priv() string { - if x != nil { - return x.Ed25519Priv - } - return "" -} - -func (x *PrivateKey) GetEd25519Pub() string { - if x != nil { - return x.Ed25519Pub - } - return "" -} - -var File_v1_crypto_proto protoreflect.FileDescriptor - -const file_v1_crypto_proto_rawDesc = "" + - "\n" + - "\x0fv1/crypto.proto\x12\x02v1\"\x87\x01\n" + - "\rSignedMessage\x12\x14\n" + - "\x05keyid\x18\x01 \x01(\tR\x05keyid\x12\x18\n" + - "\apayload\x18\x02 \x01(\fR\apayload\x12\x1c\n" + - "\tsignature\x18\x03 \x01(\fR\tsignature\x12(\n" + - "\x0ftimestampMillis\x18\x04 \x01(\x03R\x0ftimestampMillis\"A\n" + - "\tPublicKey\x12\x14\n" + - "\x05keyid\x18\x01 \x01(\tR\x05keyId\x12\x1e\n" + - "\n" + - "ed25519pub\x18\x02 \x01(\tR\n" + - "ed25519pub\"d\n" + - "\n" + - "PrivateKey\x12\x14\n" + - "\x05keyid\x18\x01 \x01(\tR\x05keyId\x12 \n" + - "\ved25519priv\x18\x02 \x01(\tR\ved25519priv\x12\x1e\n" + - "\n" + - "ed25519pub\x18\x03 \x01(\tR\n" + - "ed25519pubB,Z*github.com/garethgeorge/backrest/gen/go/v1b\x06proto3" - -var ( - file_v1_crypto_proto_rawDescOnce sync.Once - file_v1_crypto_proto_rawDescData []byte -) - -func file_v1_crypto_proto_rawDescGZIP() []byte { - file_v1_crypto_proto_rawDescOnce.Do(func() { - file_v1_crypto_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_crypto_proto_rawDesc), len(file_v1_crypto_proto_rawDesc))) - }) - return file_v1_crypto_proto_rawDescData -} - -var file_v1_crypto_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v1_crypto_proto_goTypes = []any{ - (*SignedMessage)(nil), // 0: v1.SignedMessage - (*PublicKey)(nil), // 1: v1.PublicKey - (*PrivateKey)(nil), // 2: v1.PrivateKey -} -var file_v1_crypto_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_v1_crypto_proto_init() } -func file_v1_crypto_proto_init() { - if File_v1_crypto_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_crypto_proto_rawDesc), len(file_v1_crypto_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_crypto_proto_goTypes, - DependencyIndexes: file_v1_crypto_proto_depIdxs, - MessageInfos: file_v1_crypto_proto_msgTypes, - }.Build() - File_v1_crypto_proto = out.File - file_v1_crypto_proto_goTypes = nil - file_v1_crypto_proto_depIdxs = nil -} diff --git a/gen/go/v1/operations.pb.go b/gen/go/v1/operations.pb.go deleted file mode 100644 index 8baa75545..000000000 --- a/gen/go/v1/operations.pb.go +++ /dev/null @@ -1,1347 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: v1/operations.proto - -package v1 - -import ( - types "github.com/garethgeorge/backrest/gen/go/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// OperationEventType indicates whether the operation was created or updated -type OperationEventType int32 - -const ( - OperationEventType_EVENT_UNKNOWN OperationEventType = 0 - OperationEventType_EVENT_CREATED OperationEventType = 1 - OperationEventType_EVENT_UPDATED OperationEventType = 2 - OperationEventType_EVENT_DELETED OperationEventType = 3 -) - -// Enum value maps for OperationEventType. -var ( - OperationEventType_name = map[int32]string{ - 0: "EVENT_UNKNOWN", - 1: "EVENT_CREATED", - 2: "EVENT_UPDATED", - 3: "EVENT_DELETED", - } - OperationEventType_value = map[string]int32{ - "EVENT_UNKNOWN": 0, - "EVENT_CREATED": 1, - "EVENT_UPDATED": 2, - "EVENT_DELETED": 3, - } -) - -func (x OperationEventType) Enum() *OperationEventType { - p := new(OperationEventType) - *p = x - return p -} - -func (x OperationEventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperationEventType) Descriptor() protoreflect.EnumDescriptor { - return file_v1_operations_proto_enumTypes[0].Descriptor() -} - -func (OperationEventType) Type() protoreflect.EnumType { - return &file_v1_operations_proto_enumTypes[0] -} - -func (x OperationEventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperationEventType.Descriptor instead. -func (OperationEventType) EnumDescriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{0} -} - -type OperationStatus int32 - -const ( - OperationStatus_STATUS_UNKNOWN OperationStatus = 0 // used to indicate that the status is unknown. - OperationStatus_STATUS_PENDING OperationStatus = 1 // used to indicate that the operation is pending. - OperationStatus_STATUS_INPROGRESS OperationStatus = 2 // used to indicate that the operation is in progress. - OperationStatus_STATUS_SUCCESS OperationStatus = 3 // used to indicate that the operation completed successfully. - OperationStatus_STATUS_WARNING OperationStatus = 7 // used to indicate that the operation completed with warnings. - OperationStatus_STATUS_ERROR OperationStatus = 4 // used to indicate that the operation failed. - OperationStatus_STATUS_SYSTEM_CANCELLED OperationStatus = 5 // indicates operation cancelled by the system. - OperationStatus_STATUS_USER_CANCELLED OperationStatus = 6 // indicates operation cancelled by the user. -) - -// Enum value maps for OperationStatus. -var ( - OperationStatus_name = map[int32]string{ - 0: "STATUS_UNKNOWN", - 1: "STATUS_PENDING", - 2: "STATUS_INPROGRESS", - 3: "STATUS_SUCCESS", - 7: "STATUS_WARNING", - 4: "STATUS_ERROR", - 5: "STATUS_SYSTEM_CANCELLED", - 6: "STATUS_USER_CANCELLED", - } - OperationStatus_value = map[string]int32{ - "STATUS_UNKNOWN": 0, - "STATUS_PENDING": 1, - "STATUS_INPROGRESS": 2, - "STATUS_SUCCESS": 3, - "STATUS_WARNING": 7, - "STATUS_ERROR": 4, - "STATUS_SYSTEM_CANCELLED": 5, - "STATUS_USER_CANCELLED": 6, - } -) - -func (x OperationStatus) Enum() *OperationStatus { - p := new(OperationStatus) - *p = x - return p -} - -func (x OperationStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperationStatus) Descriptor() protoreflect.EnumDescriptor { - return file_v1_operations_proto_enumTypes[1].Descriptor() -} - -func (OperationStatus) Type() protoreflect.EnumType { - return &file_v1_operations_proto_enumTypes[1] -} - -func (x OperationStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperationStatus.Descriptor instead. -func (OperationStatus) EnumDescriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{1} -} - -type OperationList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationList) Reset() { - *x = OperationList{} - mi := &file_v1_operations_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationList) ProtoMessage() {} - -func (x *OperationList) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationList.ProtoReflect.Descriptor instead. -func (*OperationList) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{0} -} - -func (x *OperationList) GetOperations() []*Operation { - if x != nil { - return x.Operations - } - return nil -} - -// Operation is the basic unit of record in backrest -type Operation struct { - state protoimpl.MessageState `protogen:"open.v1"` - // required, primary ID of the operation. ID is sequential based on creation time of the operation. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - OriginalId int64 `protobuf:"varint,13,opt,name=original_id,json=originalId,proto3" json:"original_id,omitempty"` - // modno increments with each change to the operation. This supports easy diffing. - Modno int64 `protobuf:"varint,12,opt,name=modno,proto3" json:"modno,omitempty"` - // flow id groups operations together, e.g. by an execution of a plan. - // must be unique within the context of a repo. - FlowId int64 `protobuf:"varint,10,opt,name=flow_id,json=flowId,proto3" json:"flow_id,omitempty"` - OriginalFlowId int64 `protobuf:"varint,14,opt,name=original_flow_id,json=originalFlowId,proto3" json:"original_flow_id,omitempty"` - // repo id is a string identifier for the repo, and repo_guid is the globally unique ID of the repo. - RepoId string `protobuf:"bytes,2,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - RepoGuid string `protobuf:"bytes,15,opt,name=repo_guid,json=repoGuid,proto3" json:"repo_guid,omitempty"` - // plan id e.g. a scheduled set of operations (or system) that created this operation. - PlanId string `protobuf:"bytes,3,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` - // instance ID that the operation is attributed to, not necessarily the same as the instance that created it. - InstanceId string `protobuf:"bytes,11,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // original instance guid is the verifiable instance that created the operation. Only set for remote operations created by sync. - OriginalInstanceKeyid string `protobuf:"bytes,16,opt,name=original_instance_keyid,json=originalInstanceKeyid,proto3" json:"original_instance_keyid,omitempty"` - // optional snapshot id if associated with a snapshot. - SnapshotId string `protobuf:"bytes,8,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` - Status OperationStatus `protobuf:"varint,4,opt,name=status,proto3,enum=v1.OperationStatus" json:"status,omitempty"` - // required, unix time in milliseconds of the operation's creation (ID is derived from this) - UnixTimeStartMs int64 `protobuf:"varint,5,opt,name=unix_time_start_ms,json=unixTimeStartMs,proto3" json:"unix_time_start_ms,omitempty"` - // ptional, unix time in milliseconds of the operation's completion - UnixTimeEndMs int64 `protobuf:"varint,6,opt,name=unix_time_end_ms,json=unixTimeEndMs,proto3" json:"unix_time_end_ms,omitempty"` - // optional, human readable context message, typically an error message. - DisplayMessage string `protobuf:"bytes,7,opt,name=display_message,json=displayMessage,proto3" json:"display_message,omitempty"` - // logref can point to arbitrary logs associated with the operation. - Logref string `protobuf:"bytes,9,opt,name=logref,proto3" json:"logref,omitempty"` - // Types that are valid to be assigned to Op: - // - // *Operation_OperationBackup - // *Operation_OperationIndexSnapshot - // *Operation_OperationForget - // *Operation_OperationPrune - // *Operation_OperationRestore - // *Operation_OperationStats - // *Operation_OperationRunHook - // *Operation_OperationCheck - // *Operation_OperationRunCommand - Op isOperation_Op `protobuf_oneof:"op"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Operation) Reset() { - *x = Operation{} - mi := &file_v1_operations_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{1} -} - -func (x *Operation) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Operation) GetOriginalId() int64 { - if x != nil { - return x.OriginalId - } - return 0 -} - -func (x *Operation) GetModno() int64 { - if x != nil { - return x.Modno - } - return 0 -} - -func (x *Operation) GetFlowId() int64 { - if x != nil { - return x.FlowId - } - return 0 -} - -func (x *Operation) GetOriginalFlowId() int64 { - if x != nil { - return x.OriginalFlowId - } - return 0 -} - -func (x *Operation) GetRepoId() string { - if x != nil { - return x.RepoId - } - return "" -} - -func (x *Operation) GetRepoGuid() string { - if x != nil { - return x.RepoGuid - } - return "" -} - -func (x *Operation) GetPlanId() string { - if x != nil { - return x.PlanId - } - return "" -} - -func (x *Operation) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -func (x *Operation) GetOriginalInstanceKeyid() string { - if x != nil { - return x.OriginalInstanceKeyid - } - return "" -} - -func (x *Operation) GetSnapshotId() string { - if x != nil { - return x.SnapshotId - } - return "" -} - -func (x *Operation) GetStatus() OperationStatus { - if x != nil { - return x.Status - } - return OperationStatus_STATUS_UNKNOWN -} - -func (x *Operation) GetUnixTimeStartMs() int64 { - if x != nil { - return x.UnixTimeStartMs - } - return 0 -} - -func (x *Operation) GetUnixTimeEndMs() int64 { - if x != nil { - return x.UnixTimeEndMs - } - return 0 -} - -func (x *Operation) GetDisplayMessage() string { - if x != nil { - return x.DisplayMessage - } - return "" -} - -func (x *Operation) GetLogref() string { - if x != nil { - return x.Logref - } - return "" -} - -func (x *Operation) GetOp() isOperation_Op { - if x != nil { - return x.Op - } - return nil -} - -func (x *Operation) GetOperationBackup() *OperationBackup { - if x != nil { - if x, ok := x.Op.(*Operation_OperationBackup); ok { - return x.OperationBackup - } - } - return nil -} - -func (x *Operation) GetOperationIndexSnapshot() *OperationIndexSnapshot { - if x != nil { - if x, ok := x.Op.(*Operation_OperationIndexSnapshot); ok { - return x.OperationIndexSnapshot - } - } - return nil -} - -func (x *Operation) GetOperationForget() *OperationForget { - if x != nil { - if x, ok := x.Op.(*Operation_OperationForget); ok { - return x.OperationForget - } - } - return nil -} - -func (x *Operation) GetOperationPrune() *OperationPrune { - if x != nil { - if x, ok := x.Op.(*Operation_OperationPrune); ok { - return x.OperationPrune - } - } - return nil -} - -func (x *Operation) GetOperationRestore() *OperationRestore { - if x != nil { - if x, ok := x.Op.(*Operation_OperationRestore); ok { - return x.OperationRestore - } - } - return nil -} - -func (x *Operation) GetOperationStats() *OperationStats { - if x != nil { - if x, ok := x.Op.(*Operation_OperationStats); ok { - return x.OperationStats - } - } - return nil -} - -func (x *Operation) GetOperationRunHook() *OperationRunHook { - if x != nil { - if x, ok := x.Op.(*Operation_OperationRunHook); ok { - return x.OperationRunHook - } - } - return nil -} - -func (x *Operation) GetOperationCheck() *OperationCheck { - if x != nil { - if x, ok := x.Op.(*Operation_OperationCheck); ok { - return x.OperationCheck - } - } - return nil -} - -func (x *Operation) GetOperationRunCommand() *OperationRunCommand { - if x != nil { - if x, ok := x.Op.(*Operation_OperationRunCommand); ok { - return x.OperationRunCommand - } - } - return nil -} - -type isOperation_Op interface { - isOperation_Op() -} - -type Operation_OperationBackup struct { - OperationBackup *OperationBackup `protobuf:"bytes,100,opt,name=operation_backup,json=operationBackup,proto3,oneof"` -} - -type Operation_OperationIndexSnapshot struct { - OperationIndexSnapshot *OperationIndexSnapshot `protobuf:"bytes,101,opt,name=operation_index_snapshot,json=operationIndexSnapshot,proto3,oneof"` -} - -type Operation_OperationForget struct { - OperationForget *OperationForget `protobuf:"bytes,102,opt,name=operation_forget,json=operationForget,proto3,oneof"` -} - -type Operation_OperationPrune struct { - OperationPrune *OperationPrune `protobuf:"bytes,103,opt,name=operation_prune,json=operationPrune,proto3,oneof"` -} - -type Operation_OperationRestore struct { - OperationRestore *OperationRestore `protobuf:"bytes,104,opt,name=operation_restore,json=operationRestore,proto3,oneof"` -} - -type Operation_OperationStats struct { - OperationStats *OperationStats `protobuf:"bytes,105,opt,name=operation_stats,json=operationStats,proto3,oneof"` -} - -type Operation_OperationRunHook struct { - OperationRunHook *OperationRunHook `protobuf:"bytes,106,opt,name=operation_run_hook,json=operationRunHook,proto3,oneof"` -} - -type Operation_OperationCheck struct { - OperationCheck *OperationCheck `protobuf:"bytes,107,opt,name=operation_check,json=operationCheck,proto3,oneof"` -} - -type Operation_OperationRunCommand struct { - OperationRunCommand *OperationRunCommand `protobuf:"bytes,108,opt,name=operation_run_command,json=operationRunCommand,proto3,oneof"` -} - -func (*Operation_OperationBackup) isOperation_Op() {} - -func (*Operation_OperationIndexSnapshot) isOperation_Op() {} - -func (*Operation_OperationForget) isOperation_Op() {} - -func (*Operation_OperationPrune) isOperation_Op() {} - -func (*Operation_OperationRestore) isOperation_Op() {} - -func (*Operation_OperationStats) isOperation_Op() {} - -func (*Operation_OperationRunHook) isOperation_Op() {} - -func (*Operation_OperationCheck) isOperation_Op() {} - -func (*Operation_OperationRunCommand) isOperation_Op() {} - -// OperationEvent is used in the wireformat to stream operation changes to clients -type OperationEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Event: - // - // *OperationEvent_KeepAlive - // *OperationEvent_CreatedOperations - // *OperationEvent_UpdatedOperations - // *OperationEvent_DeletedOperations - Event isOperationEvent_Event `protobuf_oneof:"event"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationEvent) Reset() { - *x = OperationEvent{} - mi := &file_v1_operations_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationEvent) ProtoMessage() {} - -func (x *OperationEvent) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationEvent.ProtoReflect.Descriptor instead. -func (*OperationEvent) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{2} -} - -func (x *OperationEvent) GetEvent() isOperationEvent_Event { - if x != nil { - return x.Event - } - return nil -} - -func (x *OperationEvent) GetKeepAlive() *types.Empty { - if x != nil { - if x, ok := x.Event.(*OperationEvent_KeepAlive); ok { - return x.KeepAlive - } - } - return nil -} - -func (x *OperationEvent) GetCreatedOperations() *OperationList { - if x != nil { - if x, ok := x.Event.(*OperationEvent_CreatedOperations); ok { - return x.CreatedOperations - } - } - return nil -} - -func (x *OperationEvent) GetUpdatedOperations() *OperationList { - if x != nil { - if x, ok := x.Event.(*OperationEvent_UpdatedOperations); ok { - return x.UpdatedOperations - } - } - return nil -} - -func (x *OperationEvent) GetDeletedOperations() *types.Int64List { - if x != nil { - if x, ok := x.Event.(*OperationEvent_DeletedOperations); ok { - return x.DeletedOperations - } - } - return nil -} - -type isOperationEvent_Event interface { - isOperationEvent_Event() -} - -type OperationEvent_KeepAlive struct { - KeepAlive *types.Empty `protobuf:"bytes,1,opt,name=keep_alive,json=keepAlive,proto3,oneof"` -} - -type OperationEvent_CreatedOperations struct { - CreatedOperations *OperationList `protobuf:"bytes,2,opt,name=created_operations,json=createdOperations,proto3,oneof"` -} - -type OperationEvent_UpdatedOperations struct { - UpdatedOperations *OperationList `protobuf:"bytes,3,opt,name=updated_operations,json=updatedOperations,proto3,oneof"` -} - -type OperationEvent_DeletedOperations struct { - DeletedOperations *types.Int64List `protobuf:"bytes,4,opt,name=deleted_operations,json=deletedOperations,proto3,oneof"` -} - -func (*OperationEvent_KeepAlive) isOperationEvent_Event() {} - -func (*OperationEvent_CreatedOperations) isOperationEvent_Event() {} - -func (*OperationEvent_UpdatedOperations) isOperationEvent_Event() {} - -func (*OperationEvent_DeletedOperations) isOperationEvent_Event() {} - -type OperationBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - LastStatus *BackupProgressEntry `protobuf:"bytes,3,opt,name=last_status,json=lastStatus,proto3" json:"last_status,omitempty"` - Errors []*BackupProgressError `protobuf:"bytes,4,rep,name=errors,proto3" json:"errors,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationBackup) Reset() { - *x = OperationBackup{} - mi := &file_v1_operations_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationBackup) ProtoMessage() {} - -func (x *OperationBackup) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationBackup.ProtoReflect.Descriptor instead. -func (*OperationBackup) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{3} -} - -func (x *OperationBackup) GetLastStatus() *BackupProgressEntry { - if x != nil { - return x.LastStatus - } - return nil -} - -func (x *OperationBackup) GetErrors() []*BackupProgressError { - if x != nil { - return x.Errors - } - return nil -} - -// OperationIndexSnapshot tracks that a snapshot was detected by backrest. -type OperationIndexSnapshot struct { - state protoimpl.MessageState `protogen:"open.v1"` - Snapshot *ResticSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` // the snapshot that was indexed. - Forgot bool `protobuf:"varint,3,opt,name=forgot,proto3" json:"forgot,omitempty"` // tracks whether this snapshot is forgotten yet. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationIndexSnapshot) Reset() { - *x = OperationIndexSnapshot{} - mi := &file_v1_operations_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationIndexSnapshot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationIndexSnapshot) ProtoMessage() {} - -func (x *OperationIndexSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationIndexSnapshot.ProtoReflect.Descriptor instead. -func (*OperationIndexSnapshot) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{4} -} - -func (x *OperationIndexSnapshot) GetSnapshot() *ResticSnapshot { - if x != nil { - return x.Snapshot - } - return nil -} - -func (x *OperationIndexSnapshot) GetForgot() bool { - if x != nil { - return x.Forgot - } - return false -} - -// OperationForget tracks a forget operation. -type OperationForget struct { - state protoimpl.MessageState `protogen:"open.v1"` - Forget []*ResticSnapshot `protobuf:"bytes,1,rep,name=forget,proto3" json:"forget,omitempty"` - Policy *RetentionPolicy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationForget) Reset() { - *x = OperationForget{} - mi := &file_v1_operations_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationForget) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationForget) ProtoMessage() {} - -func (x *OperationForget) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationForget.ProtoReflect.Descriptor instead. -func (*OperationForget) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{5} -} - -func (x *OperationForget) GetForget() []*ResticSnapshot { - if x != nil { - return x.Forget - } - return nil -} - -func (x *OperationForget) GetPolicy() *RetentionPolicy { - if x != nil { - return x.Policy - } - return nil -} - -// OperationPrune tracks a prune operation. -type OperationPrune struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in v1/operations.proto. - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` // output of the prune. - OutputLogref string `protobuf:"bytes,2,opt,name=output_logref,json=outputLogref,proto3" json:"output_logref,omitempty"` // logref of the prune output. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationPrune) Reset() { - *x = OperationPrune{} - mi := &file_v1_operations_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationPrune) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationPrune) ProtoMessage() {} - -func (x *OperationPrune) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationPrune.ProtoReflect.Descriptor instead. -func (*OperationPrune) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{6} -} - -// Deprecated: Marked as deprecated in v1/operations.proto. -func (x *OperationPrune) GetOutput() string { - if x != nil { - return x.Output - } - return "" -} - -func (x *OperationPrune) GetOutputLogref() string { - if x != nil { - return x.OutputLogref - } - return "" -} - -// OperationCheck tracks a check operation. -type OperationCheck struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in v1/operations.proto. - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` // output of the check operation. - OutputLogref string `protobuf:"bytes,2,opt,name=output_logref,json=outputLogref,proto3" json:"output_logref,omitempty"` // logref of the check output. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationCheck) Reset() { - *x = OperationCheck{} - mi := &file_v1_operations_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationCheck) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationCheck) ProtoMessage() {} - -func (x *OperationCheck) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationCheck.ProtoReflect.Descriptor instead. -func (*OperationCheck) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{7} -} - -// Deprecated: Marked as deprecated in v1/operations.proto. -func (x *OperationCheck) GetOutput() string { - if x != nil { - return x.Output - } - return "" -} - -func (x *OperationCheck) GetOutputLogref() string { - if x != nil { - return x.OutputLogref - } - return "" -} - -// OperationRunCommand tracks a long running command. Commands are grouped into a flow ID for each session. -type OperationRunCommand struct { - state protoimpl.MessageState `protogen:"open.v1"` - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - OutputLogref string `protobuf:"bytes,2,opt,name=output_logref,json=outputLogref,proto3" json:"output_logref,omitempty"` - OutputSizeBytes int64 `protobuf:"varint,3,opt,name=output_size_bytes,json=outputSizeBytes,proto3" json:"output_size_bytes,omitempty"` // not necessarily authoritative, tracked as an optimization to allow clients to avoid fetching very large outputs. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationRunCommand) Reset() { - *x = OperationRunCommand{} - mi := &file_v1_operations_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationRunCommand) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationRunCommand) ProtoMessage() {} - -func (x *OperationRunCommand) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationRunCommand.ProtoReflect.Descriptor instead. -func (*OperationRunCommand) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{8} -} - -func (x *OperationRunCommand) GetCommand() string { - if x != nil { - return x.Command - } - return "" -} - -func (x *OperationRunCommand) GetOutputLogref() string { - if x != nil { - return x.OutputLogref - } - return "" -} - -func (x *OperationRunCommand) GetOutputSizeBytes() int64 { - if x != nil { - return x.OutputSizeBytes - } - return 0 -} - -// OperationRestore tracks a restore operation. -type OperationRestore struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // path in the snapshot to restore. - Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` // location to restore it to. - LastStatus *RestoreProgressEntry `protobuf:"bytes,3,opt,name=last_status,json=lastStatus,proto3" json:"last_status,omitempty"` // status of the restore. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationRestore) Reset() { - *x = OperationRestore{} - mi := &file_v1_operations_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationRestore) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationRestore) ProtoMessage() {} - -func (x *OperationRestore) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationRestore.ProtoReflect.Descriptor instead. -func (*OperationRestore) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{9} -} - -func (x *OperationRestore) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *OperationRestore) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -func (x *OperationRestore) GetLastStatus() *RestoreProgressEntry { - if x != nil { - return x.LastStatus - } - return nil -} - -// OperationStats tracks a stats operation. -type OperationStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - Stats *RepoStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationStats) Reset() { - *x = OperationStats{} - mi := &file_v1_operations_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationStats) ProtoMessage() {} - -func (x *OperationStats) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationStats.ProtoReflect.Descriptor instead. -func (*OperationStats) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{10} -} - -func (x *OperationStats) GetStats() *RepoStats { - if x != nil { - return x.Stats - } - return nil -} - -// OperationRunHook tracks a hook that was run. -type OperationRunHook struct { - state protoimpl.MessageState `protogen:"open.v1"` - ParentOp int64 `protobuf:"varint,4,opt,name=parent_op,json=parentOp,proto3" json:"parent_op,omitempty"` // ID of the operation that ran the hook. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // description of the hook that was run. typically repo/hook_idx or plan/hook_idx. - OutputLogref string `protobuf:"bytes,2,opt,name=output_logref,json=outputLogref,proto3" json:"output_logref,omitempty"` // logref of the hook's output. DEPRECATED. - Condition Hook_Condition `protobuf:"varint,3,opt,name=condition,proto3,enum=v1.Hook_Condition" json:"condition,omitempty"` // triggering condition of the hook. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationRunHook) Reset() { - *x = OperationRunHook{} - mi := &file_v1_operations_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationRunHook) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationRunHook) ProtoMessage() {} - -func (x *OperationRunHook) ProtoReflect() protoreflect.Message { - mi := &file_v1_operations_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationRunHook.ProtoReflect.Descriptor instead. -func (*OperationRunHook) Descriptor() ([]byte, []int) { - return file_v1_operations_proto_rawDescGZIP(), []int{11} -} - -func (x *OperationRunHook) GetParentOp() int64 { - if x != nil { - return x.ParentOp - } - return 0 -} - -func (x *OperationRunHook) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *OperationRunHook) GetOutputLogref() string { - if x != nil { - return x.OutputLogref - } - return "" -} - -func (x *OperationRunHook) GetCondition() Hook_Condition { - if x != nil { - return x.Condition - } - return Hook_CONDITION_UNKNOWN -} - -var File_v1_operations_proto protoreflect.FileDescriptor - -const file_v1_operations_proto_rawDesc = "" + - "\n" + - "\x13v1/operations.proto\x12\x02v1\x1a\x0fv1/restic.proto\x1a\x0fv1/config.proto\x1a\x11types/value.proto\">\n" + - "\rOperationList\x12-\n" + - "\n" + - "operations\x18\x01 \x03(\v2\r.v1.OperationR\n" + - "operations\"\x9b\t\n" + - "\tOperation\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1f\n" + - "\voriginal_id\x18\r \x01(\x03R\n" + - "originalId\x12\x14\n" + - "\x05modno\x18\f \x01(\x03R\x05modno\x12\x17\n" + - "\aflow_id\x18\n" + - " \x01(\x03R\x06flowId\x12(\n" + - "\x10original_flow_id\x18\x0e \x01(\x03R\x0eoriginalFlowId\x12\x17\n" + - "\arepo_id\x18\x02 \x01(\tR\x06repoId\x12\x1b\n" + - "\trepo_guid\x18\x0f \x01(\tR\brepoGuid\x12\x17\n" + - "\aplan_id\x18\x03 \x01(\tR\x06planId\x12\x1f\n" + - "\vinstance_id\x18\v \x01(\tR\n" + - "instanceId\x126\n" + - "\x17original_instance_keyid\x18\x10 \x01(\tR\x15originalInstanceKeyid\x12\x1f\n" + - "\vsnapshot_id\x18\b \x01(\tR\n" + - "snapshotId\x12+\n" + - "\x06status\x18\x04 \x01(\x0e2\x13.v1.OperationStatusR\x06status\x12+\n" + - "\x12unix_time_start_ms\x18\x05 \x01(\x03R\x0funixTimeStartMs\x12'\n" + - "\x10unix_time_end_ms\x18\x06 \x01(\x03R\runixTimeEndMs\x12'\n" + - "\x0fdisplay_message\x18\a \x01(\tR\x0edisplayMessage\x12\x16\n" + - "\x06logref\x18\t \x01(\tR\x06logref\x12@\n" + - "\x10operation_backup\x18d \x01(\v2\x13.v1.OperationBackupH\x00R\x0foperationBackup\x12V\n" + - "\x18operation_index_snapshot\x18e \x01(\v2\x1a.v1.OperationIndexSnapshotH\x00R\x16operationIndexSnapshot\x12@\n" + - "\x10operation_forget\x18f \x01(\v2\x13.v1.OperationForgetH\x00R\x0foperationForget\x12=\n" + - "\x0foperation_prune\x18g \x01(\v2\x12.v1.OperationPruneH\x00R\x0eoperationPrune\x12C\n" + - "\x11operation_restore\x18h \x01(\v2\x14.v1.OperationRestoreH\x00R\x10operationRestore\x12=\n" + - "\x0foperation_stats\x18i \x01(\v2\x12.v1.OperationStatsH\x00R\x0eoperationStats\x12D\n" + - "\x12operation_run_hook\x18j \x01(\v2\x14.v1.OperationRunHookH\x00R\x10operationRunHook\x12=\n" + - "\x0foperation_check\x18k \x01(\v2\x12.v1.OperationCheckH\x00R\x0eoperationCheck\x12M\n" + - "\x15operation_run_command\x18l \x01(\v2\x17.v1.OperationRunCommandH\x00R\x13operationRunCommandB\x04\n" + - "\x02op\"\x93\x02\n" + - "\x0eOperationEvent\x12-\n" + - "\n" + - "keep_alive\x18\x01 \x01(\v2\f.types.EmptyH\x00R\tkeepAlive\x12B\n" + - "\x12created_operations\x18\x02 \x01(\v2\x11.v1.OperationListH\x00R\x11createdOperations\x12B\n" + - "\x12updated_operations\x18\x03 \x01(\v2\x11.v1.OperationListH\x00R\x11updatedOperations\x12A\n" + - "\x12deleted_operations\x18\x04 \x01(\v2\x10.types.Int64ListH\x00R\x11deletedOperationsB\a\n" + - "\x05event\"|\n" + - "\x0fOperationBackup\x128\n" + - "\vlast_status\x18\x03 \x01(\v2\x17.v1.BackupProgressEntryR\n" + - "lastStatus\x12/\n" + - "\x06errors\x18\x04 \x03(\v2\x17.v1.BackupProgressErrorR\x06errors\"`\n" + - "\x16OperationIndexSnapshot\x12.\n" + - "\bsnapshot\x18\x02 \x01(\v2\x12.v1.ResticSnapshotR\bsnapshot\x12\x16\n" + - "\x06forgot\x18\x03 \x01(\bR\x06forgot\"j\n" + - "\x0fOperationForget\x12*\n" + - "\x06forget\x18\x01 \x03(\v2\x12.v1.ResticSnapshotR\x06forget\x12+\n" + - "\x06policy\x18\x02 \x01(\v2\x13.v1.RetentionPolicyR\x06policy\"Q\n" + - "\x0eOperationPrune\x12\x1a\n" + - "\x06output\x18\x01 \x01(\tB\x02\x18\x01R\x06output\x12#\n" + - "\routput_logref\x18\x02 \x01(\tR\foutputLogref\"Q\n" + - "\x0eOperationCheck\x12\x1a\n" + - "\x06output\x18\x01 \x01(\tB\x02\x18\x01R\x06output\x12#\n" + - "\routput_logref\x18\x02 \x01(\tR\foutputLogref\"\x80\x01\n" + - "\x13OperationRunCommand\x12\x18\n" + - "\acommand\x18\x01 \x01(\tR\acommand\x12#\n" + - "\routput_logref\x18\x02 \x01(\tR\foutputLogref\x12*\n" + - "\x11output_size_bytes\x18\x03 \x01(\x03R\x0foutputSizeBytes\"y\n" + - "\x10OperationRestore\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12\x16\n" + - "\x06target\x18\x02 \x01(\tR\x06target\x129\n" + - "\vlast_status\x18\x03 \x01(\v2\x18.v1.RestoreProgressEntryR\n" + - "lastStatus\"5\n" + - "\x0eOperationStats\x12#\n" + - "\x05stats\x18\x01 \x01(\v2\r.v1.RepoStatsR\x05stats\"\x9a\x01\n" + - "\x10OperationRunHook\x12\x1b\n" + - "\tparent_op\x18\x04 \x01(\x03R\bparentOp\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12#\n" + - "\routput_logref\x18\x02 \x01(\tR\foutputLogref\x120\n" + - "\tcondition\x18\x03 \x01(\x0e2\x12.v1.Hook.ConditionR\tcondition*`\n" + - "\x12OperationEventType\x12\x11\n" + - "\rEVENT_UNKNOWN\x10\x00\x12\x11\n" + - "\rEVENT_CREATED\x10\x01\x12\x11\n" + - "\rEVENT_UPDATED\x10\x02\x12\x11\n" + - "\rEVENT_DELETED\x10\x03*\xc2\x01\n" + - "\x0fOperationStatus\x12\x12\n" + - "\x0eSTATUS_UNKNOWN\x10\x00\x12\x12\n" + - "\x0eSTATUS_PENDING\x10\x01\x12\x15\n" + - "\x11STATUS_INPROGRESS\x10\x02\x12\x12\n" + - "\x0eSTATUS_SUCCESS\x10\x03\x12\x12\n" + - "\x0eSTATUS_WARNING\x10\a\x12\x10\n" + - "\fSTATUS_ERROR\x10\x04\x12\x1b\n" + - "\x17STATUS_SYSTEM_CANCELLED\x10\x05\x12\x19\n" + - "\x15STATUS_USER_CANCELLED\x10\x06B,Z*github.com/garethgeorge/backrest/gen/go/v1b\x06proto3" - -var ( - file_v1_operations_proto_rawDescOnce sync.Once - file_v1_operations_proto_rawDescData []byte -) - -func file_v1_operations_proto_rawDescGZIP() []byte { - file_v1_operations_proto_rawDescOnce.Do(func() { - file_v1_operations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_operations_proto_rawDesc), len(file_v1_operations_proto_rawDesc))) - }) - return file_v1_operations_proto_rawDescData -} - -var file_v1_operations_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1_operations_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_v1_operations_proto_goTypes = []any{ - (OperationEventType)(0), // 0: v1.OperationEventType - (OperationStatus)(0), // 1: v1.OperationStatus - (*OperationList)(nil), // 2: v1.OperationList - (*Operation)(nil), // 3: v1.Operation - (*OperationEvent)(nil), // 4: v1.OperationEvent - (*OperationBackup)(nil), // 5: v1.OperationBackup - (*OperationIndexSnapshot)(nil), // 6: v1.OperationIndexSnapshot - (*OperationForget)(nil), // 7: v1.OperationForget - (*OperationPrune)(nil), // 8: v1.OperationPrune - (*OperationCheck)(nil), // 9: v1.OperationCheck - (*OperationRunCommand)(nil), // 10: v1.OperationRunCommand - (*OperationRestore)(nil), // 11: v1.OperationRestore - (*OperationStats)(nil), // 12: v1.OperationStats - (*OperationRunHook)(nil), // 13: v1.OperationRunHook - (*types.Empty)(nil), // 14: types.Empty - (*types.Int64List)(nil), // 15: types.Int64List - (*BackupProgressEntry)(nil), // 16: v1.BackupProgressEntry - (*BackupProgressError)(nil), // 17: v1.BackupProgressError - (*ResticSnapshot)(nil), // 18: v1.ResticSnapshot - (*RetentionPolicy)(nil), // 19: v1.RetentionPolicy - (*RestoreProgressEntry)(nil), // 20: v1.RestoreProgressEntry - (*RepoStats)(nil), // 21: v1.RepoStats - (Hook_Condition)(0), // 22: v1.Hook.Condition -} -var file_v1_operations_proto_depIdxs = []int32{ - 3, // 0: v1.OperationList.operations:type_name -> v1.Operation - 1, // 1: v1.Operation.status:type_name -> v1.OperationStatus - 5, // 2: v1.Operation.operation_backup:type_name -> v1.OperationBackup - 6, // 3: v1.Operation.operation_index_snapshot:type_name -> v1.OperationIndexSnapshot - 7, // 4: v1.Operation.operation_forget:type_name -> v1.OperationForget - 8, // 5: v1.Operation.operation_prune:type_name -> v1.OperationPrune - 11, // 6: v1.Operation.operation_restore:type_name -> v1.OperationRestore - 12, // 7: v1.Operation.operation_stats:type_name -> v1.OperationStats - 13, // 8: v1.Operation.operation_run_hook:type_name -> v1.OperationRunHook - 9, // 9: v1.Operation.operation_check:type_name -> v1.OperationCheck - 10, // 10: v1.Operation.operation_run_command:type_name -> v1.OperationRunCommand - 14, // 11: v1.OperationEvent.keep_alive:type_name -> types.Empty - 2, // 12: v1.OperationEvent.created_operations:type_name -> v1.OperationList - 2, // 13: v1.OperationEvent.updated_operations:type_name -> v1.OperationList - 15, // 14: v1.OperationEvent.deleted_operations:type_name -> types.Int64List - 16, // 15: v1.OperationBackup.last_status:type_name -> v1.BackupProgressEntry - 17, // 16: v1.OperationBackup.errors:type_name -> v1.BackupProgressError - 18, // 17: v1.OperationIndexSnapshot.snapshot:type_name -> v1.ResticSnapshot - 18, // 18: v1.OperationForget.forget:type_name -> v1.ResticSnapshot - 19, // 19: v1.OperationForget.policy:type_name -> v1.RetentionPolicy - 20, // 20: v1.OperationRestore.last_status:type_name -> v1.RestoreProgressEntry - 21, // 21: v1.OperationStats.stats:type_name -> v1.RepoStats - 22, // 22: v1.OperationRunHook.condition:type_name -> v1.Hook.Condition - 23, // [23:23] is the sub-list for method output_type - 23, // [23:23] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_v1_operations_proto_init() } -func file_v1_operations_proto_init() { - if File_v1_operations_proto != nil { - return - } - file_v1_restic_proto_init() - file_v1_config_proto_init() - file_v1_operations_proto_msgTypes[1].OneofWrappers = []any{ - (*Operation_OperationBackup)(nil), - (*Operation_OperationIndexSnapshot)(nil), - (*Operation_OperationForget)(nil), - (*Operation_OperationPrune)(nil), - (*Operation_OperationRestore)(nil), - (*Operation_OperationStats)(nil), - (*Operation_OperationRunHook)(nil), - (*Operation_OperationCheck)(nil), - (*Operation_OperationRunCommand)(nil), - } - file_v1_operations_proto_msgTypes[2].OneofWrappers = []any{ - (*OperationEvent_KeepAlive)(nil), - (*OperationEvent_CreatedOperations)(nil), - (*OperationEvent_UpdatedOperations)(nil), - (*OperationEvent_DeletedOperations)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_operations_proto_rawDesc), len(file_v1_operations_proto_rawDesc)), - NumEnums: 2, - NumMessages: 12, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_operations_proto_goTypes, - DependencyIndexes: file_v1_operations_proto_depIdxs, - EnumInfos: file_v1_operations_proto_enumTypes, - MessageInfos: file_v1_operations_proto_msgTypes, - }.Build() - File_v1_operations_proto = out.File - file_v1_operations_proto_goTypes = nil - file_v1_operations_proto_depIdxs = nil -} diff --git a/gen/go/v1/restic.pb.go b/gen/go/v1/restic.pb.go deleted file mode 100644 index e588c2238..000000000 --- a/gen/go/v1/restic.pb.go +++ /dev/null @@ -1,1004 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: v1/restic.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ResticSnapshot represents a restic snapshot. -type ResticSnapshot struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - UnixTimeMs int64 `protobuf:"varint,2,opt,name=unix_time_ms,json=unixTimeMs,proto3" json:"unix_time_ms,omitempty"` - Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - Tree string `protobuf:"bytes,5,opt,name=tree,proto3" json:"tree,omitempty"` // tree hash - Parent string `protobuf:"bytes,6,opt,name=parent,proto3" json:"parent,omitempty"` // parent snapshot's id - Paths []string `protobuf:"bytes,7,rep,name=paths,proto3" json:"paths,omitempty"` - Tags []string `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"` - Summary *SnapshotSummary `protobuf:"bytes,9,opt,name=summary,proto3" json:"summary,omitempty"` // added in 0.17.0 restic outputs the summary in the snapshot - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ResticSnapshot) Reset() { - *x = ResticSnapshot{} - mi := &file_v1_restic_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ResticSnapshot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResticSnapshot) ProtoMessage() {} - -func (x *ResticSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResticSnapshot.ProtoReflect.Descriptor instead. -func (*ResticSnapshot) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{0} -} - -func (x *ResticSnapshot) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ResticSnapshot) GetUnixTimeMs() int64 { - if x != nil { - return x.UnixTimeMs - } - return 0 -} - -func (x *ResticSnapshot) GetHostname() string { - if x != nil { - return x.Hostname - } - return "" -} - -func (x *ResticSnapshot) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ResticSnapshot) GetTree() string { - if x != nil { - return x.Tree - } - return "" -} - -func (x *ResticSnapshot) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *ResticSnapshot) GetPaths() []string { - if x != nil { - return x.Paths - } - return nil -} - -func (x *ResticSnapshot) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *ResticSnapshot) GetSummary() *SnapshotSummary { - if x != nil { - return x.Summary - } - return nil -} - -type SnapshotSummary struct { - state protoimpl.MessageState `protogen:"open.v1"` - FilesNew int64 `protobuf:"varint,1,opt,name=files_new,json=filesNew,proto3" json:"files_new,omitempty"` - FilesChanged int64 `protobuf:"varint,2,opt,name=files_changed,json=filesChanged,proto3" json:"files_changed,omitempty"` - FilesUnmodified int64 `protobuf:"varint,3,opt,name=files_unmodified,json=filesUnmodified,proto3" json:"files_unmodified,omitempty"` - DirsNew int64 `protobuf:"varint,4,opt,name=dirs_new,json=dirsNew,proto3" json:"dirs_new,omitempty"` - DirsChanged int64 `protobuf:"varint,5,opt,name=dirs_changed,json=dirsChanged,proto3" json:"dirs_changed,omitempty"` - DirsUnmodified int64 `protobuf:"varint,6,opt,name=dirs_unmodified,json=dirsUnmodified,proto3" json:"dirs_unmodified,omitempty"` - DataBlobs int64 `protobuf:"varint,7,opt,name=data_blobs,json=dataBlobs,proto3" json:"data_blobs,omitempty"` - TreeBlobs int64 `protobuf:"varint,8,opt,name=tree_blobs,json=treeBlobs,proto3" json:"tree_blobs,omitempty"` - DataAdded int64 `protobuf:"varint,9,opt,name=data_added,json=dataAdded,proto3" json:"data_added,omitempty"` - TotalFilesProcessed int64 `protobuf:"varint,10,opt,name=total_files_processed,json=totalFilesProcessed,proto3" json:"total_files_processed,omitempty"` - TotalBytesProcessed int64 `protobuf:"varint,11,opt,name=total_bytes_processed,json=totalBytesProcessed,proto3" json:"total_bytes_processed,omitempty"` - TotalDuration float64 `protobuf:"fixed64,12,opt,name=total_duration,json=totalDuration,proto3" json:"total_duration,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SnapshotSummary) Reset() { - *x = SnapshotSummary{} - mi := &file_v1_restic_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SnapshotSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SnapshotSummary) ProtoMessage() {} - -func (x *SnapshotSummary) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SnapshotSummary.ProtoReflect.Descriptor instead. -func (*SnapshotSummary) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{1} -} - -func (x *SnapshotSummary) GetFilesNew() int64 { - if x != nil { - return x.FilesNew - } - return 0 -} - -func (x *SnapshotSummary) GetFilesChanged() int64 { - if x != nil { - return x.FilesChanged - } - return 0 -} - -func (x *SnapshotSummary) GetFilesUnmodified() int64 { - if x != nil { - return x.FilesUnmodified - } - return 0 -} - -func (x *SnapshotSummary) GetDirsNew() int64 { - if x != nil { - return x.DirsNew - } - return 0 -} - -func (x *SnapshotSummary) GetDirsChanged() int64 { - if x != nil { - return x.DirsChanged - } - return 0 -} - -func (x *SnapshotSummary) GetDirsUnmodified() int64 { - if x != nil { - return x.DirsUnmodified - } - return 0 -} - -func (x *SnapshotSummary) GetDataBlobs() int64 { - if x != nil { - return x.DataBlobs - } - return 0 -} - -func (x *SnapshotSummary) GetTreeBlobs() int64 { - if x != nil { - return x.TreeBlobs - } - return 0 -} - -func (x *SnapshotSummary) GetDataAdded() int64 { - if x != nil { - return x.DataAdded - } - return 0 -} - -func (x *SnapshotSummary) GetTotalFilesProcessed() int64 { - if x != nil { - return x.TotalFilesProcessed - } - return 0 -} - -func (x *SnapshotSummary) GetTotalBytesProcessed() int64 { - if x != nil { - return x.TotalBytesProcessed - } - return 0 -} - -func (x *SnapshotSummary) GetTotalDuration() float64 { - if x != nil { - return x.TotalDuration - } - return 0 -} - -// ResticSnapshotList represents a list of restic snapshots. -type ResticSnapshotList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Snapshots []*ResticSnapshot `protobuf:"bytes,1,rep,name=snapshots,proto3" json:"snapshots,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ResticSnapshotList) Reset() { - *x = ResticSnapshotList{} - mi := &file_v1_restic_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ResticSnapshotList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResticSnapshotList) ProtoMessage() {} - -func (x *ResticSnapshotList) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResticSnapshotList.ProtoReflect.Descriptor instead. -func (*ResticSnapshotList) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{2} -} - -func (x *ResticSnapshotList) GetSnapshots() []*ResticSnapshot { - if x != nil { - return x.Snapshots - } - return nil -} - -// BackupProgressEntriy represents a single entry in the backup progress stream. -type BackupProgressEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Entry: - // - // *BackupProgressEntry_Status - // *BackupProgressEntry_Summary - Entry isBackupProgressEntry_Entry `protobuf_oneof:"entry"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupProgressEntry) Reset() { - *x = BackupProgressEntry{} - mi := &file_v1_restic_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupProgressEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupProgressEntry) ProtoMessage() {} - -func (x *BackupProgressEntry) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupProgressEntry.ProtoReflect.Descriptor instead. -func (*BackupProgressEntry) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{3} -} - -func (x *BackupProgressEntry) GetEntry() isBackupProgressEntry_Entry { - if x != nil { - return x.Entry - } - return nil -} - -func (x *BackupProgressEntry) GetStatus() *BackupProgressStatusEntry { - if x != nil { - if x, ok := x.Entry.(*BackupProgressEntry_Status); ok { - return x.Status - } - } - return nil -} - -func (x *BackupProgressEntry) GetSummary() *BackupProgressSummary { - if x != nil { - if x, ok := x.Entry.(*BackupProgressEntry_Summary); ok { - return x.Summary - } - } - return nil -} - -type isBackupProgressEntry_Entry interface { - isBackupProgressEntry_Entry() -} - -type BackupProgressEntry_Status struct { - Status *BackupProgressStatusEntry `protobuf:"bytes,1,opt,name=status,proto3,oneof"` -} - -type BackupProgressEntry_Summary struct { - Summary *BackupProgressSummary `protobuf:"bytes,2,opt,name=summary,proto3,oneof"` -} - -func (*BackupProgressEntry_Status) isBackupProgressEntry_Entry() {} - -func (*BackupProgressEntry_Summary) isBackupProgressEntry_Entry() {} - -// BackupProgressStatusEntry represents a single status entry in the backup progress stream. -type BackupProgressStatusEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - // See https://restic.readthedocs.io/en/stable/075_scripting.html#id1 - PercentDone float64 `protobuf:"fixed64,1,opt,name=percent_done,json=percentDone,proto3" json:"percent_done,omitempty"` // 0.0 - 1.0 - TotalFiles int64 `protobuf:"varint,2,opt,name=total_files,json=totalFiles,proto3" json:"total_files,omitempty"` - TotalBytes int64 `protobuf:"varint,3,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` - FilesDone int64 `protobuf:"varint,4,opt,name=files_done,json=filesDone,proto3" json:"files_done,omitempty"` - BytesDone int64 `protobuf:"varint,5,opt,name=bytes_done,json=bytesDone,proto3" json:"bytes_done,omitempty"` - CurrentFile []string `protobuf:"bytes,6,rep,name=current_file,json=currentFile,proto3" json:"current_file,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupProgressStatusEntry) Reset() { - *x = BackupProgressStatusEntry{} - mi := &file_v1_restic_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupProgressStatusEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupProgressStatusEntry) ProtoMessage() {} - -func (x *BackupProgressStatusEntry) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupProgressStatusEntry.ProtoReflect.Descriptor instead. -func (*BackupProgressStatusEntry) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{4} -} - -func (x *BackupProgressStatusEntry) GetPercentDone() float64 { - if x != nil { - return x.PercentDone - } - return 0 -} - -func (x *BackupProgressStatusEntry) GetTotalFiles() int64 { - if x != nil { - return x.TotalFiles - } - return 0 -} - -func (x *BackupProgressStatusEntry) GetTotalBytes() int64 { - if x != nil { - return x.TotalBytes - } - return 0 -} - -func (x *BackupProgressStatusEntry) GetFilesDone() int64 { - if x != nil { - return x.FilesDone - } - return 0 -} - -func (x *BackupProgressStatusEntry) GetBytesDone() int64 { - if x != nil { - return x.BytesDone - } - return 0 -} - -func (x *BackupProgressStatusEntry) GetCurrentFile() []string { - if x != nil { - return x.CurrentFile - } - return nil -} - -// BackupProgressSummary represents a the summary event emitted at the end of a backup stream. -type BackupProgressSummary struct { - state protoimpl.MessageState `protogen:"open.v1"` - // See https://restic.readthedocs.io/en/stable/075_scripting.html#summary - FilesNew int64 `protobuf:"varint,1,opt,name=files_new,json=filesNew,proto3" json:"files_new,omitempty"` - FilesChanged int64 `protobuf:"varint,2,opt,name=files_changed,json=filesChanged,proto3" json:"files_changed,omitempty"` - FilesUnmodified int64 `protobuf:"varint,3,opt,name=files_unmodified,json=filesUnmodified,proto3" json:"files_unmodified,omitempty"` - DirsNew int64 `protobuf:"varint,4,opt,name=dirs_new,json=dirsNew,proto3" json:"dirs_new,omitempty"` - DirsChanged int64 `protobuf:"varint,5,opt,name=dirs_changed,json=dirsChanged,proto3" json:"dirs_changed,omitempty"` - DirsUnmodified int64 `protobuf:"varint,6,opt,name=dirs_unmodified,json=dirsUnmodified,proto3" json:"dirs_unmodified,omitempty"` - DataBlobs int64 `protobuf:"varint,7,opt,name=data_blobs,json=dataBlobs,proto3" json:"data_blobs,omitempty"` - TreeBlobs int64 `protobuf:"varint,8,opt,name=tree_blobs,json=treeBlobs,proto3" json:"tree_blobs,omitempty"` - DataAdded int64 `protobuf:"varint,9,opt,name=data_added,json=dataAdded,proto3" json:"data_added,omitempty"` - TotalFilesProcessed int64 `protobuf:"varint,10,opt,name=total_files_processed,json=totalFilesProcessed,proto3" json:"total_files_processed,omitempty"` - TotalBytesProcessed int64 `protobuf:"varint,11,opt,name=total_bytes_processed,json=totalBytesProcessed,proto3" json:"total_bytes_processed,omitempty"` - TotalDuration float64 `protobuf:"fixed64,12,opt,name=total_duration,json=totalDuration,proto3" json:"total_duration,omitempty"` - SnapshotId string `protobuf:"bytes,13,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupProgressSummary) Reset() { - *x = BackupProgressSummary{} - mi := &file_v1_restic_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupProgressSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupProgressSummary) ProtoMessage() {} - -func (x *BackupProgressSummary) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupProgressSummary.ProtoReflect.Descriptor instead. -func (*BackupProgressSummary) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{5} -} - -func (x *BackupProgressSummary) GetFilesNew() int64 { - if x != nil { - return x.FilesNew - } - return 0 -} - -func (x *BackupProgressSummary) GetFilesChanged() int64 { - if x != nil { - return x.FilesChanged - } - return 0 -} - -func (x *BackupProgressSummary) GetFilesUnmodified() int64 { - if x != nil { - return x.FilesUnmodified - } - return 0 -} - -func (x *BackupProgressSummary) GetDirsNew() int64 { - if x != nil { - return x.DirsNew - } - return 0 -} - -func (x *BackupProgressSummary) GetDirsChanged() int64 { - if x != nil { - return x.DirsChanged - } - return 0 -} - -func (x *BackupProgressSummary) GetDirsUnmodified() int64 { - if x != nil { - return x.DirsUnmodified - } - return 0 -} - -func (x *BackupProgressSummary) GetDataBlobs() int64 { - if x != nil { - return x.DataBlobs - } - return 0 -} - -func (x *BackupProgressSummary) GetTreeBlobs() int64 { - if x != nil { - return x.TreeBlobs - } - return 0 -} - -func (x *BackupProgressSummary) GetDataAdded() int64 { - if x != nil { - return x.DataAdded - } - return 0 -} - -func (x *BackupProgressSummary) GetTotalFilesProcessed() int64 { - if x != nil { - return x.TotalFilesProcessed - } - return 0 -} - -func (x *BackupProgressSummary) GetTotalBytesProcessed() int64 { - if x != nil { - return x.TotalBytesProcessed - } - return 0 -} - -func (x *BackupProgressSummary) GetTotalDuration() float64 { - if x != nil { - return x.TotalDuration - } - return 0 -} - -func (x *BackupProgressSummary) GetSnapshotId() string { - if x != nil { - return x.SnapshotId - } - return "" -} - -type BackupProgressError struct { - state protoimpl.MessageState `protogen:"open.v1"` - // See https://restic.readthedocs.io/en/stable/075_scripting.html#error - Item string `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` - During string `protobuf:"bytes,2,opt,name=during,proto3" json:"during,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupProgressError) Reset() { - *x = BackupProgressError{} - mi := &file_v1_restic_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupProgressError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupProgressError) ProtoMessage() {} - -func (x *BackupProgressError) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackupProgressError.ProtoReflect.Descriptor instead. -func (*BackupProgressError) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{6} -} - -func (x *BackupProgressError) GetItem() string { - if x != nil { - return x.Item - } - return "" -} - -func (x *BackupProgressError) GetDuring() string { - if x != nil { - return x.During - } - return "" -} - -func (x *BackupProgressError) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// RestoreProgressEvent represents a single entry in the restore progress stream. -type RestoreProgressEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - MessageType string `protobuf:"bytes,1,opt,name=message_type,json=messageType,proto3" json:"message_type,omitempty"` // "summary" or "status" - SecondsElapsed float64 `protobuf:"fixed64,2,opt,name=seconds_elapsed,json=secondsElapsed,proto3" json:"seconds_elapsed,omitempty"` - TotalBytes int64 `protobuf:"varint,3,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` - BytesRestored int64 `protobuf:"varint,4,opt,name=bytes_restored,json=bytesRestored,proto3" json:"bytes_restored,omitempty"` - TotalFiles int64 `protobuf:"varint,5,opt,name=total_files,json=totalFiles,proto3" json:"total_files,omitempty"` - FilesRestored int64 `protobuf:"varint,6,opt,name=files_restored,json=filesRestored,proto3" json:"files_restored,omitempty"` - PercentDone float64 `protobuf:"fixed64,7,opt,name=percent_done,json=percentDone,proto3" json:"percent_done,omitempty"` // 0.0 - 1.0 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreProgressEntry) Reset() { - *x = RestoreProgressEntry{} - mi := &file_v1_restic_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreProgressEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreProgressEntry) ProtoMessage() {} - -func (x *RestoreProgressEntry) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestoreProgressEntry.ProtoReflect.Descriptor instead. -func (*RestoreProgressEntry) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{7} -} - -func (x *RestoreProgressEntry) GetMessageType() string { - if x != nil { - return x.MessageType - } - return "" -} - -func (x *RestoreProgressEntry) GetSecondsElapsed() float64 { - if x != nil { - return x.SecondsElapsed - } - return 0 -} - -func (x *RestoreProgressEntry) GetTotalBytes() int64 { - if x != nil { - return x.TotalBytes - } - return 0 -} - -func (x *RestoreProgressEntry) GetBytesRestored() int64 { - if x != nil { - return x.BytesRestored - } - return 0 -} - -func (x *RestoreProgressEntry) GetTotalFiles() int64 { - if x != nil { - return x.TotalFiles - } - return 0 -} - -func (x *RestoreProgressEntry) GetFilesRestored() int64 { - if x != nil { - return x.FilesRestored - } - return 0 -} - -func (x *RestoreProgressEntry) GetPercentDone() float64 { - if x != nil { - return x.PercentDone - } - return 0 -} - -type RepoStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - TotalSize int64 `protobuf:"varint,1,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` - TotalUncompressedSize int64 `protobuf:"varint,2,opt,name=total_uncompressed_size,json=totalUncompressedSize,proto3" json:"total_uncompressed_size,omitempty"` - CompressionRatio float64 `protobuf:"fixed64,3,opt,name=compression_ratio,json=compressionRatio,proto3" json:"compression_ratio,omitempty"` - TotalBlobCount int64 `protobuf:"varint,5,opt,name=total_blob_count,json=totalBlobCount,proto3" json:"total_blob_count,omitempty"` - SnapshotCount int64 `protobuf:"varint,6,opt,name=snapshot_count,json=snapshotCount,proto3" json:"snapshot_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RepoStats) Reset() { - *x = RepoStats{} - mi := &file_v1_restic_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RepoStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepoStats) ProtoMessage() {} - -func (x *RepoStats) ProtoReflect() protoreflect.Message { - mi := &file_v1_restic_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepoStats.ProtoReflect.Descriptor instead. -func (*RepoStats) Descriptor() ([]byte, []int) { - return file_v1_restic_proto_rawDescGZIP(), []int{8} -} - -func (x *RepoStats) GetTotalSize() int64 { - if x != nil { - return x.TotalSize - } - return 0 -} - -func (x *RepoStats) GetTotalUncompressedSize() int64 { - if x != nil { - return x.TotalUncompressedSize - } - return 0 -} - -func (x *RepoStats) GetCompressionRatio() float64 { - if x != nil { - return x.CompressionRatio - } - return 0 -} - -func (x *RepoStats) GetTotalBlobCount() int64 { - if x != nil { - return x.TotalBlobCount - } - return 0 -} - -func (x *RepoStats) GetSnapshotCount() int64 { - if x != nil { - return x.SnapshotCount - } - return 0 -} - -var File_v1_restic_proto protoreflect.FileDescriptor - -const file_v1_restic_proto_rawDesc = "" + - "\n" + - "\x0fv1/restic.proto\x12\x02v1\"\xff\x01\n" + - "\x0eResticSnapshot\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12 \n" + - "\funix_time_ms\x18\x02 \x01(\x03R\n" + - "unixTimeMs\x12\x1a\n" + - "\bhostname\x18\x03 \x01(\tR\bhostname\x12\x1a\n" + - "\busername\x18\x04 \x01(\tR\busername\x12\x12\n" + - "\x04tree\x18\x05 \x01(\tR\x04tree\x12\x16\n" + - "\x06parent\x18\x06 \x01(\tR\x06parent\x12\x14\n" + - "\x05paths\x18\a \x03(\tR\x05paths\x12\x12\n" + - "\x04tags\x18\b \x03(\tR\x04tags\x12-\n" + - "\asummary\x18\t \x01(\v2\x13.v1.SnapshotSummaryR\asummary\"\xd1\x03\n" + - "\x0fSnapshotSummary\x12\x1b\n" + - "\tfiles_new\x18\x01 \x01(\x03R\bfilesNew\x12#\n" + - "\rfiles_changed\x18\x02 \x01(\x03R\ffilesChanged\x12)\n" + - "\x10files_unmodified\x18\x03 \x01(\x03R\x0ffilesUnmodified\x12\x19\n" + - "\bdirs_new\x18\x04 \x01(\x03R\adirsNew\x12!\n" + - "\fdirs_changed\x18\x05 \x01(\x03R\vdirsChanged\x12'\n" + - "\x0fdirs_unmodified\x18\x06 \x01(\x03R\x0edirsUnmodified\x12\x1d\n" + - "\n" + - "data_blobs\x18\a \x01(\x03R\tdataBlobs\x12\x1d\n" + - "\n" + - "tree_blobs\x18\b \x01(\x03R\ttreeBlobs\x12\x1d\n" + - "\n" + - "data_added\x18\t \x01(\x03R\tdataAdded\x122\n" + - "\x15total_files_processed\x18\n" + - " \x01(\x03R\x13totalFilesProcessed\x122\n" + - "\x15total_bytes_processed\x18\v \x01(\x03R\x13totalBytesProcessed\x12%\n" + - "\x0etotal_duration\x18\f \x01(\x01R\rtotalDuration\"F\n" + - "\x12ResticSnapshotList\x120\n" + - "\tsnapshots\x18\x01 \x03(\v2\x12.v1.ResticSnapshotR\tsnapshots\"\x8e\x01\n" + - "\x13BackupProgressEntry\x127\n" + - "\x06status\x18\x01 \x01(\v2\x1d.v1.BackupProgressStatusEntryH\x00R\x06status\x125\n" + - "\asummary\x18\x02 \x01(\v2\x19.v1.BackupProgressSummaryH\x00R\asummaryB\a\n" + - "\x05entry\"\xe1\x01\n" + - "\x19BackupProgressStatusEntry\x12!\n" + - "\fpercent_done\x18\x01 \x01(\x01R\vpercentDone\x12\x1f\n" + - "\vtotal_files\x18\x02 \x01(\x03R\n" + - "totalFiles\x12\x1f\n" + - "\vtotal_bytes\x18\x03 \x01(\x03R\n" + - "totalBytes\x12\x1d\n" + - "\n" + - "files_done\x18\x04 \x01(\x03R\tfilesDone\x12\x1d\n" + - "\n" + - "bytes_done\x18\x05 \x01(\x03R\tbytesDone\x12!\n" + - "\fcurrent_file\x18\x06 \x03(\tR\vcurrentFile\"\xf8\x03\n" + - "\x15BackupProgressSummary\x12\x1b\n" + - "\tfiles_new\x18\x01 \x01(\x03R\bfilesNew\x12#\n" + - "\rfiles_changed\x18\x02 \x01(\x03R\ffilesChanged\x12)\n" + - "\x10files_unmodified\x18\x03 \x01(\x03R\x0ffilesUnmodified\x12\x19\n" + - "\bdirs_new\x18\x04 \x01(\x03R\adirsNew\x12!\n" + - "\fdirs_changed\x18\x05 \x01(\x03R\vdirsChanged\x12'\n" + - "\x0fdirs_unmodified\x18\x06 \x01(\x03R\x0edirsUnmodified\x12\x1d\n" + - "\n" + - "data_blobs\x18\a \x01(\x03R\tdataBlobs\x12\x1d\n" + - "\n" + - "tree_blobs\x18\b \x01(\x03R\ttreeBlobs\x12\x1d\n" + - "\n" + - "data_added\x18\t \x01(\x03R\tdataAdded\x122\n" + - "\x15total_files_processed\x18\n" + - " \x01(\x03R\x13totalFilesProcessed\x122\n" + - "\x15total_bytes_processed\x18\v \x01(\x03R\x13totalBytesProcessed\x12%\n" + - "\x0etotal_duration\x18\f \x01(\x01R\rtotalDuration\x12\x1f\n" + - "\vsnapshot_id\x18\r \x01(\tR\n" + - "snapshotId\"[\n" + - "\x13BackupProgressError\x12\x12\n" + - "\x04item\x18\x01 \x01(\tR\x04item\x12\x16\n" + - "\x06during\x18\x02 \x01(\tR\x06during\x12\x18\n" + - "\amessage\x18\x03 \x01(\tR\amessage\"\x95\x02\n" + - "\x14RestoreProgressEntry\x12!\n" + - "\fmessage_type\x18\x01 \x01(\tR\vmessageType\x12'\n" + - "\x0fseconds_elapsed\x18\x02 \x01(\x01R\x0esecondsElapsed\x12\x1f\n" + - "\vtotal_bytes\x18\x03 \x01(\x03R\n" + - "totalBytes\x12%\n" + - "\x0ebytes_restored\x18\x04 \x01(\x03R\rbytesRestored\x12\x1f\n" + - "\vtotal_files\x18\x05 \x01(\x03R\n" + - "totalFiles\x12%\n" + - "\x0efiles_restored\x18\x06 \x01(\x03R\rfilesRestored\x12!\n" + - "\fpercent_done\x18\a \x01(\x01R\vpercentDone\"\xe0\x01\n" + - "\tRepoStats\x12\x1d\n" + - "\n" + - "total_size\x18\x01 \x01(\x03R\ttotalSize\x126\n" + - "\x17total_uncompressed_size\x18\x02 \x01(\x03R\x15totalUncompressedSize\x12+\n" + - "\x11compression_ratio\x18\x03 \x01(\x01R\x10compressionRatio\x12(\n" + - "\x10total_blob_count\x18\x05 \x01(\x03R\x0etotalBlobCount\x12%\n" + - "\x0esnapshot_count\x18\x06 \x01(\x03R\rsnapshotCountB,Z*github.com/garethgeorge/backrest/gen/go/v1b\x06proto3" - -var ( - file_v1_restic_proto_rawDescOnce sync.Once - file_v1_restic_proto_rawDescData []byte -) - -func file_v1_restic_proto_rawDescGZIP() []byte { - file_v1_restic_proto_rawDescOnce.Do(func() { - file_v1_restic_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_restic_proto_rawDesc), len(file_v1_restic_proto_rawDesc))) - }) - return file_v1_restic_proto_rawDescData -} - -var file_v1_restic_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_v1_restic_proto_goTypes = []any{ - (*ResticSnapshot)(nil), // 0: v1.ResticSnapshot - (*SnapshotSummary)(nil), // 1: v1.SnapshotSummary - (*ResticSnapshotList)(nil), // 2: v1.ResticSnapshotList - (*BackupProgressEntry)(nil), // 3: v1.BackupProgressEntry - (*BackupProgressStatusEntry)(nil), // 4: v1.BackupProgressStatusEntry - (*BackupProgressSummary)(nil), // 5: v1.BackupProgressSummary - (*BackupProgressError)(nil), // 6: v1.BackupProgressError - (*RestoreProgressEntry)(nil), // 7: v1.RestoreProgressEntry - (*RepoStats)(nil), // 8: v1.RepoStats -} -var file_v1_restic_proto_depIdxs = []int32{ - 1, // 0: v1.ResticSnapshot.summary:type_name -> v1.SnapshotSummary - 0, // 1: v1.ResticSnapshotList.snapshots:type_name -> v1.ResticSnapshot - 4, // 2: v1.BackupProgressEntry.status:type_name -> v1.BackupProgressStatusEntry - 5, // 3: v1.BackupProgressEntry.summary:type_name -> v1.BackupProgressSummary - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_v1_restic_proto_init() } -func file_v1_restic_proto_init() { - if File_v1_restic_proto != nil { - return - } - file_v1_restic_proto_msgTypes[3].OneofWrappers = []any{ - (*BackupProgressEntry_Status)(nil), - (*BackupProgressEntry_Summary)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_restic_proto_rawDesc), len(file_v1_restic_proto_rawDesc)), - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_restic_proto_goTypes, - DependencyIndexes: file_v1_restic_proto_depIdxs, - MessageInfos: file_v1_restic_proto_msgTypes, - }.Build() - File_v1_restic_proto = out.File - file_v1_restic_proto_goTypes = nil - file_v1_restic_proto_depIdxs = nil -} diff --git a/gen/go/v1/service_grpc.pb.go b/gen/go/v1/service_grpc.pb.go deleted file mode 100644 index a174a5cd6..000000000 --- a/gen/go/v1/service_grpc.pb.go +++ /dev/null @@ -1,874 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc (unknown) -// source: v1/service.proto - -package v1 - -import ( - context "context" - types "github.com/garethgeorge/backrest/gen/go/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Backrest_GetConfig_FullMethodName = "/v1.Backrest/GetConfig" - Backrest_SetConfig_FullMethodName = "/v1.Backrest/SetConfig" - Backrest_CheckRepoExists_FullMethodName = "/v1.Backrest/CheckRepoExists" - Backrest_AddRepo_FullMethodName = "/v1.Backrest/AddRepo" - Backrest_RemoveRepo_FullMethodName = "/v1.Backrest/RemoveRepo" - Backrest_GetOperationEvents_FullMethodName = "/v1.Backrest/GetOperationEvents" - Backrest_GetOperations_FullMethodName = "/v1.Backrest/GetOperations" - Backrest_ListSnapshots_FullMethodName = "/v1.Backrest/ListSnapshots" - Backrest_ListSnapshotFiles_FullMethodName = "/v1.Backrest/ListSnapshotFiles" - Backrest_Backup_FullMethodName = "/v1.Backrest/Backup" - Backrest_DoRepoTask_FullMethodName = "/v1.Backrest/DoRepoTask" - Backrest_Forget_FullMethodName = "/v1.Backrest/Forget" - Backrest_Restore_FullMethodName = "/v1.Backrest/Restore" - Backrest_Cancel_FullMethodName = "/v1.Backrest/Cancel" - Backrest_GetLogs_FullMethodName = "/v1.Backrest/GetLogs" - Backrest_RunCommand_FullMethodName = "/v1.Backrest/RunCommand" - Backrest_GetDownloadURL_FullMethodName = "/v1.Backrest/GetDownloadURL" - Backrest_ClearHistory_FullMethodName = "/v1.Backrest/ClearHistory" - Backrest_PathAutocomplete_FullMethodName = "/v1.Backrest/PathAutocomplete" - Backrest_GetSummaryDashboard_FullMethodName = "/v1.Backrest/GetSummaryDashboard" -) - -// BackrestClient is the client API for Backrest service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BackrestClient interface { - GetConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Config, error) - SetConfig(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) - CheckRepoExists(ctx context.Context, in *Repo, opts ...grpc.CallOption) (*types.BoolValue, error) - AddRepo(ctx context.Context, in *Repo, opts ...grpc.CallOption) (*Config, error) - RemoveRepo(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*Config, error) - GetOperationEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OperationEvent], error) - GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*OperationList, error) - ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ResticSnapshotList, error) - ListSnapshotFiles(ctx context.Context, in *ListSnapshotFilesRequest, opts ...grpc.CallOption) (*ListSnapshotFilesResponse, error) - // Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued. - Backup(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) - // DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued. - DoRepoTask(ctx context.Context, in *DoRepoTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued. - Forget(ctx context.Context, in *ForgetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Restore schedules a restore operation. - Restore(ctx context.Context, in *RestoreSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed. - Cancel(ctx context.Context, in *types.Int64Value, opts ...grpc.CallOption) (*emptypb.Empty, error) - // GetLogs returns the keyed large data for the given operation. - GetLogs(ctx context.Context, in *LogDataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[types.BytesValue], error) - // RunCommand executes a generic restic command on the repository. - RunCommand(ctx context.Context, in *RunCommandRequest, opts ...grpc.CallOption) (*types.Int64Value, error) - // GetDownloadURL returns a signed download URL given an operation ID and file path. - GetDownloadURL(ctx context.Context, in *GetDownloadURLRequest, opts ...grpc.CallOption) (*types.StringValue, error) - // Clears the history of operations - ClearHistory(ctx context.Context, in *ClearHistoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // PathAutocomplete provides path autocompletion options for a given filesystem path. - PathAutocomplete(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringList, error) - // GetSummaryDashboard returns data for the dashboard view. - GetSummaryDashboard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SummaryDashboardResponse, error) -} - -type backrestClient struct { - cc grpc.ClientConnInterface -} - -func NewBackrestClient(cc grpc.ClientConnInterface) BackrestClient { - return &backrestClient{cc} -} - -func (c *backrestClient) GetConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Config, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Config) - err := c.cc.Invoke(ctx, Backrest_GetConfig_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) SetConfig(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Config) - err := c.cc.Invoke(ctx, Backrest_SetConfig_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) CheckRepoExists(ctx context.Context, in *Repo, opts ...grpc.CallOption) (*types.BoolValue, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(types.BoolValue) - err := c.cc.Invoke(ctx, Backrest_CheckRepoExists_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) AddRepo(ctx context.Context, in *Repo, opts ...grpc.CallOption) (*Config, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Config) - err := c.cc.Invoke(ctx, Backrest_AddRepo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) RemoveRepo(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*Config, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Config) - err := c.cc.Invoke(ctx, Backrest_RemoveRepo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) GetOperationEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OperationEvent], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Backrest_ServiceDesc.Streams[0], Backrest_GetOperationEvents_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[emptypb.Empty, OperationEvent]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Backrest_GetOperationEventsClient = grpc.ServerStreamingClient[OperationEvent] - -func (c *backrestClient) GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*OperationList, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OperationList) - err := c.cc.Invoke(ctx, Backrest_GetOperations_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ResticSnapshotList, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ResticSnapshotList) - err := c.cc.Invoke(ctx, Backrest_ListSnapshots_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) ListSnapshotFiles(ctx context.Context, in *ListSnapshotFilesRequest, opts ...grpc.CallOption) (*ListSnapshotFilesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListSnapshotFilesResponse) - err := c.cc.Invoke(ctx, Backrest_ListSnapshotFiles_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) Backup(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_Backup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) DoRepoTask(ctx context.Context, in *DoRepoTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_DoRepoTask_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) Forget(ctx context.Context, in *ForgetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_Forget_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) Restore(ctx context.Context, in *RestoreSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_Restore_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) Cancel(ctx context.Context, in *types.Int64Value, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_Cancel_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) GetLogs(ctx context.Context, in *LogDataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[types.BytesValue], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Backrest_ServiceDesc.Streams[1], Backrest_GetLogs_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[LogDataRequest, types.BytesValue]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Backrest_GetLogsClient = grpc.ServerStreamingClient[types.BytesValue] - -func (c *backrestClient) RunCommand(ctx context.Context, in *RunCommandRequest, opts ...grpc.CallOption) (*types.Int64Value, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(types.Int64Value) - err := c.cc.Invoke(ctx, Backrest_RunCommand_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) GetDownloadURL(ctx context.Context, in *GetDownloadURLRequest, opts ...grpc.CallOption) (*types.StringValue, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(types.StringValue) - err := c.cc.Invoke(ctx, Backrest_GetDownloadURL_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) ClearHistory(ctx context.Context, in *ClearHistoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Backrest_ClearHistory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) PathAutocomplete(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringList, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(types.StringList) - err := c.cc.Invoke(ctx, Backrest_PathAutocomplete_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backrestClient) GetSummaryDashboard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SummaryDashboardResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SummaryDashboardResponse) - err := c.cc.Invoke(ctx, Backrest_GetSummaryDashboard_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BackrestServer is the server API for Backrest service. -// All implementations must embed UnimplementedBackrestServer -// for forward compatibility. -type BackrestServer interface { - GetConfig(context.Context, *emptypb.Empty) (*Config, error) - SetConfig(context.Context, *Config) (*Config, error) - CheckRepoExists(context.Context, *Repo) (*types.BoolValue, error) - AddRepo(context.Context, *Repo) (*Config, error) - RemoveRepo(context.Context, *types.StringValue) (*Config, error) - GetOperationEvents(*emptypb.Empty, grpc.ServerStreamingServer[OperationEvent]) error - GetOperations(context.Context, *GetOperationsRequest) (*OperationList, error) - ListSnapshots(context.Context, *ListSnapshotsRequest) (*ResticSnapshotList, error) - ListSnapshotFiles(context.Context, *ListSnapshotFilesRequest) (*ListSnapshotFilesResponse, error) - // Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued. - Backup(context.Context, *types.StringValue) (*emptypb.Empty, error) - // DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued. - DoRepoTask(context.Context, *DoRepoTaskRequest) (*emptypb.Empty, error) - // Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued. - Forget(context.Context, *ForgetRequest) (*emptypb.Empty, error) - // Restore schedules a restore operation. - Restore(context.Context, *RestoreSnapshotRequest) (*emptypb.Empty, error) - // Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed. - Cancel(context.Context, *types.Int64Value) (*emptypb.Empty, error) - // GetLogs returns the keyed large data for the given operation. - GetLogs(*LogDataRequest, grpc.ServerStreamingServer[types.BytesValue]) error - // RunCommand executes a generic restic command on the repository. - RunCommand(context.Context, *RunCommandRequest) (*types.Int64Value, error) - // GetDownloadURL returns a signed download URL given an operation ID and file path. - GetDownloadURL(context.Context, *GetDownloadURLRequest) (*types.StringValue, error) - // Clears the history of operations - ClearHistory(context.Context, *ClearHistoryRequest) (*emptypb.Empty, error) - // PathAutocomplete provides path autocompletion options for a given filesystem path. - PathAutocomplete(context.Context, *types.StringValue) (*types.StringList, error) - // GetSummaryDashboard returns data for the dashboard view. - GetSummaryDashboard(context.Context, *emptypb.Empty) (*SummaryDashboardResponse, error) - mustEmbedUnimplementedBackrestServer() -} - -// UnimplementedBackrestServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBackrestServer struct{} - -func (UnimplementedBackrestServer) GetConfig(context.Context, *emptypb.Empty) (*Config, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") -} -func (UnimplementedBackrestServer) SetConfig(context.Context, *Config) (*Config, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetConfig not implemented") -} -func (UnimplementedBackrestServer) CheckRepoExists(context.Context, *Repo) (*types.BoolValue, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckRepoExists not implemented") -} -func (UnimplementedBackrestServer) AddRepo(context.Context, *Repo) (*Config, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddRepo not implemented") -} -func (UnimplementedBackrestServer) RemoveRepo(context.Context, *types.StringValue) (*Config, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveRepo not implemented") -} -func (UnimplementedBackrestServer) GetOperationEvents(*emptypb.Empty, grpc.ServerStreamingServer[OperationEvent]) error { - return status.Errorf(codes.Unimplemented, "method GetOperationEvents not implemented") -} -func (UnimplementedBackrestServer) GetOperations(context.Context, *GetOperationsRequest) (*OperationList, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") -} -func (UnimplementedBackrestServer) ListSnapshots(context.Context, *ListSnapshotsRequest) (*ResticSnapshotList, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented") -} -func (UnimplementedBackrestServer) ListSnapshotFiles(context.Context, *ListSnapshotFilesRequest) (*ListSnapshotFilesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnapshotFiles not implemented") -} -func (UnimplementedBackrestServer) Backup(context.Context, *types.StringValue) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Backup not implemented") -} -func (UnimplementedBackrestServer) DoRepoTask(context.Context, *DoRepoTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DoRepoTask not implemented") -} -func (UnimplementedBackrestServer) Forget(context.Context, *ForgetRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Forget not implemented") -} -func (UnimplementedBackrestServer) Restore(context.Context, *RestoreSnapshotRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Restore not implemented") -} -func (UnimplementedBackrestServer) Cancel(context.Context, *types.Int64Value) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented") -} -func (UnimplementedBackrestServer) GetLogs(*LogDataRequest, grpc.ServerStreamingServer[types.BytesValue]) error { - return status.Errorf(codes.Unimplemented, "method GetLogs not implemented") -} -func (UnimplementedBackrestServer) RunCommand(context.Context, *RunCommandRequest) (*types.Int64Value, error) { - return nil, status.Errorf(codes.Unimplemented, "method RunCommand not implemented") -} -func (UnimplementedBackrestServer) GetDownloadURL(context.Context, *GetDownloadURLRequest) (*types.StringValue, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDownloadURL not implemented") -} -func (UnimplementedBackrestServer) ClearHistory(context.Context, *ClearHistoryRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClearHistory not implemented") -} -func (UnimplementedBackrestServer) PathAutocomplete(context.Context, *types.StringValue) (*types.StringList, error) { - return nil, status.Errorf(codes.Unimplemented, "method PathAutocomplete not implemented") -} -func (UnimplementedBackrestServer) GetSummaryDashboard(context.Context, *emptypb.Empty) (*SummaryDashboardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSummaryDashboard not implemented") -} -func (UnimplementedBackrestServer) mustEmbedUnimplementedBackrestServer() {} -func (UnimplementedBackrestServer) testEmbeddedByValue() {} - -// UnsafeBackrestServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackrestServer will -// result in compilation errors. -type UnsafeBackrestServer interface { - mustEmbedUnimplementedBackrestServer() -} - -func RegisterBackrestServer(s grpc.ServiceRegistrar, srv BackrestServer) { - // If the following call pancis, it indicates UnimplementedBackrestServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Backrest_ServiceDesc, srv) -} - -func _Backrest_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).GetConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_GetConfig_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).GetConfig(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_SetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Config) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).SetConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_SetConfig_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).SetConfig(ctx, req.(*Config)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_CheckRepoExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Repo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).CheckRepoExists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_CheckRepoExists_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).CheckRepoExists(ctx, req.(*Repo)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_AddRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Repo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).AddRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_AddRepo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).AddRepo(ctx, req.(*Repo)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_RemoveRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.StringValue) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).RemoveRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_RemoveRepo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).RemoveRepo(ctx, req.(*types.StringValue)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_GetOperationEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(emptypb.Empty) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BackrestServer).GetOperationEvents(m, &grpc.GenericServerStream[emptypb.Empty, OperationEvent]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Backrest_GetOperationEventsServer = grpc.ServerStreamingServer[OperationEvent] - -func _Backrest_GetOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).GetOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_GetOperations_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).GetOperations(ctx, req.(*GetOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSnapshotsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).ListSnapshots(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_ListSnapshots_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).ListSnapshots(ctx, req.(*ListSnapshotsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_ListSnapshotFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSnapshotFilesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).ListSnapshotFiles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_ListSnapshotFiles_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).ListSnapshotFiles(ctx, req.(*ListSnapshotFilesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_Backup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.StringValue) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).Backup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_Backup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).Backup(ctx, req.(*types.StringValue)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_DoRepoTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DoRepoTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).DoRepoTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_DoRepoTask_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).DoRepoTask(ctx, req.(*DoRepoTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_Forget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ForgetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).Forget(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_Forget_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).Forget(ctx, req.(*ForgetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_Restore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).Restore(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_Restore_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).Restore(ctx, req.(*RestoreSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.Int64Value) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).Cancel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_Cancel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).Cancel(ctx, req.(*types.Int64Value)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_GetLogs_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(LogDataRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BackrestServer).GetLogs(m, &grpc.GenericServerStream[LogDataRequest, types.BytesValue]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Backrest_GetLogsServer = grpc.ServerStreamingServer[types.BytesValue] - -func _Backrest_RunCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RunCommandRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).RunCommand(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_RunCommand_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).RunCommand(ctx, req.(*RunCommandRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_GetDownloadURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDownloadURLRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).GetDownloadURL(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_GetDownloadURL_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).GetDownloadURL(ctx, req.(*GetDownloadURLRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_ClearHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClearHistoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).ClearHistory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_ClearHistory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).ClearHistory(ctx, req.(*ClearHistoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_PathAutocomplete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.StringValue) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).PathAutocomplete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_PathAutocomplete_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).PathAutocomplete(ctx, req.(*types.StringValue)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backrest_GetSummaryDashboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackrestServer).GetSummaryDashboard(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backrest_GetSummaryDashboard_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackrestServer).GetSummaryDashboard(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -// Backrest_ServiceDesc is the grpc.ServiceDesc for Backrest service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Backrest_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Backrest", - HandlerType: (*BackrestServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetConfig", - Handler: _Backrest_GetConfig_Handler, - }, - { - MethodName: "SetConfig", - Handler: _Backrest_SetConfig_Handler, - }, - { - MethodName: "CheckRepoExists", - Handler: _Backrest_CheckRepoExists_Handler, - }, - { - MethodName: "AddRepo", - Handler: _Backrest_AddRepo_Handler, - }, - { - MethodName: "RemoveRepo", - Handler: _Backrest_RemoveRepo_Handler, - }, - { - MethodName: "GetOperations", - Handler: _Backrest_GetOperations_Handler, - }, - { - MethodName: "ListSnapshots", - Handler: _Backrest_ListSnapshots_Handler, - }, - { - MethodName: "ListSnapshotFiles", - Handler: _Backrest_ListSnapshotFiles_Handler, - }, - { - MethodName: "Backup", - Handler: _Backrest_Backup_Handler, - }, - { - MethodName: "DoRepoTask", - Handler: _Backrest_DoRepoTask_Handler, - }, - { - MethodName: "Forget", - Handler: _Backrest_Forget_Handler, - }, - { - MethodName: "Restore", - Handler: _Backrest_Restore_Handler, - }, - { - MethodName: "Cancel", - Handler: _Backrest_Cancel_Handler, - }, - { - MethodName: "RunCommand", - Handler: _Backrest_RunCommand_Handler, - }, - { - MethodName: "GetDownloadURL", - Handler: _Backrest_GetDownloadURL_Handler, - }, - { - MethodName: "ClearHistory", - Handler: _Backrest_ClearHistory_Handler, - }, - { - MethodName: "PathAutocomplete", - Handler: _Backrest_PathAutocomplete_Handler, - }, - { - MethodName: "GetSummaryDashboard", - Handler: _Backrest_GetSummaryDashboard_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetOperationEvents", - Handler: _Backrest_GetOperationEvents_Handler, - ServerStreams: true, - }, - { - StreamName: "GetLogs", - Handler: _Backrest_GetLogs_Handler, - ServerStreams: true, - }, - }, - Metadata: "v1/service.proto", -} diff --git a/gen/go/v1/v1connect/authentication.connect.go b/gen/go/v1/v1connect/authentication.connect.go deleted file mode 100644 index adf8a646a..000000000 --- a/gen/go/v1/v1connect/authentication.connect.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by protoc-gen-connect-go. DO NOT EDIT. -// -// Source: v1/authentication.proto - -package v1connect - -import ( - connect "connectrpc.com/connect" - context "context" - errors "errors" - types "github.com/garethgeorge/backrest/gen/go/types" - v1 "github.com/garethgeorge/backrest/gen/go/v1" - http "net/http" - strings "strings" -) - -// This is a compile-time assertion to ensure that this generated file and the connect package are -// compatible. If you get a compiler error that this constant is not defined, this code was -// generated with a version of connect newer than the one compiled into your binary. You can fix the -// problem by either regenerating this code with an older version of connect or updating the connect -// version compiled into your binary. -const _ = connect.IsAtLeastVersion1_13_0 - -const ( - // AuthenticationName is the fully-qualified name of the Authentication service. - AuthenticationName = "v1.Authentication" -) - -// These constants are the fully-qualified names of the RPCs defined in this package. They're -// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. -// -// Note that these are different from the fully-qualified method names used by -// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to -// reflection-formatted method names, remove the leading slash and convert the remaining slash to a -// period. -const ( - // AuthenticationLoginProcedure is the fully-qualified name of the Authentication's Login RPC. - AuthenticationLoginProcedure = "/v1.Authentication/Login" - // AuthenticationHashPasswordProcedure is the fully-qualified name of the Authentication's - // HashPassword RPC. - AuthenticationHashPasswordProcedure = "/v1.Authentication/HashPassword" -) - -// AuthenticationClient is a client for the v1.Authentication service. -type AuthenticationClient interface { - Login(context.Context, *connect.Request[v1.LoginRequest]) (*connect.Response[v1.LoginResponse], error) - HashPassword(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringValue], error) -} - -// NewAuthenticationClient constructs a client for the v1.Authentication service. By default, it -// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends -// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or -// connect.WithGRPCWeb() options. -// -// The URL supplied here should be the base URL for the Connect or gRPC server (for example, -// http://api.acme.com or https://acme.com/grpc). -func NewAuthenticationClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticationClient { - baseURL = strings.TrimRight(baseURL, "/") - authenticationMethods := v1.File_v1_authentication_proto.Services().ByName("Authentication").Methods() - return &authenticationClient{ - login: connect.NewClient[v1.LoginRequest, v1.LoginResponse]( - httpClient, - baseURL+AuthenticationLoginProcedure, - connect.WithSchema(authenticationMethods.ByName("Login")), - connect.WithClientOptions(opts...), - ), - hashPassword: connect.NewClient[types.StringValue, types.StringValue]( - httpClient, - baseURL+AuthenticationHashPasswordProcedure, - connect.WithSchema(authenticationMethods.ByName("HashPassword")), - connect.WithClientOptions(opts...), - ), - } -} - -// authenticationClient implements AuthenticationClient. -type authenticationClient struct { - login *connect.Client[v1.LoginRequest, v1.LoginResponse] - hashPassword *connect.Client[types.StringValue, types.StringValue] -} - -// Login calls v1.Authentication.Login. -func (c *authenticationClient) Login(ctx context.Context, req *connect.Request[v1.LoginRequest]) (*connect.Response[v1.LoginResponse], error) { - return c.login.CallUnary(ctx, req) -} - -// HashPassword calls v1.Authentication.HashPassword. -func (c *authenticationClient) HashPassword(ctx context.Context, req *connect.Request[types.StringValue]) (*connect.Response[types.StringValue], error) { - return c.hashPassword.CallUnary(ctx, req) -} - -// AuthenticationHandler is an implementation of the v1.Authentication service. -type AuthenticationHandler interface { - Login(context.Context, *connect.Request[v1.LoginRequest]) (*connect.Response[v1.LoginResponse], error) - HashPassword(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringValue], error) -} - -// NewAuthenticationHandler builds an HTTP handler from the service implementation. It returns the -// path on which to mount the handler and the handler itself. -// -// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf -// and JSON codecs. They also support gzip compression. -func NewAuthenticationHandler(svc AuthenticationHandler, opts ...connect.HandlerOption) (string, http.Handler) { - authenticationMethods := v1.File_v1_authentication_proto.Services().ByName("Authentication").Methods() - authenticationLoginHandler := connect.NewUnaryHandler( - AuthenticationLoginProcedure, - svc.Login, - connect.WithSchema(authenticationMethods.ByName("Login")), - connect.WithHandlerOptions(opts...), - ) - authenticationHashPasswordHandler := connect.NewUnaryHandler( - AuthenticationHashPasswordProcedure, - svc.HashPassword, - connect.WithSchema(authenticationMethods.ByName("HashPassword")), - connect.WithHandlerOptions(opts...), - ) - return "/v1.Authentication/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case AuthenticationLoginProcedure: - authenticationLoginHandler.ServeHTTP(w, r) - case AuthenticationHashPasswordProcedure: - authenticationHashPasswordHandler.ServeHTTP(w, r) - default: - http.NotFound(w, r) - } - }) -} - -// UnimplementedAuthenticationHandler returns CodeUnimplemented from all methods. -type UnimplementedAuthenticationHandler struct{} - -func (UnimplementedAuthenticationHandler) Login(context.Context, *connect.Request[v1.LoginRequest]) (*connect.Response[v1.LoginResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Authentication.Login is not implemented")) -} - -func (UnimplementedAuthenticationHandler) HashPassword(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringValue], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Authentication.HashPassword is not implemented")) -} diff --git a/gen/go/v1/v1connect/service.connect.go b/gen/go/v1/v1connect/service.connect.go deleted file mode 100644 index e9ce9f3c2..000000000 --- a/gen/go/v1/v1connect/service.connect.go +++ /dev/null @@ -1,669 +0,0 @@ -// Code generated by protoc-gen-connect-go. DO NOT EDIT. -// -// Source: v1/service.proto - -package v1connect - -import ( - connect "connectrpc.com/connect" - context "context" - errors "errors" - types "github.com/garethgeorge/backrest/gen/go/types" - v1 "github.com/garethgeorge/backrest/gen/go/v1" - emptypb "google.golang.org/protobuf/types/known/emptypb" - http "net/http" - strings "strings" -) - -// This is a compile-time assertion to ensure that this generated file and the connect package are -// compatible. If you get a compiler error that this constant is not defined, this code was -// generated with a version of connect newer than the one compiled into your binary. You can fix the -// problem by either regenerating this code with an older version of connect or updating the connect -// version compiled into your binary. -const _ = connect.IsAtLeastVersion1_13_0 - -const ( - // BackrestName is the fully-qualified name of the Backrest service. - BackrestName = "v1.Backrest" -) - -// These constants are the fully-qualified names of the RPCs defined in this package. They're -// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. -// -// Note that these are different from the fully-qualified method names used by -// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to -// reflection-formatted method names, remove the leading slash and convert the remaining slash to a -// period. -const ( - // BackrestGetConfigProcedure is the fully-qualified name of the Backrest's GetConfig RPC. - BackrestGetConfigProcedure = "/v1.Backrest/GetConfig" - // BackrestSetConfigProcedure is the fully-qualified name of the Backrest's SetConfig RPC. - BackrestSetConfigProcedure = "/v1.Backrest/SetConfig" - // BackrestCheckRepoExistsProcedure is the fully-qualified name of the Backrest's CheckRepoExists - // RPC. - BackrestCheckRepoExistsProcedure = "/v1.Backrest/CheckRepoExists" - // BackrestAddRepoProcedure is the fully-qualified name of the Backrest's AddRepo RPC. - BackrestAddRepoProcedure = "/v1.Backrest/AddRepo" - // BackrestRemoveRepoProcedure is the fully-qualified name of the Backrest's RemoveRepo RPC. - BackrestRemoveRepoProcedure = "/v1.Backrest/RemoveRepo" - // BackrestGetOperationEventsProcedure is the fully-qualified name of the Backrest's - // GetOperationEvents RPC. - BackrestGetOperationEventsProcedure = "/v1.Backrest/GetOperationEvents" - // BackrestGetOperationsProcedure is the fully-qualified name of the Backrest's GetOperations RPC. - BackrestGetOperationsProcedure = "/v1.Backrest/GetOperations" - // BackrestListSnapshotsProcedure is the fully-qualified name of the Backrest's ListSnapshots RPC. - BackrestListSnapshotsProcedure = "/v1.Backrest/ListSnapshots" - // BackrestListSnapshotFilesProcedure is the fully-qualified name of the Backrest's - // ListSnapshotFiles RPC. - BackrestListSnapshotFilesProcedure = "/v1.Backrest/ListSnapshotFiles" - // BackrestBackupProcedure is the fully-qualified name of the Backrest's Backup RPC. - BackrestBackupProcedure = "/v1.Backrest/Backup" - // BackrestDoRepoTaskProcedure is the fully-qualified name of the Backrest's DoRepoTask RPC. - BackrestDoRepoTaskProcedure = "/v1.Backrest/DoRepoTask" - // BackrestForgetProcedure is the fully-qualified name of the Backrest's Forget RPC. - BackrestForgetProcedure = "/v1.Backrest/Forget" - // BackrestRestoreProcedure is the fully-qualified name of the Backrest's Restore RPC. - BackrestRestoreProcedure = "/v1.Backrest/Restore" - // BackrestCancelProcedure is the fully-qualified name of the Backrest's Cancel RPC. - BackrestCancelProcedure = "/v1.Backrest/Cancel" - // BackrestGetLogsProcedure is the fully-qualified name of the Backrest's GetLogs RPC. - BackrestGetLogsProcedure = "/v1.Backrest/GetLogs" - // BackrestRunCommandProcedure is the fully-qualified name of the Backrest's RunCommand RPC. - BackrestRunCommandProcedure = "/v1.Backrest/RunCommand" - // BackrestGetDownloadURLProcedure is the fully-qualified name of the Backrest's GetDownloadURL RPC. - BackrestGetDownloadURLProcedure = "/v1.Backrest/GetDownloadURL" - // BackrestClearHistoryProcedure is the fully-qualified name of the Backrest's ClearHistory RPC. - BackrestClearHistoryProcedure = "/v1.Backrest/ClearHistory" - // BackrestPathAutocompleteProcedure is the fully-qualified name of the Backrest's PathAutocomplete - // RPC. - BackrestPathAutocompleteProcedure = "/v1.Backrest/PathAutocomplete" - // BackrestGetSummaryDashboardProcedure is the fully-qualified name of the Backrest's - // GetSummaryDashboard RPC. - BackrestGetSummaryDashboardProcedure = "/v1.Backrest/GetSummaryDashboard" -) - -// BackrestClient is a client for the v1.Backrest service. -type BackrestClient interface { - GetConfig(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error) - SetConfig(context.Context, *connect.Request[v1.Config]) (*connect.Response[v1.Config], error) - CheckRepoExists(context.Context, *connect.Request[v1.Repo]) (*connect.Response[types.BoolValue], error) - AddRepo(context.Context, *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error) - RemoveRepo(context.Context, *connect.Request[types.StringValue]) (*connect.Response[v1.Config], error) - GetOperationEvents(context.Context, *connect.Request[emptypb.Empty]) (*connect.ServerStreamForClient[v1.OperationEvent], error) - GetOperations(context.Context, *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error) - ListSnapshots(context.Context, *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error) - ListSnapshotFiles(context.Context, *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error) - // Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued. - Backup(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error) - // DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued. - DoRepoTask(context.Context, *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error) - // Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued. - Forget(context.Context, *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) - // Restore schedules a restore operation. - Restore(context.Context, *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error) - // Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed. - Cancel(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error) - // GetLogs returns the keyed large data for the given operation. - GetLogs(context.Context, *connect.Request[v1.LogDataRequest]) (*connect.ServerStreamForClient[types.BytesValue], error) - // RunCommand executes a generic restic command on the repository. - RunCommand(context.Context, *connect.Request[v1.RunCommandRequest]) (*connect.Response[types.Int64Value], error) - // GetDownloadURL returns a signed download URL given an operation ID and file path. - GetDownloadURL(context.Context, *connect.Request[v1.GetDownloadURLRequest]) (*connect.Response[types.StringValue], error) - // Clears the history of operations - ClearHistory(context.Context, *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error) - // PathAutocomplete provides path autocompletion options for a given filesystem path. - PathAutocomplete(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error) - // GetSummaryDashboard returns data for the dashboard view. - GetSummaryDashboard(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.SummaryDashboardResponse], error) -} - -// NewBackrestClient constructs a client for the v1.Backrest service. By default, it uses the -// Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends -// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or -// connect.WithGRPCWeb() options. -// -// The URL supplied here should be the base URL for the Connect or gRPC server (for example, -// http://api.acme.com or https://acme.com/grpc). -func NewBackrestClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BackrestClient { - baseURL = strings.TrimRight(baseURL, "/") - backrestMethods := v1.File_v1_service_proto.Services().ByName("Backrest").Methods() - return &backrestClient{ - getConfig: connect.NewClient[emptypb.Empty, v1.Config]( - httpClient, - baseURL+BackrestGetConfigProcedure, - connect.WithSchema(backrestMethods.ByName("GetConfig")), - connect.WithClientOptions(opts...), - ), - setConfig: connect.NewClient[v1.Config, v1.Config]( - httpClient, - baseURL+BackrestSetConfigProcedure, - connect.WithSchema(backrestMethods.ByName("SetConfig")), - connect.WithClientOptions(opts...), - ), - checkRepoExists: connect.NewClient[v1.Repo, types.BoolValue]( - httpClient, - baseURL+BackrestCheckRepoExistsProcedure, - connect.WithSchema(backrestMethods.ByName("CheckRepoExists")), - connect.WithClientOptions(opts...), - ), - addRepo: connect.NewClient[v1.Repo, v1.Config]( - httpClient, - baseURL+BackrestAddRepoProcedure, - connect.WithSchema(backrestMethods.ByName("AddRepo")), - connect.WithClientOptions(opts...), - ), - removeRepo: connect.NewClient[types.StringValue, v1.Config]( - httpClient, - baseURL+BackrestRemoveRepoProcedure, - connect.WithSchema(backrestMethods.ByName("RemoveRepo")), - connect.WithClientOptions(opts...), - ), - getOperationEvents: connect.NewClient[emptypb.Empty, v1.OperationEvent]( - httpClient, - baseURL+BackrestGetOperationEventsProcedure, - connect.WithSchema(backrestMethods.ByName("GetOperationEvents")), - connect.WithClientOptions(opts...), - ), - getOperations: connect.NewClient[v1.GetOperationsRequest, v1.OperationList]( - httpClient, - baseURL+BackrestGetOperationsProcedure, - connect.WithSchema(backrestMethods.ByName("GetOperations")), - connect.WithClientOptions(opts...), - ), - listSnapshots: connect.NewClient[v1.ListSnapshotsRequest, v1.ResticSnapshotList]( - httpClient, - baseURL+BackrestListSnapshotsProcedure, - connect.WithSchema(backrestMethods.ByName("ListSnapshots")), - connect.WithClientOptions(opts...), - ), - listSnapshotFiles: connect.NewClient[v1.ListSnapshotFilesRequest, v1.ListSnapshotFilesResponse]( - httpClient, - baseURL+BackrestListSnapshotFilesProcedure, - connect.WithSchema(backrestMethods.ByName("ListSnapshotFiles")), - connect.WithClientOptions(opts...), - ), - backup: connect.NewClient[types.StringValue, emptypb.Empty]( - httpClient, - baseURL+BackrestBackupProcedure, - connect.WithSchema(backrestMethods.ByName("Backup")), - connect.WithClientOptions(opts...), - ), - doRepoTask: connect.NewClient[v1.DoRepoTaskRequest, emptypb.Empty]( - httpClient, - baseURL+BackrestDoRepoTaskProcedure, - connect.WithSchema(backrestMethods.ByName("DoRepoTask")), - connect.WithClientOptions(opts...), - ), - forget: connect.NewClient[v1.ForgetRequest, emptypb.Empty]( - httpClient, - baseURL+BackrestForgetProcedure, - connect.WithSchema(backrestMethods.ByName("Forget")), - connect.WithClientOptions(opts...), - ), - restore: connect.NewClient[v1.RestoreSnapshotRequest, emptypb.Empty]( - httpClient, - baseURL+BackrestRestoreProcedure, - connect.WithSchema(backrestMethods.ByName("Restore")), - connect.WithClientOptions(opts...), - ), - cancel: connect.NewClient[types.Int64Value, emptypb.Empty]( - httpClient, - baseURL+BackrestCancelProcedure, - connect.WithSchema(backrestMethods.ByName("Cancel")), - connect.WithClientOptions(opts...), - ), - getLogs: connect.NewClient[v1.LogDataRequest, types.BytesValue]( - httpClient, - baseURL+BackrestGetLogsProcedure, - connect.WithSchema(backrestMethods.ByName("GetLogs")), - connect.WithClientOptions(opts...), - ), - runCommand: connect.NewClient[v1.RunCommandRequest, types.Int64Value]( - httpClient, - baseURL+BackrestRunCommandProcedure, - connect.WithSchema(backrestMethods.ByName("RunCommand")), - connect.WithClientOptions(opts...), - ), - getDownloadURL: connect.NewClient[v1.GetDownloadURLRequest, types.StringValue]( - httpClient, - baseURL+BackrestGetDownloadURLProcedure, - connect.WithSchema(backrestMethods.ByName("GetDownloadURL")), - connect.WithClientOptions(opts...), - ), - clearHistory: connect.NewClient[v1.ClearHistoryRequest, emptypb.Empty]( - httpClient, - baseURL+BackrestClearHistoryProcedure, - connect.WithSchema(backrestMethods.ByName("ClearHistory")), - connect.WithClientOptions(opts...), - ), - pathAutocomplete: connect.NewClient[types.StringValue, types.StringList]( - httpClient, - baseURL+BackrestPathAutocompleteProcedure, - connect.WithSchema(backrestMethods.ByName("PathAutocomplete")), - connect.WithClientOptions(opts...), - ), - getSummaryDashboard: connect.NewClient[emptypb.Empty, v1.SummaryDashboardResponse]( - httpClient, - baseURL+BackrestGetSummaryDashboardProcedure, - connect.WithSchema(backrestMethods.ByName("GetSummaryDashboard")), - connect.WithClientOptions(opts...), - ), - } -} - -// backrestClient implements BackrestClient. -type backrestClient struct { - getConfig *connect.Client[emptypb.Empty, v1.Config] - setConfig *connect.Client[v1.Config, v1.Config] - checkRepoExists *connect.Client[v1.Repo, types.BoolValue] - addRepo *connect.Client[v1.Repo, v1.Config] - removeRepo *connect.Client[types.StringValue, v1.Config] - getOperationEvents *connect.Client[emptypb.Empty, v1.OperationEvent] - getOperations *connect.Client[v1.GetOperationsRequest, v1.OperationList] - listSnapshots *connect.Client[v1.ListSnapshotsRequest, v1.ResticSnapshotList] - listSnapshotFiles *connect.Client[v1.ListSnapshotFilesRequest, v1.ListSnapshotFilesResponse] - backup *connect.Client[types.StringValue, emptypb.Empty] - doRepoTask *connect.Client[v1.DoRepoTaskRequest, emptypb.Empty] - forget *connect.Client[v1.ForgetRequest, emptypb.Empty] - restore *connect.Client[v1.RestoreSnapshotRequest, emptypb.Empty] - cancel *connect.Client[types.Int64Value, emptypb.Empty] - getLogs *connect.Client[v1.LogDataRequest, types.BytesValue] - runCommand *connect.Client[v1.RunCommandRequest, types.Int64Value] - getDownloadURL *connect.Client[v1.GetDownloadURLRequest, types.StringValue] - clearHistory *connect.Client[v1.ClearHistoryRequest, emptypb.Empty] - pathAutocomplete *connect.Client[types.StringValue, types.StringList] - getSummaryDashboard *connect.Client[emptypb.Empty, v1.SummaryDashboardResponse] -} - -// GetConfig calls v1.Backrest.GetConfig. -func (c *backrestClient) GetConfig(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error) { - return c.getConfig.CallUnary(ctx, req) -} - -// SetConfig calls v1.Backrest.SetConfig. -func (c *backrestClient) SetConfig(ctx context.Context, req *connect.Request[v1.Config]) (*connect.Response[v1.Config], error) { - return c.setConfig.CallUnary(ctx, req) -} - -// CheckRepoExists calls v1.Backrest.CheckRepoExists. -func (c *backrestClient) CheckRepoExists(ctx context.Context, req *connect.Request[v1.Repo]) (*connect.Response[types.BoolValue], error) { - return c.checkRepoExists.CallUnary(ctx, req) -} - -// AddRepo calls v1.Backrest.AddRepo. -func (c *backrestClient) AddRepo(ctx context.Context, req *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error) { - return c.addRepo.CallUnary(ctx, req) -} - -// RemoveRepo calls v1.Backrest.RemoveRepo. -func (c *backrestClient) RemoveRepo(ctx context.Context, req *connect.Request[types.StringValue]) (*connect.Response[v1.Config], error) { - return c.removeRepo.CallUnary(ctx, req) -} - -// GetOperationEvents calls v1.Backrest.GetOperationEvents. -func (c *backrestClient) GetOperationEvents(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.ServerStreamForClient[v1.OperationEvent], error) { - return c.getOperationEvents.CallServerStream(ctx, req) -} - -// GetOperations calls v1.Backrest.GetOperations. -func (c *backrestClient) GetOperations(ctx context.Context, req *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error) { - return c.getOperations.CallUnary(ctx, req) -} - -// ListSnapshots calls v1.Backrest.ListSnapshots. -func (c *backrestClient) ListSnapshots(ctx context.Context, req *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error) { - return c.listSnapshots.CallUnary(ctx, req) -} - -// ListSnapshotFiles calls v1.Backrest.ListSnapshotFiles. -func (c *backrestClient) ListSnapshotFiles(ctx context.Context, req *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error) { - return c.listSnapshotFiles.CallUnary(ctx, req) -} - -// Backup calls v1.Backrest.Backup. -func (c *backrestClient) Backup(ctx context.Context, req *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error) { - return c.backup.CallUnary(ctx, req) -} - -// DoRepoTask calls v1.Backrest.DoRepoTask. -func (c *backrestClient) DoRepoTask(ctx context.Context, req *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error) { - return c.doRepoTask.CallUnary(ctx, req) -} - -// Forget calls v1.Backrest.Forget. -func (c *backrestClient) Forget(ctx context.Context, req *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) { - return c.forget.CallUnary(ctx, req) -} - -// Restore calls v1.Backrest.Restore. -func (c *backrestClient) Restore(ctx context.Context, req *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error) { - return c.restore.CallUnary(ctx, req) -} - -// Cancel calls v1.Backrest.Cancel. -func (c *backrestClient) Cancel(ctx context.Context, req *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error) { - return c.cancel.CallUnary(ctx, req) -} - -// GetLogs calls v1.Backrest.GetLogs. -func (c *backrestClient) GetLogs(ctx context.Context, req *connect.Request[v1.LogDataRequest]) (*connect.ServerStreamForClient[types.BytesValue], error) { - return c.getLogs.CallServerStream(ctx, req) -} - -// RunCommand calls v1.Backrest.RunCommand. -func (c *backrestClient) RunCommand(ctx context.Context, req *connect.Request[v1.RunCommandRequest]) (*connect.Response[types.Int64Value], error) { - return c.runCommand.CallUnary(ctx, req) -} - -// GetDownloadURL calls v1.Backrest.GetDownloadURL. -func (c *backrestClient) GetDownloadURL(ctx context.Context, req *connect.Request[v1.GetDownloadURLRequest]) (*connect.Response[types.StringValue], error) { - return c.getDownloadURL.CallUnary(ctx, req) -} - -// ClearHistory calls v1.Backrest.ClearHistory. -func (c *backrestClient) ClearHistory(ctx context.Context, req *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error) { - return c.clearHistory.CallUnary(ctx, req) -} - -// PathAutocomplete calls v1.Backrest.PathAutocomplete. -func (c *backrestClient) PathAutocomplete(ctx context.Context, req *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error) { - return c.pathAutocomplete.CallUnary(ctx, req) -} - -// GetSummaryDashboard calls v1.Backrest.GetSummaryDashboard. -func (c *backrestClient) GetSummaryDashboard(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[v1.SummaryDashboardResponse], error) { - return c.getSummaryDashboard.CallUnary(ctx, req) -} - -// BackrestHandler is an implementation of the v1.Backrest service. -type BackrestHandler interface { - GetConfig(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error) - SetConfig(context.Context, *connect.Request[v1.Config]) (*connect.Response[v1.Config], error) - CheckRepoExists(context.Context, *connect.Request[v1.Repo]) (*connect.Response[types.BoolValue], error) - AddRepo(context.Context, *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error) - RemoveRepo(context.Context, *connect.Request[types.StringValue]) (*connect.Response[v1.Config], error) - GetOperationEvents(context.Context, *connect.Request[emptypb.Empty], *connect.ServerStream[v1.OperationEvent]) error - GetOperations(context.Context, *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error) - ListSnapshots(context.Context, *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error) - ListSnapshotFiles(context.Context, *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error) - // Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued. - Backup(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error) - // DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued. - DoRepoTask(context.Context, *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error) - // Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued. - Forget(context.Context, *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) - // Restore schedules a restore operation. - Restore(context.Context, *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error) - // Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed. - Cancel(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error) - // GetLogs returns the keyed large data for the given operation. - GetLogs(context.Context, *connect.Request[v1.LogDataRequest], *connect.ServerStream[types.BytesValue]) error - // RunCommand executes a generic restic command on the repository. - RunCommand(context.Context, *connect.Request[v1.RunCommandRequest]) (*connect.Response[types.Int64Value], error) - // GetDownloadURL returns a signed download URL given an operation ID and file path. - GetDownloadURL(context.Context, *connect.Request[v1.GetDownloadURLRequest]) (*connect.Response[types.StringValue], error) - // Clears the history of operations - ClearHistory(context.Context, *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error) - // PathAutocomplete provides path autocompletion options for a given filesystem path. - PathAutocomplete(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error) - // GetSummaryDashboard returns data for the dashboard view. - GetSummaryDashboard(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.SummaryDashboardResponse], error) -} - -// NewBackrestHandler builds an HTTP handler from the service implementation. It returns the path on -// which to mount the handler and the handler itself. -// -// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf -// and JSON codecs. They also support gzip compression. -func NewBackrestHandler(svc BackrestHandler, opts ...connect.HandlerOption) (string, http.Handler) { - backrestMethods := v1.File_v1_service_proto.Services().ByName("Backrest").Methods() - backrestGetConfigHandler := connect.NewUnaryHandler( - BackrestGetConfigProcedure, - svc.GetConfig, - connect.WithSchema(backrestMethods.ByName("GetConfig")), - connect.WithHandlerOptions(opts...), - ) - backrestSetConfigHandler := connect.NewUnaryHandler( - BackrestSetConfigProcedure, - svc.SetConfig, - connect.WithSchema(backrestMethods.ByName("SetConfig")), - connect.WithHandlerOptions(opts...), - ) - backrestCheckRepoExistsHandler := connect.NewUnaryHandler( - BackrestCheckRepoExistsProcedure, - svc.CheckRepoExists, - connect.WithSchema(backrestMethods.ByName("CheckRepoExists")), - connect.WithHandlerOptions(opts...), - ) - backrestAddRepoHandler := connect.NewUnaryHandler( - BackrestAddRepoProcedure, - svc.AddRepo, - connect.WithSchema(backrestMethods.ByName("AddRepo")), - connect.WithHandlerOptions(opts...), - ) - backrestRemoveRepoHandler := connect.NewUnaryHandler( - BackrestRemoveRepoProcedure, - svc.RemoveRepo, - connect.WithSchema(backrestMethods.ByName("RemoveRepo")), - connect.WithHandlerOptions(opts...), - ) - backrestGetOperationEventsHandler := connect.NewServerStreamHandler( - BackrestGetOperationEventsProcedure, - svc.GetOperationEvents, - connect.WithSchema(backrestMethods.ByName("GetOperationEvents")), - connect.WithHandlerOptions(opts...), - ) - backrestGetOperationsHandler := connect.NewUnaryHandler( - BackrestGetOperationsProcedure, - svc.GetOperations, - connect.WithSchema(backrestMethods.ByName("GetOperations")), - connect.WithHandlerOptions(opts...), - ) - backrestListSnapshotsHandler := connect.NewUnaryHandler( - BackrestListSnapshotsProcedure, - svc.ListSnapshots, - connect.WithSchema(backrestMethods.ByName("ListSnapshots")), - connect.WithHandlerOptions(opts...), - ) - backrestListSnapshotFilesHandler := connect.NewUnaryHandler( - BackrestListSnapshotFilesProcedure, - svc.ListSnapshotFiles, - connect.WithSchema(backrestMethods.ByName("ListSnapshotFiles")), - connect.WithHandlerOptions(opts...), - ) - backrestBackupHandler := connect.NewUnaryHandler( - BackrestBackupProcedure, - svc.Backup, - connect.WithSchema(backrestMethods.ByName("Backup")), - connect.WithHandlerOptions(opts...), - ) - backrestDoRepoTaskHandler := connect.NewUnaryHandler( - BackrestDoRepoTaskProcedure, - svc.DoRepoTask, - connect.WithSchema(backrestMethods.ByName("DoRepoTask")), - connect.WithHandlerOptions(opts...), - ) - backrestForgetHandler := connect.NewUnaryHandler( - BackrestForgetProcedure, - svc.Forget, - connect.WithSchema(backrestMethods.ByName("Forget")), - connect.WithHandlerOptions(opts...), - ) - backrestRestoreHandler := connect.NewUnaryHandler( - BackrestRestoreProcedure, - svc.Restore, - connect.WithSchema(backrestMethods.ByName("Restore")), - connect.WithHandlerOptions(opts...), - ) - backrestCancelHandler := connect.NewUnaryHandler( - BackrestCancelProcedure, - svc.Cancel, - connect.WithSchema(backrestMethods.ByName("Cancel")), - connect.WithHandlerOptions(opts...), - ) - backrestGetLogsHandler := connect.NewServerStreamHandler( - BackrestGetLogsProcedure, - svc.GetLogs, - connect.WithSchema(backrestMethods.ByName("GetLogs")), - connect.WithHandlerOptions(opts...), - ) - backrestRunCommandHandler := connect.NewUnaryHandler( - BackrestRunCommandProcedure, - svc.RunCommand, - connect.WithSchema(backrestMethods.ByName("RunCommand")), - connect.WithHandlerOptions(opts...), - ) - backrestGetDownloadURLHandler := connect.NewUnaryHandler( - BackrestGetDownloadURLProcedure, - svc.GetDownloadURL, - connect.WithSchema(backrestMethods.ByName("GetDownloadURL")), - connect.WithHandlerOptions(opts...), - ) - backrestClearHistoryHandler := connect.NewUnaryHandler( - BackrestClearHistoryProcedure, - svc.ClearHistory, - connect.WithSchema(backrestMethods.ByName("ClearHistory")), - connect.WithHandlerOptions(opts...), - ) - backrestPathAutocompleteHandler := connect.NewUnaryHandler( - BackrestPathAutocompleteProcedure, - svc.PathAutocomplete, - connect.WithSchema(backrestMethods.ByName("PathAutocomplete")), - connect.WithHandlerOptions(opts...), - ) - backrestGetSummaryDashboardHandler := connect.NewUnaryHandler( - BackrestGetSummaryDashboardProcedure, - svc.GetSummaryDashboard, - connect.WithSchema(backrestMethods.ByName("GetSummaryDashboard")), - connect.WithHandlerOptions(opts...), - ) - return "/v1.Backrest/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case BackrestGetConfigProcedure: - backrestGetConfigHandler.ServeHTTP(w, r) - case BackrestSetConfigProcedure: - backrestSetConfigHandler.ServeHTTP(w, r) - case BackrestCheckRepoExistsProcedure: - backrestCheckRepoExistsHandler.ServeHTTP(w, r) - case BackrestAddRepoProcedure: - backrestAddRepoHandler.ServeHTTP(w, r) - case BackrestRemoveRepoProcedure: - backrestRemoveRepoHandler.ServeHTTP(w, r) - case BackrestGetOperationEventsProcedure: - backrestGetOperationEventsHandler.ServeHTTP(w, r) - case BackrestGetOperationsProcedure: - backrestGetOperationsHandler.ServeHTTP(w, r) - case BackrestListSnapshotsProcedure: - backrestListSnapshotsHandler.ServeHTTP(w, r) - case BackrestListSnapshotFilesProcedure: - backrestListSnapshotFilesHandler.ServeHTTP(w, r) - case BackrestBackupProcedure: - backrestBackupHandler.ServeHTTP(w, r) - case BackrestDoRepoTaskProcedure: - backrestDoRepoTaskHandler.ServeHTTP(w, r) - case BackrestForgetProcedure: - backrestForgetHandler.ServeHTTP(w, r) - case BackrestRestoreProcedure: - backrestRestoreHandler.ServeHTTP(w, r) - case BackrestCancelProcedure: - backrestCancelHandler.ServeHTTP(w, r) - case BackrestGetLogsProcedure: - backrestGetLogsHandler.ServeHTTP(w, r) - case BackrestRunCommandProcedure: - backrestRunCommandHandler.ServeHTTP(w, r) - case BackrestGetDownloadURLProcedure: - backrestGetDownloadURLHandler.ServeHTTP(w, r) - case BackrestClearHistoryProcedure: - backrestClearHistoryHandler.ServeHTTP(w, r) - case BackrestPathAutocompleteProcedure: - backrestPathAutocompleteHandler.ServeHTTP(w, r) - case BackrestGetSummaryDashboardProcedure: - backrestGetSummaryDashboardHandler.ServeHTTP(w, r) - default: - http.NotFound(w, r) - } - }) -} - -// UnimplementedBackrestHandler returns CodeUnimplemented from all methods. -type UnimplementedBackrestHandler struct{} - -func (UnimplementedBackrestHandler) GetConfig(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetConfig is not implemented")) -} - -func (UnimplementedBackrestHandler) SetConfig(context.Context, *connect.Request[v1.Config]) (*connect.Response[v1.Config], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.SetConfig is not implemented")) -} - -func (UnimplementedBackrestHandler) CheckRepoExists(context.Context, *connect.Request[v1.Repo]) (*connect.Response[types.BoolValue], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.CheckRepoExists is not implemented")) -} - -func (UnimplementedBackrestHandler) AddRepo(context.Context, *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.AddRepo is not implemented")) -} - -func (UnimplementedBackrestHandler) RemoveRepo(context.Context, *connect.Request[types.StringValue]) (*connect.Response[v1.Config], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.RemoveRepo is not implemented")) -} - -func (UnimplementedBackrestHandler) GetOperationEvents(context.Context, *connect.Request[emptypb.Empty], *connect.ServerStream[v1.OperationEvent]) error { - return connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetOperationEvents is not implemented")) -} - -func (UnimplementedBackrestHandler) GetOperations(context.Context, *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetOperations is not implemented")) -} - -func (UnimplementedBackrestHandler) ListSnapshots(context.Context, *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.ListSnapshots is not implemented")) -} - -func (UnimplementedBackrestHandler) ListSnapshotFiles(context.Context, *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.ListSnapshotFiles is not implemented")) -} - -func (UnimplementedBackrestHandler) Backup(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.Backup is not implemented")) -} - -func (UnimplementedBackrestHandler) DoRepoTask(context.Context, *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.DoRepoTask is not implemented")) -} - -func (UnimplementedBackrestHandler) Forget(context.Context, *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.Forget is not implemented")) -} - -func (UnimplementedBackrestHandler) Restore(context.Context, *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.Restore is not implemented")) -} - -func (UnimplementedBackrestHandler) Cancel(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.Cancel is not implemented")) -} - -func (UnimplementedBackrestHandler) GetLogs(context.Context, *connect.Request[v1.LogDataRequest], *connect.ServerStream[types.BytesValue]) error { - return connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetLogs is not implemented")) -} - -func (UnimplementedBackrestHandler) RunCommand(context.Context, *connect.Request[v1.RunCommandRequest]) (*connect.Response[types.Int64Value], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.RunCommand is not implemented")) -} - -func (UnimplementedBackrestHandler) GetDownloadURL(context.Context, *connect.Request[v1.GetDownloadURLRequest]) (*connect.Response[types.StringValue], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetDownloadURL is not implemented")) -} - -func (UnimplementedBackrestHandler) ClearHistory(context.Context, *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.ClearHistory is not implemented")) -} - -func (UnimplementedBackrestHandler) PathAutocomplete(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.PathAutocomplete is not implemented")) -} - -func (UnimplementedBackrestHandler) GetSummaryDashboard(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.SummaryDashboardResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("v1.Backrest.GetSummaryDashboard is not implemented")) -} diff --git a/gen/go/v1sync/syncservice.pb.go b/gen/go/v1sync/syncservice.pb.go deleted file mode 100644 index 33251c06f..000000000 --- a/gen/go/v1sync/syncservice.pb.go +++ /dev/null @@ -1,1945 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: v1sync/syncservice.proto - -package v1sync - -import ( - _ "github.com/garethgeorge/backrest/gen/go/types" - v1 "github.com/garethgeorge/backrest/gen/go/v1" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/anypb" - _ "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ConnectionState int32 - -const ( - ConnectionState_CONNECTION_STATE_UNKNOWN ConnectionState = 0 - ConnectionState_CONNECTION_STATE_PENDING ConnectionState = 1 - ConnectionState_CONNECTION_STATE_CONNECTED ConnectionState = 2 - ConnectionState_CONNECTION_STATE_DISCONNECTED ConnectionState = 3 - ConnectionState_CONNECTION_STATE_RETRY_WAIT ConnectionState = 4 - ConnectionState_CONNECTION_STATE_ERROR_AUTH ConnectionState = 10 - ConnectionState_CONNECTION_STATE_ERROR_PROTOCOL ConnectionState = 11 - ConnectionState_CONNECTION_STATE_ERROR_INTERNAL ConnectionState = 12 -) - -// Enum value maps for ConnectionState. -var ( - ConnectionState_name = map[int32]string{ - 0: "CONNECTION_STATE_UNKNOWN", - 1: "CONNECTION_STATE_PENDING", - 2: "CONNECTION_STATE_CONNECTED", - 3: "CONNECTION_STATE_DISCONNECTED", - 4: "CONNECTION_STATE_RETRY_WAIT", - 10: "CONNECTION_STATE_ERROR_AUTH", - 11: "CONNECTION_STATE_ERROR_PROTOCOL", - 12: "CONNECTION_STATE_ERROR_INTERNAL", - } - ConnectionState_value = map[string]int32{ - "CONNECTION_STATE_UNKNOWN": 0, - "CONNECTION_STATE_PENDING": 1, - "CONNECTION_STATE_CONNECTED": 2, - "CONNECTION_STATE_DISCONNECTED": 3, - "CONNECTION_STATE_RETRY_WAIT": 4, - "CONNECTION_STATE_ERROR_AUTH": 10, - "CONNECTION_STATE_ERROR_PROTOCOL": 11, - "CONNECTION_STATE_ERROR_INTERNAL": 12, - } -) - -func (x ConnectionState) Enum() *ConnectionState { - p := new(ConnectionState) - *p = x - return p -} - -func (x ConnectionState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ConnectionState) Descriptor() protoreflect.EnumDescriptor { - return file_v1sync_syncservice_proto_enumTypes[0].Descriptor() -} - -func (ConnectionState) Type() protoreflect.EnumType { - return &file_v1sync_syncservice_proto_enumTypes[0] -} - -func (x ConnectionState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ConnectionState.Descriptor instead. -func (ConnectionState) EnumDescriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{0} -} - -type SyncStreamItem_RepoConnectionState int32 - -const ( - SyncStreamItem_CONNECTION_STATE_UNKNOWN SyncStreamItem_RepoConnectionState = 0 - SyncStreamItem_CONNECTION_STATE_PENDING SyncStreamItem_RepoConnectionState = 1 // queried, response not yet received. - SyncStreamItem_CONNECTION_STATE_CONNECTED SyncStreamItem_RepoConnectionState = 2 - SyncStreamItem_CONNECTION_STATE_UNAUTHORIZED SyncStreamItem_RepoConnectionState = 3 - SyncStreamItem_CONNECTION_STATE_NOT_FOUND SyncStreamItem_RepoConnectionState = 4 -) - -// Enum value maps for SyncStreamItem_RepoConnectionState. -var ( - SyncStreamItem_RepoConnectionState_name = map[int32]string{ - 0: "CONNECTION_STATE_UNKNOWN", - 1: "CONNECTION_STATE_PENDING", - 2: "CONNECTION_STATE_CONNECTED", - 3: "CONNECTION_STATE_UNAUTHORIZED", - 4: "CONNECTION_STATE_NOT_FOUND", - } - SyncStreamItem_RepoConnectionState_value = map[string]int32{ - "CONNECTION_STATE_UNKNOWN": 0, - "CONNECTION_STATE_PENDING": 1, - "CONNECTION_STATE_CONNECTED": 2, - "CONNECTION_STATE_UNAUTHORIZED": 3, - "CONNECTION_STATE_NOT_FOUND": 4, - } -) - -func (x SyncStreamItem_RepoConnectionState) Enum() *SyncStreamItem_RepoConnectionState { - p := new(SyncStreamItem_RepoConnectionState) - *p = x - return p -} - -func (x SyncStreamItem_RepoConnectionState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncStreamItem_RepoConnectionState) Descriptor() protoreflect.EnumDescriptor { - return file_v1sync_syncservice_proto_enumTypes[1].Descriptor() -} - -func (SyncStreamItem_RepoConnectionState) Type() protoreflect.EnumType { - return &file_v1sync_syncservice_proto_enumTypes[1] -} - -func (x SyncStreamItem_RepoConnectionState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SyncStreamItem_RepoConnectionState.Descriptor instead. -func (SyncStreamItem_RepoConnectionState) EnumDescriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 0} -} - -type SyncStateStreamRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Subscribe bool `protobuf:"varint,1,opt,name=subscribe,proto3" json:"subscribe,omitempty"` // If true, the stream will continue to send updates until cancelled. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStateStreamRequest) Reset() { - *x = SyncStateStreamRequest{} - mi := &file_v1sync_syncservice_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStateStreamRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStateStreamRequest) ProtoMessage() {} - -func (x *SyncStateStreamRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStateStreamRequest.ProtoReflect.Descriptor instead. -func (*SyncStateStreamRequest) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{0} -} - -func (x *SyncStateStreamRequest) GetSubscribe() bool { - if x != nil { - return x.Subscribe - } - return false -} - -type PeerState struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeerInstanceId string `protobuf:"bytes,1,opt,name=peer_instance_id,json=peerInstanceId,proto3" json:"peer_instance_id,omitempty"` - PeerKeyid string `protobuf:"bytes,2,opt,name=peer_keyid,json=peerKeyid,proto3" json:"peer_keyid,omitempty"` - State ConnectionState `protobuf:"varint,3,opt,name=state,proto3,enum=v1sync.ConnectionState" json:"state,omitempty"` - StatusMessage string `protobuf:"bytes,4,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` - KnownPlans []*PlanMetadata `protobuf:"bytes,5,rep,name=known_plans,json=knownPlans,proto3" json:"known_plans,omitempty"` // List of plan IDs that the peer has. - KnownRepos []*RepoMetadata `protobuf:"bytes,6,rep,name=known_repos,json=knownRepos,proto3" json:"known_repos,omitempty"` // List of repo IDs that the peer has. - RemoteConfig *RemoteConfig `protobuf:"bytes,7,opt,name=remote_config,json=remoteConfig,proto3" json:"remote_config,omitempty"` // The remote config of the peer, if available. - LastHeartbeatMillis int64 `protobuf:"varint,8,opt,name=last_heartbeat_millis,json=lastHeartbeatMillis,proto3" json:"last_heartbeat_millis,omitempty"` // The last time the peer sent a heartbeat, in milliseconds since epoch. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PeerState) Reset() { - *x = PeerState{} - mi := &file_v1sync_syncservice_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PeerState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PeerState) ProtoMessage() {} - -func (x *PeerState) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PeerState.ProtoReflect.Descriptor instead. -func (*PeerState) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{1} -} - -func (x *PeerState) GetPeerInstanceId() string { - if x != nil { - return x.PeerInstanceId - } - return "" -} - -func (x *PeerState) GetPeerKeyid() string { - if x != nil { - return x.PeerKeyid - } - return "" -} - -func (x *PeerState) GetState() ConnectionState { - if x != nil { - return x.State - } - return ConnectionState_CONNECTION_STATE_UNKNOWN -} - -func (x *PeerState) GetStatusMessage() string { - if x != nil { - return x.StatusMessage - } - return "" -} - -func (x *PeerState) GetKnownPlans() []*PlanMetadata { - if x != nil { - return x.KnownPlans - } - return nil -} - -func (x *PeerState) GetKnownRepos() []*RepoMetadata { - if x != nil { - return x.KnownRepos - } - return nil -} - -func (x *PeerState) GetRemoteConfig() *RemoteConfig { - if x != nil { - return x.RemoteConfig - } - return nil -} - -func (x *PeerState) GetLastHeartbeatMillis() int64 { - if x != nil { - return x.LastHeartbeatMillis - } - return 0 -} - -type AuthenticateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - InstanceId *v1.SignedMessage `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` // The ID of the peer instance. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AuthenticateRequest) Reset() { - *x = AuthenticateRequest{} - mi := &file_v1sync_syncservice_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthenticateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthenticateRequest) ProtoMessage() {} - -func (x *AuthenticateRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthenticateRequest.ProtoReflect.Descriptor instead. -func (*AuthenticateRequest) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{2} -} - -func (x *AuthenticateRequest) GetInstanceId() *v1.SignedMessage { - if x != nil { - return x.InstanceId - } - return nil -} - -type GetOperationMetadataResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - OpIds []int64 `protobuf:"varint,1,rep,packed,name=op_ids,json=opIds,proto3" json:"op_ids,omitempty"` // The IDs of the operations. - Modnos []int64 `protobuf:"varint,2,rep,packed,name=modnos,proto3" json:"modnos,omitempty"` // The modnos of the operations. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetOperationMetadataResponse) Reset() { - *x = GetOperationMetadataResponse{} - mi := &file_v1sync_syncservice_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetOperationMetadataResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOperationMetadataResponse) ProtoMessage() {} - -func (x *GetOperationMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOperationMetadataResponse.ProtoReflect.Descriptor instead. -func (*GetOperationMetadataResponse) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{3} -} - -func (x *GetOperationMetadataResponse) GetOpIds() []int64 { - if x != nil { - return x.OpIds - } - return nil -} - -func (x *GetOperationMetadataResponse) GetModnos() []int64 { - if x != nil { - return x.Modnos - } - return nil -} - -type LogDataEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - LogId string `protobuf:"bytes,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` // The ID of the log, only used for the first message in a log data stream. - OwnerOpid int64 `protobuf:"varint,2,opt,name=owner_opid,json=ownerOpid,proto3" json:"owner_opid,omitempty"` // The operation ID of the operation that owns this log data. - ExpirationTsUnix int64 `protobuf:"varint,3,opt,name=expiration_ts_unix,json=expirationTsUnix,proto3" json:"expiration_ts_unix,omitempty"` // Unix timestamp in seconds when the log data expires. - Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` // The log data chunk, can be sent repeatedly, must be terminated by a packet with size = 0. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogDataEntry) Reset() { - *x = LogDataEntry{} - mi := &file_v1sync_syncservice_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogDataEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogDataEntry) ProtoMessage() {} - -func (x *LogDataEntry) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LogDataEntry.ProtoReflect.Descriptor instead. -func (*LogDataEntry) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{4} -} - -func (x *LogDataEntry) GetLogId() string { - if x != nil { - return x.LogId - } - return "" -} - -func (x *LogDataEntry) GetOwnerOpid() int64 { - if x != nil { - return x.OwnerOpid - } - return 0 -} - -func (x *LogDataEntry) GetExpirationTsUnix() int64 { - if x != nil { - return x.ExpirationTsUnix - } - return 0 -} - -func (x *LogDataEntry) GetChunk() []byte { - if x != nil { - return x.Chunk - } - return nil -} - -type SetAvailableResourcesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Repos []*PlanMetadata `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"` // The repos that are available. - Plans []*RepoMetadata `protobuf:"bytes,2,rep,name=plans,proto3" json:"plans,omitempty"` // The plans that are available. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetAvailableResourcesRequest) Reset() { - *x = SetAvailableResourcesRequest{} - mi := &file_v1sync_syncservice_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetAvailableResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetAvailableResourcesRequest) ProtoMessage() {} - -func (x *SetAvailableResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetAvailableResourcesRequest.ProtoReflect.Descriptor instead. -func (*SetAvailableResourcesRequest) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{5} -} - -func (x *SetAvailableResourcesRequest) GetRepos() []*PlanMetadata { - if x != nil { - return x.Repos - } - return nil -} - -func (x *SetAvailableResourcesRequest) GetPlans() []*RepoMetadata { - if x != nil { - return x.Plans - } - return nil -} - -type RepoMetadata struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Guid string `protobuf:"bytes,2,opt,name=guid,proto3" json:"guid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RepoMetadata) Reset() { - *x = RepoMetadata{} - mi := &file_v1sync_syncservice_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RepoMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepoMetadata) ProtoMessage() {} - -func (x *RepoMetadata) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepoMetadata.ProtoReflect.Descriptor instead. -func (*RepoMetadata) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{6} -} - -func (x *RepoMetadata) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepoMetadata) GetGuid() string { - if x != nil { - return x.Guid - } - return "" -} - -type PlanMetadata struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PlanMetadata) Reset() { - *x = PlanMetadata{} - mi := &file_v1sync_syncservice_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PlanMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlanMetadata) ProtoMessage() {} - -func (x *PlanMetadata) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlanMetadata.ProtoReflect.Descriptor instead. -func (*PlanMetadata) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{7} -} - -func (x *PlanMetadata) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type SetConfigRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Plans []*v1.Plan `protobuf:"bytes,1,rep,name=plans,proto3" json:"plans,omitempty"` // The plans to set. - Repos []*v1.Repo `protobuf:"bytes,2,rep,name=repos,proto3" json:"repos,omitempty"` // The repos to set. - ReposToDelete []string `protobuf:"bytes,3,rep,name=repos_to_delete,json=reposToDelete,proto3" json:"repos_to_delete,omitempty"` // The repo IDs to delete. - PlansToDelete []string `protobuf:"bytes,4,rep,name=plans_to_delete,json=plansToDelete,proto3" json:"plans_to_delete,omitempty"` // The plan IDs to delete. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetConfigRequest) Reset() { - *x = SetConfigRequest{} - mi := &file_v1sync_syncservice_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetConfigRequest) ProtoMessage() {} - -func (x *SetConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetConfigRequest.ProtoReflect.Descriptor instead. -func (*SetConfigRequest) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{8} -} - -func (x *SetConfigRequest) GetPlans() []*v1.Plan { - if x != nil { - return x.Plans - } - return nil -} - -func (x *SetConfigRequest) GetRepos() []*v1.Repo { - if x != nil { - return x.Repos - } - return nil -} - -func (x *SetConfigRequest) GetReposToDelete() []string { - if x != nil { - return x.ReposToDelete - } - return nil -} - -func (x *SetConfigRequest) GetPlansToDelete() []string { - if x != nil { - return x.PlansToDelete - } - return nil -} - -type RemoteConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Modno int32 `protobuf:"varint,1,opt,name=modno,proto3" json:"modno,omitempty"` // The modno of the config. - Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` // The storage version of the config. - Repos []*v1.Repo `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"` - Plans []*v1.Plan `protobuf:"bytes,4,rep,name=plans,proto3" json:"plans,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteConfig) Reset() { - *x = RemoteConfig{} - mi := &file_v1sync_syncservice_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteConfig) ProtoMessage() {} - -func (x *RemoteConfig) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoteConfig.ProtoReflect.Descriptor instead. -func (*RemoteConfig) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{9} -} - -func (x *RemoteConfig) GetModno() int32 { - if x != nil { - return x.Modno - } - return 0 -} - -func (x *RemoteConfig) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *RemoteConfig) GetRepos() []*v1.Repo { - if x != nil { - return x.Repos - } - return nil -} - -func (x *RemoteConfig) GetPlans() []*v1.Plan { - if x != nil { - return x.Plans - } - return nil -} - -type AuthorizationToken struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicKey *v1.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - InstanceId *v1.SignedMessage `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` // The ID of the peer instance. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AuthorizationToken) Reset() { - *x = AuthorizationToken{} - mi := &file_v1sync_syncservice_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthorizationToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthorizationToken) ProtoMessage() {} - -func (x *AuthorizationToken) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthorizationToken.ProtoReflect.Descriptor instead. -func (*AuthorizationToken) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{10} -} - -func (x *AuthorizationToken) GetPublicKey() *v1.PublicKey { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *AuthorizationToken) GetInstanceId() *v1.SignedMessage { - if x != nil { - return x.InstanceId - } - return nil -} - -type SyncStreamItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Action: - // - // *SyncStreamItem_SignedMessage - // *SyncStreamItem_Handshake - // *SyncStreamItem_Heartbeat - // *SyncStreamItem_RequestOperations - // *SyncStreamItem_ReceiveOperations - // *SyncStreamItem_ReceiveConfig - // *SyncStreamItem_SetConfig - // *SyncStreamItem_RequestResources - // *SyncStreamItem_ReceiveResources - // *SyncStreamItem_RequestLog - // *SyncStreamItem_ReceiveLogData - // *SyncStreamItem_Throttle - Action isSyncStreamItem_Action `protobuf_oneof:"action"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem) Reset() { - *x = SyncStreamItem{} - mi := &file_v1sync_syncservice_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem) ProtoMessage() {} - -func (x *SyncStreamItem) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem.ProtoReflect.Descriptor instead. -func (*SyncStreamItem) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11} -} - -func (x *SyncStreamItem) GetAction() isSyncStreamItem_Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *SyncStreamItem) GetSignedMessage() *v1.SignedMessage { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_SignedMessage); ok { - return x.SignedMessage - } - } - return nil -} - -func (x *SyncStreamItem) GetHandshake() *SyncStreamItem_SyncActionHandshake { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_Handshake); ok { - return x.Handshake - } - } - return nil -} - -func (x *SyncStreamItem) GetHeartbeat() *SyncStreamItem_SyncActionHeartbeat { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_Heartbeat); ok { - return x.Heartbeat - } - } - return nil -} - -func (x *SyncStreamItem) GetRequestOperations() *SyncStreamItem_SyncActionRequestOperations { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_RequestOperations); ok { - return x.RequestOperations - } - } - return nil -} - -func (x *SyncStreamItem) GetReceiveOperations() *SyncStreamItem_SyncActionReceiveOperations { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_ReceiveOperations); ok { - return x.ReceiveOperations - } - } - return nil -} - -func (x *SyncStreamItem) GetReceiveConfig() *SyncStreamItem_SyncActionReceiveConfig { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_ReceiveConfig); ok { - return x.ReceiveConfig - } - } - return nil -} - -func (x *SyncStreamItem) GetSetConfig() *SyncStreamItem_SyncActionSetConfig { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_SetConfig); ok { - return x.SetConfig - } - } - return nil -} - -func (x *SyncStreamItem) GetRequestResources() *SyncStreamItem_SyncActionRequestResources { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_RequestResources); ok { - return x.RequestResources - } - } - return nil -} - -func (x *SyncStreamItem) GetReceiveResources() *SyncStreamItem_SyncActionReceiveResources { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_ReceiveResources); ok { - return x.ReceiveResources - } - } - return nil -} - -func (x *SyncStreamItem) GetRequestLog() *SyncStreamItem_SyncActionRequestLog { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_RequestLog); ok { - return x.RequestLog - } - } - return nil -} - -func (x *SyncStreamItem) GetReceiveLogData() *SyncStreamItem_SyncActionReceiveLogData { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_ReceiveLogData); ok { - return x.ReceiveLogData - } - } - return nil -} - -func (x *SyncStreamItem) GetThrottle() *SyncStreamItem_SyncActionThrottle { - if x != nil { - if x, ok := x.Action.(*SyncStreamItem_Throttle); ok { - return x.Throttle - } - } - return nil -} - -type isSyncStreamItem_Action interface { - isSyncStreamItem_Action() -} - -type SyncStreamItem_SignedMessage struct { - SignedMessage *v1.SignedMessage `protobuf:"bytes,1,opt,name=signed_message,json=signedMessage,proto3,oneof"` -} - -type SyncStreamItem_Handshake struct { - Handshake *SyncStreamItem_SyncActionHandshake `protobuf:"bytes,3,opt,name=handshake,proto3,oneof"` // note: mostly deprecated, sent through headers rather than stream. -} - -type SyncStreamItem_Heartbeat struct { - Heartbeat *SyncStreamItem_SyncActionHeartbeat `protobuf:"bytes,4,opt,name=heartbeat,proto3,oneof"` -} - -type SyncStreamItem_RequestOperations struct { - RequestOperations *SyncStreamItem_SyncActionRequestOperations `protobuf:"bytes,20,opt,name=request_operations,json=requestOperations,proto3,oneof"` -} - -type SyncStreamItem_ReceiveOperations struct { - ReceiveOperations *SyncStreamItem_SyncActionReceiveOperations `protobuf:"bytes,21,opt,name=receive_operations,json=receiveOperations,proto3,oneof"` -} - -type SyncStreamItem_ReceiveConfig struct { - ReceiveConfig *SyncStreamItem_SyncActionReceiveConfig `protobuf:"bytes,22,opt,name=receive_config,json=receiveConfig,proto3,oneof"` -} - -type SyncStreamItem_SetConfig struct { - SetConfig *SyncStreamItem_SyncActionSetConfig `protobuf:"bytes,24,opt,name=set_config,json=setConfig,proto3,oneof"` -} - -type SyncStreamItem_RequestResources struct { - RequestResources *SyncStreamItem_SyncActionRequestResources `protobuf:"bytes,25,opt,name=request_resources,json=requestResources,proto3,oneof"` // request a list of available resources. Only used by the server. -} - -type SyncStreamItem_ReceiveResources struct { - ReceiveResources *SyncStreamItem_SyncActionReceiveResources `protobuf:"bytes,26,opt,name=receive_resources,json=receiveResources,proto3,oneof"` // receiving a list of available resources. -} - -type SyncStreamItem_RequestLog struct { - RequestLog *SyncStreamItem_SyncActionRequestLog `protobuf:"bytes,30,opt,name=request_log,json=requestLog,proto3,oneof"` -} - -type SyncStreamItem_ReceiveLogData struct { - ReceiveLogData *SyncStreamItem_SyncActionReceiveLogData `protobuf:"bytes,31,opt,name=receive_log_data,json=receiveLogData,proto3,oneof"` -} - -type SyncStreamItem_Throttle struct { - Throttle *SyncStreamItem_SyncActionThrottle `protobuf:"bytes,1000,opt,name=throttle,proto3,oneof"` -} - -func (*SyncStreamItem_SignedMessage) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_Handshake) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_Heartbeat) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_RequestOperations) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_ReceiveOperations) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_ReceiveConfig) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_SetConfig) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_RequestResources) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_ReceiveResources) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_RequestLog) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_ReceiveLogData) isSyncStreamItem_Action() {} - -func (*SyncStreamItem_Throttle) isSyncStreamItem_Action() {} - -type SyncStreamItem_SyncActionHandshake struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProtocolVersion int64 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` - PublicKey *v1.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - InstanceId *v1.SignedMessage `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionHandshake) Reset() { - *x = SyncStreamItem_SyncActionHandshake{} - mi := &file_v1sync_syncservice_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionHandshake) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionHandshake) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionHandshake) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionHandshake.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionHandshake) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *SyncStreamItem_SyncActionHandshake) GetProtocolVersion() int64 { - if x != nil { - return x.ProtocolVersion - } - return 0 -} - -func (x *SyncStreamItem_SyncActionHandshake) GetPublicKey() *v1.PublicKey { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *SyncStreamItem_SyncActionHandshake) GetInstanceId() *v1.SignedMessage { - if x != nil { - return x.InstanceId - } - return nil -} - -// SyncActionHeartbeat is sent periodically to keep the connection alive. -type SyncStreamItem_SyncActionHeartbeat struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionHeartbeat) Reset() { - *x = SyncStreamItem_SyncActionHeartbeat{} - mi := &file_v1sync_syncservice_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionHeartbeat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionHeartbeat) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionHeartbeat) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionHeartbeat.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionHeartbeat) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 1} -} - -type SyncStreamItem_SyncActionReceiveConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Config *RemoteConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionReceiveConfig) Reset() { - *x = SyncStreamItem_SyncActionReceiveConfig{} - mi := &file_v1sync_syncservice_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionReceiveConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionReceiveConfig) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionReceiveConfig) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionReceiveConfig.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionReceiveConfig) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 2} -} - -func (x *SyncStreamItem_SyncActionReceiveConfig) GetConfig() *RemoteConfig { - if x != nil { - return x.Config - } - return nil -} - -type SyncStreamItem_SyncActionSetConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Repos []*v1.Repo `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"` - Plans []*v1.Plan `protobuf:"bytes,2,rep,name=plans,proto3" json:"plans,omitempty"` - ReposToDelete []string `protobuf:"bytes,3,rep,name=repos_to_delete,json=reposToDelete,proto3" json:"repos_to_delete,omitempty"` - PlansToDelete []string `protobuf:"bytes,4,rep,name=plans_to_delete,json=plansToDelete,proto3" json:"plans_to_delete,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionSetConfig) Reset() { - *x = SyncStreamItem_SyncActionSetConfig{} - mi := &file_v1sync_syncservice_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionSetConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionSetConfig) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionSetConfig) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionSetConfig.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionSetConfig) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 3} -} - -func (x *SyncStreamItem_SyncActionSetConfig) GetRepos() []*v1.Repo { - if x != nil { - return x.Repos - } - return nil -} - -func (x *SyncStreamItem_SyncActionSetConfig) GetPlans() []*v1.Plan { - if x != nil { - return x.Plans - } - return nil -} - -func (x *SyncStreamItem_SyncActionSetConfig) GetReposToDelete() []string { - if x != nil { - return x.ReposToDelete - } - return nil -} - -func (x *SyncStreamItem_SyncActionSetConfig) GetPlansToDelete() []string { - if x != nil { - return x.PlansToDelete - } - return nil -} - -type SyncStreamItem_SyncActionRequestResources struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionRequestResources) Reset() { - *x = SyncStreamItem_SyncActionRequestResources{} - mi := &file_v1sync_syncservice_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionRequestResources) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionRequestResources) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionRequestResources) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionRequestResources.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionRequestResources) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 4} -} - -type SyncStreamItem_SyncActionReceiveResources struct { - state protoimpl.MessageState `protogen:"open.v1"` - Repos []*RepoMetadata `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"` - Plans []*PlanMetadata `protobuf:"bytes,2,rep,name=plans,proto3" json:"plans,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionReceiveResources) Reset() { - *x = SyncStreamItem_SyncActionReceiveResources{} - mi := &file_v1sync_syncservice_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionReceiveResources) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionReceiveResources) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionReceiveResources) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionReceiveResources.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionReceiveResources) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 5} -} - -func (x *SyncStreamItem_SyncActionReceiveResources) GetRepos() []*RepoMetadata { - if x != nil { - return x.Repos - } - return nil -} - -func (x *SyncStreamItem_SyncActionReceiveResources) GetPlans() []*PlanMetadata { - if x != nil { - return x.Plans - } - return nil -} - -type SyncStreamItem_SyncActionConnectRepo struct { - state protoimpl.MessageState `protogen:"open.v1"` - RepoId string `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionConnectRepo) Reset() { - *x = SyncStreamItem_SyncActionConnectRepo{} - mi := &file_v1sync_syncservice_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionConnectRepo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionConnectRepo) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionConnectRepo) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionConnectRepo.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionConnectRepo) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 6} -} - -func (x *SyncStreamItem_SyncActionConnectRepo) GetRepoId() string { - if x != nil { - return x.RepoId - } - return "" -} - -type SyncStreamItem_SyncActionRequestOperations struct { - state protoimpl.MessageState `protogen:"open.v1"` - HighOpid int64 `protobuf:"varint,1,opt,name=high_opid,json=highOpid,proto3" json:"high_opid,omitempty"` // The highest operation ID the requester has. - HighModno int64 `protobuf:"varint,2,opt,name=high_modno,json=highModno,proto3" json:"high_modno,omitempty"` // The highest modno the requester has. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionRequestOperations) Reset() { - *x = SyncStreamItem_SyncActionRequestOperations{} - mi := &file_v1sync_syncservice_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionRequestOperations) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionRequestOperations) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionRequestOperations) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionRequestOperations.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionRequestOperations) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 7} -} - -func (x *SyncStreamItem_SyncActionRequestOperations) GetHighOpid() int64 { - if x != nil { - return x.HighOpid - } - return 0 -} - -func (x *SyncStreamItem_SyncActionRequestOperations) GetHighModno() int64 { - if x != nil { - return x.HighModno - } - return 0 -} - -type SyncStreamItem_SyncActionReceiveOperations struct { - state protoimpl.MessageState `protogen:"open.v1"` - Event *v1.OperationEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionReceiveOperations) Reset() { - *x = SyncStreamItem_SyncActionReceiveOperations{} - mi := &file_v1sync_syncservice_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionReceiveOperations) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionReceiveOperations) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionReceiveOperations) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionReceiveOperations.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionReceiveOperations) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 8} -} - -func (x *SyncStreamItem_SyncActionReceiveOperations) GetEvent() *v1.OperationEvent { - if x != nil { - return x.Event - } - return nil -} - -type SyncStreamItem_SyncActionRequestLog struct { - state protoimpl.MessageState `protogen:"open.v1"` - LogId string `protobuf:"bytes,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionRequestLog) Reset() { - *x = SyncStreamItem_SyncActionRequestLog{} - mi := &file_v1sync_syncservice_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionRequestLog) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionRequestLog) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionRequestLog) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionRequestLog.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionRequestLog) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 9} -} - -func (x *SyncStreamItem_SyncActionRequestLog) GetLogId() string { - if x != nil { - return x.LogId - } - return "" -} - -type SyncStreamItem_SyncActionReceiveLogData struct { - state protoimpl.MessageState `protogen:"open.v1"` - LogId string `protobuf:"bytes,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - // Required only for first message in a log data stream. - OwnerOpid int64 `protobuf:"varint,2,opt,name=owner_opid,json=ownerOpid,proto3" json:"owner_opid,omitempty"` // The operation ID of the operation that owns this log data. - ExpirationTsUnix int64 `protobuf:"varint,3,opt,name=expiration_ts_unix,json=expirationTsUnix,proto3" json:"expiration_ts_unix,omitempty"` // Unix timestamp in seconds when the log data expires. - // Can be sent repeatedly, must be terminated by a packet with size = 0. - Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` - // If set, indicates an error occurred while fetching the log data. - ErrorMessage string `protobuf:"bytes,5,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) Reset() { - *x = SyncStreamItem_SyncActionReceiveLogData{} - mi := &file_v1sync_syncservice_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionReceiveLogData) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionReceiveLogData) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionReceiveLogData.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionReceiveLogData) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 10} -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) GetLogId() string { - if x != nil { - return x.LogId - } - return "" -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) GetOwnerOpid() int64 { - if x != nil { - return x.OwnerOpid - } - return 0 -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) GetExpirationTsUnix() int64 { - if x != nil { - return x.ExpirationTsUnix - } - return 0 -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) GetChunk() []byte { - if x != nil { - return x.Chunk - } - return nil -} - -func (x *SyncStreamItem_SyncActionReceiveLogData) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -type SyncStreamItem_SyncActionThrottle struct { - state protoimpl.MessageState `protogen:"open.v1"` - DelayMs int64 `protobuf:"varint,1,opt,name=delay_ms,json=delayMs,proto3" json:"delay_ms,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncActionThrottle) Reset() { - *x = SyncStreamItem_SyncActionThrottle{} - mi := &file_v1sync_syncservice_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncActionThrottle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncActionThrottle) ProtoMessage() {} - -func (x *SyncStreamItem_SyncActionThrottle) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncActionThrottle.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncActionThrottle) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 11} -} - -func (x *SyncStreamItem_SyncActionThrottle) GetDelayMs() int64 { - if x != nil { - return x.DelayMs - } - return 0 -} - -type SyncStreamItem_SyncEstablishSharedSecret struct { - state protoimpl.MessageState `protogen:"open.v1"` - // a one-time-use ed25519 public key with a matching unshared private key. Used to perform a key exchange. - // See https://pkg.go.dev/crypto/ecdh#PrivateKey.ECDH . - Ed25519 string `protobuf:"bytes,2,opt,name=ed25519,json=ed25519pub,proto3" json:"ed25519,omitempty"` // base64 encoded public key - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncStreamItem_SyncEstablishSharedSecret) Reset() { - *x = SyncStreamItem_SyncEstablishSharedSecret{} - mi := &file_v1sync_syncservice_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncStreamItem_SyncEstablishSharedSecret) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncStreamItem_SyncEstablishSharedSecret) ProtoMessage() {} - -func (x *SyncStreamItem_SyncEstablishSharedSecret) ProtoReflect() protoreflect.Message { - mi := &file_v1sync_syncservice_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncStreamItem_SyncEstablishSharedSecret.ProtoReflect.Descriptor instead. -func (*SyncStreamItem_SyncEstablishSharedSecret) Descriptor() ([]byte, []int) { - return file_v1sync_syncservice_proto_rawDescGZIP(), []int{11, 12} -} - -func (x *SyncStreamItem_SyncEstablishSharedSecret) GetEd25519() string { - if x != nil { - return x.Ed25519 - } - return "" -} - -var File_v1sync_syncservice_proto protoreflect.FileDescriptor - -const file_v1sync_syncservice_proto_rawDesc = "" + - "\n" + - "\x18v1sync/syncservice.proto\x12\x06v1sync\x1a\x0fv1/config.proto\x1a\x0fv1/crypto.proto\x1a\x0fv1/restic.proto\x1a\x10v1/service.proto\x1a\x13v1/operations.proto\x1a\x11types/value.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/protobuf/any.proto\"6\n" + - "\x16SyncStateStreamRequest\x12\x1c\n" + - "\tsubscribe\x18\x01 \x01(\bR\tsubscribe\"\x87\x03\n" + - "\tPeerState\x12(\n" + - "\x10peer_instance_id\x18\x01 \x01(\tR\x0epeerInstanceId\x12\x1d\n" + - "\n" + - "peer_keyid\x18\x02 \x01(\tR\tpeerKeyid\x12-\n" + - "\x05state\x18\x03 \x01(\x0e2\x17.v1sync.ConnectionStateR\x05state\x12%\n" + - "\x0estatus_message\x18\x04 \x01(\tR\rstatusMessage\x125\n" + - "\vknown_plans\x18\x05 \x03(\v2\x14.v1sync.PlanMetadataR\n" + - "knownPlans\x125\n" + - "\vknown_repos\x18\x06 \x03(\v2\x14.v1sync.RepoMetadataR\n" + - "knownRepos\x129\n" + - "\rremote_config\x18\a \x01(\v2\x14.v1sync.RemoteConfigR\fremoteConfig\x122\n" + - "\x15last_heartbeat_millis\x18\b \x01(\x03R\x13lastHeartbeatMillis\"I\n" + - "\x13AuthenticateRequest\x122\n" + - "\vinstance_id\x18\x01 \x01(\v2\x11.v1.SignedMessageR\n" + - "instanceId\"M\n" + - "\x1cGetOperationMetadataResponse\x12\x15\n" + - "\x06op_ids\x18\x01 \x03(\x03R\x05opIds\x12\x16\n" + - "\x06modnos\x18\x02 \x03(\x03R\x06modnos\"\x88\x01\n" + - "\fLogDataEntry\x12\x15\n" + - "\x06log_id\x18\x01 \x01(\tR\x05logId\x12\x1d\n" + - "\n" + - "owner_opid\x18\x02 \x01(\x03R\townerOpid\x12,\n" + - "\x12expiration_ts_unix\x18\x03 \x01(\x03R\x10expirationTsUnix\x12\x14\n" + - "\x05chunk\x18\x04 \x01(\fR\x05chunk\"v\n" + - "\x1cSetAvailableResourcesRequest\x12*\n" + - "\x05repos\x18\x01 \x03(\v2\x14.v1sync.PlanMetadataR\x05repos\x12*\n" + - "\x05plans\x18\x02 \x03(\v2\x14.v1sync.RepoMetadataR\x05plans\"2\n" + - "\fRepoMetadata\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04guid\x18\x02 \x01(\tR\x04guid\"\x1e\n" + - "\fPlanMetadata\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\xa2\x01\n" + - "\x10SetConfigRequest\x12\x1e\n" + - "\x05plans\x18\x01 \x03(\v2\b.v1.PlanR\x05plans\x12\x1e\n" + - "\x05repos\x18\x02 \x03(\v2\b.v1.RepoR\x05repos\x12&\n" + - "\x0frepos_to_delete\x18\x03 \x03(\tR\rreposToDelete\x12&\n" + - "\x0fplans_to_delete\x18\x04 \x03(\tR\rplansToDelete\"~\n" + - "\fRemoteConfig\x12\x14\n" + - "\x05modno\x18\x01 \x01(\x05R\x05modno\x12\x18\n" + - "\aversion\x18\x02 \x01(\x05R\aversion\x12\x1e\n" + - "\x05repos\x18\x03 \x03(\v2\b.v1.RepoR\x05repos\x12\x1e\n" + - "\x05plans\x18\x04 \x03(\v2\b.v1.PlanR\x05plans\"v\n" + - "\x12AuthorizationToken\x12,\n" + - "\n" + - "public_key\x18\x01 \x01(\v2\r.v1.PublicKeyR\tpublicKey\x122\n" + - "\vinstance_id\x18\x02 \x01(\v2\x11.v1.SignedMessageR\n" + - "instanceId\"\xbd\x12\n" + - "\x0eSyncStreamItem\x12:\n" + - "\x0esigned_message\x18\x01 \x01(\v2\x11.v1.SignedMessageH\x00R\rsignedMessage\x12J\n" + - "\thandshake\x18\x03 \x01(\v2*.v1sync.SyncStreamItem.SyncActionHandshakeH\x00R\thandshake\x12J\n" + - "\theartbeat\x18\x04 \x01(\v2*.v1sync.SyncStreamItem.SyncActionHeartbeatH\x00R\theartbeat\x12c\n" + - "\x12request_operations\x18\x14 \x01(\v22.v1sync.SyncStreamItem.SyncActionRequestOperationsH\x00R\x11requestOperations\x12c\n" + - "\x12receive_operations\x18\x15 \x01(\v22.v1sync.SyncStreamItem.SyncActionReceiveOperationsH\x00R\x11receiveOperations\x12W\n" + - "\x0ereceive_config\x18\x16 \x01(\v2..v1sync.SyncStreamItem.SyncActionReceiveConfigH\x00R\rreceiveConfig\x12K\n" + - "\n" + - "set_config\x18\x18 \x01(\v2*.v1sync.SyncStreamItem.SyncActionSetConfigH\x00R\tsetConfig\x12`\n" + - "\x11request_resources\x18\x19 \x01(\v21.v1sync.SyncStreamItem.SyncActionRequestResourcesH\x00R\x10requestResources\x12`\n" + - "\x11receive_resources\x18\x1a \x01(\v21.v1sync.SyncStreamItem.SyncActionReceiveResourcesH\x00R\x10receiveResources\x12N\n" + - "\vrequest_log\x18\x1e \x01(\v2+.v1sync.SyncStreamItem.SyncActionRequestLogH\x00R\n" + - "requestLog\x12[\n" + - "\x10receive_log_data\x18\x1f \x01(\v2/.v1sync.SyncStreamItem.SyncActionReceiveLogDataH\x00R\x0ereceiveLogData\x12H\n" + - "\bthrottle\x18\xe8\a \x01(\v2).v1sync.SyncStreamItem.SyncActionThrottleH\x00R\bthrottle\x1a\xa2\x01\n" + - "\x13SyncActionHandshake\x12)\n" + - "\x10protocol_version\x18\x01 \x01(\x03R\x0fprotocolVersion\x12,\n" + - "\n" + - "public_key\x18\x02 \x01(\v2\r.v1.PublicKeyR\tpublicKey\x122\n" + - "\vinstance_id\x18\x03 \x01(\v2\x11.v1.SignedMessageR\n" + - "instanceId\x1a\x15\n" + - "\x13SyncActionHeartbeat\x1aG\n" + - "\x17SyncActionReceiveConfig\x12,\n" + - "\x06config\x18\x01 \x01(\v2\x14.v1sync.RemoteConfigR\x06config\x1a\xa5\x01\n" + - "\x13SyncActionSetConfig\x12\x1e\n" + - "\x05repos\x18\x01 \x03(\v2\b.v1.RepoR\x05repos\x12\x1e\n" + - "\x05plans\x18\x02 \x03(\v2\b.v1.PlanR\x05plans\x12&\n" + - "\x0frepos_to_delete\x18\x03 \x03(\tR\rreposToDelete\x12&\n" + - "\x0fplans_to_delete\x18\x04 \x03(\tR\rplansToDelete\x1a\x1c\n" + - "\x1aSyncActionRequestResources\x1at\n" + - "\x1aSyncActionReceiveResources\x12*\n" + - "\x05repos\x18\x01 \x03(\v2\x14.v1sync.RepoMetadataR\x05repos\x12*\n" + - "\x05plans\x18\x02 \x03(\v2\x14.v1sync.PlanMetadataR\x05plans\x1a0\n" + - "\x15SyncActionConnectRepo\x12\x17\n" + - "\arepo_id\x18\x01 \x01(\tR\x06repoId\x1aY\n" + - "\x1bSyncActionRequestOperations\x12\x1b\n" + - "\thigh_opid\x18\x01 \x01(\x03R\bhighOpid\x12\x1d\n" + - "\n" + - "high_modno\x18\x02 \x01(\x03R\thighModno\x1aG\n" + - "\x1bSyncActionReceiveOperations\x12(\n" + - "\x05event\x18\x01 \x01(\v2\x12.v1.OperationEventR\x05event\x1a-\n" + - "\x14SyncActionRequestLog\x12\x15\n" + - "\x06log_id\x18\x01 \x01(\tR\x05logId\x1a\xb9\x01\n" + - "\x18SyncActionReceiveLogData\x12\x15\n" + - "\x06log_id\x18\x01 \x01(\tR\x05logId\x12\x1d\n" + - "\n" + - "owner_opid\x18\x02 \x01(\x03R\townerOpid\x12,\n" + - "\x12expiration_ts_unix\x18\x03 \x01(\x03R\x10expirationTsUnix\x12\x14\n" + - "\x05chunk\x18\x04 \x01(\fR\x05chunk\x12#\n" + - "\rerror_message\x18\x05 \x01(\tR\ferrorMessage\x1a/\n" + - "\x12SyncActionThrottle\x12\x19\n" + - "\bdelay_ms\x18\x01 \x01(\x03R\adelayMs\x1a8\n" + - "\x19SyncEstablishSharedSecret\x12\x1b\n" + - "\aed25519\x18\x02 \x01(\tR\n" + - "ed25519pub\"\xb4\x01\n" + - "\x13RepoConnectionState\x12\x1c\n" + - "\x18CONNECTION_STATE_UNKNOWN\x10\x00\x12\x1c\n" + - "\x18CONNECTION_STATE_PENDING\x10\x01\x12\x1e\n" + - "\x1aCONNECTION_STATE_CONNECTED\x10\x02\x12!\n" + - "\x1dCONNECTION_STATE_UNAUTHORIZED\x10\x03\x12\x1e\n" + - "\x1aCONNECTION_STATE_NOT_FOUND\x10\x04B\b\n" + - "\x06action*\x9c\x02\n" + - "\x0fConnectionState\x12\x1c\n" + - "\x18CONNECTION_STATE_UNKNOWN\x10\x00\x12\x1c\n" + - "\x18CONNECTION_STATE_PENDING\x10\x01\x12\x1e\n" + - "\x1aCONNECTION_STATE_CONNECTED\x10\x02\x12!\n" + - "\x1dCONNECTION_STATE_DISCONNECTED\x10\x03\x12\x1f\n" + - "\x1bCONNECTION_STATE_RETRY_WAIT\x10\x04\x12\x1f\n" + - "\x1bCONNECTION_STATE_ERROR_AUTH\x10\n" + - "\x12#\n" + - "\x1fCONNECTION_STATE_ERROR_PROTOCOL\x10\v\x12#\n" + - "\x1fCONNECTION_STATE_ERROR_INTERNAL\x10\f2S\n" + - "\x13BackrestSyncService\x12<\n" + - "\x04Sync\x12\x16.v1sync.SyncStreamItem\x1a\x16.v1sync.SyncStreamItem\"\x00(\x010\x012l\n" + - "\x18BackrestSyncStateService\x12P\n" + - "\x17GetPeerSyncStatesStream\x12\x1e.v1sync.SyncStateStreamRequest\x1a\x11.v1sync.PeerState\"\x000\x01B0Z.github.com/garethgeorge/backrest/gen/go/v1syncb\x06proto3" - -var ( - file_v1sync_syncservice_proto_rawDescOnce sync.Once - file_v1sync_syncservice_proto_rawDescData []byte -) - -func file_v1sync_syncservice_proto_rawDescGZIP() []byte { - file_v1sync_syncservice_proto_rawDescOnce.Do(func() { - file_v1sync_syncservice_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1sync_syncservice_proto_rawDesc), len(file_v1sync_syncservice_proto_rawDesc))) - }) - return file_v1sync_syncservice_proto_rawDescData -} - -var file_v1sync_syncservice_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1sync_syncservice_proto_msgTypes = make([]protoimpl.MessageInfo, 25) -var file_v1sync_syncservice_proto_goTypes = []any{ - (ConnectionState)(0), // 0: v1sync.ConnectionState - (SyncStreamItem_RepoConnectionState)(0), // 1: v1sync.SyncStreamItem.RepoConnectionState - (*SyncStateStreamRequest)(nil), // 2: v1sync.SyncStateStreamRequest - (*PeerState)(nil), // 3: v1sync.PeerState - (*AuthenticateRequest)(nil), // 4: v1sync.AuthenticateRequest - (*GetOperationMetadataResponse)(nil), // 5: v1sync.GetOperationMetadataResponse - (*LogDataEntry)(nil), // 6: v1sync.LogDataEntry - (*SetAvailableResourcesRequest)(nil), // 7: v1sync.SetAvailableResourcesRequest - (*RepoMetadata)(nil), // 8: v1sync.RepoMetadata - (*PlanMetadata)(nil), // 9: v1sync.PlanMetadata - (*SetConfigRequest)(nil), // 10: v1sync.SetConfigRequest - (*RemoteConfig)(nil), // 11: v1sync.RemoteConfig - (*AuthorizationToken)(nil), // 12: v1sync.AuthorizationToken - (*SyncStreamItem)(nil), // 13: v1sync.SyncStreamItem - (*SyncStreamItem_SyncActionHandshake)(nil), // 14: v1sync.SyncStreamItem.SyncActionHandshake - (*SyncStreamItem_SyncActionHeartbeat)(nil), // 15: v1sync.SyncStreamItem.SyncActionHeartbeat - (*SyncStreamItem_SyncActionReceiveConfig)(nil), // 16: v1sync.SyncStreamItem.SyncActionReceiveConfig - (*SyncStreamItem_SyncActionSetConfig)(nil), // 17: v1sync.SyncStreamItem.SyncActionSetConfig - (*SyncStreamItem_SyncActionRequestResources)(nil), // 18: v1sync.SyncStreamItem.SyncActionRequestResources - (*SyncStreamItem_SyncActionReceiveResources)(nil), // 19: v1sync.SyncStreamItem.SyncActionReceiveResources - (*SyncStreamItem_SyncActionConnectRepo)(nil), // 20: v1sync.SyncStreamItem.SyncActionConnectRepo - (*SyncStreamItem_SyncActionRequestOperations)(nil), // 21: v1sync.SyncStreamItem.SyncActionRequestOperations - (*SyncStreamItem_SyncActionReceiveOperations)(nil), // 22: v1sync.SyncStreamItem.SyncActionReceiveOperations - (*SyncStreamItem_SyncActionRequestLog)(nil), // 23: v1sync.SyncStreamItem.SyncActionRequestLog - (*SyncStreamItem_SyncActionReceiveLogData)(nil), // 24: v1sync.SyncStreamItem.SyncActionReceiveLogData - (*SyncStreamItem_SyncActionThrottle)(nil), // 25: v1sync.SyncStreamItem.SyncActionThrottle - (*SyncStreamItem_SyncEstablishSharedSecret)(nil), // 26: v1sync.SyncStreamItem.SyncEstablishSharedSecret - (*v1.SignedMessage)(nil), // 27: v1.SignedMessage - (*v1.Plan)(nil), // 28: v1.Plan - (*v1.Repo)(nil), // 29: v1.Repo - (*v1.PublicKey)(nil), // 30: v1.PublicKey - (*v1.OperationEvent)(nil), // 31: v1.OperationEvent -} -var file_v1sync_syncservice_proto_depIdxs = []int32{ - 0, // 0: v1sync.PeerState.state:type_name -> v1sync.ConnectionState - 9, // 1: v1sync.PeerState.known_plans:type_name -> v1sync.PlanMetadata - 8, // 2: v1sync.PeerState.known_repos:type_name -> v1sync.RepoMetadata - 11, // 3: v1sync.PeerState.remote_config:type_name -> v1sync.RemoteConfig - 27, // 4: v1sync.AuthenticateRequest.instance_id:type_name -> v1.SignedMessage - 9, // 5: v1sync.SetAvailableResourcesRequest.repos:type_name -> v1sync.PlanMetadata - 8, // 6: v1sync.SetAvailableResourcesRequest.plans:type_name -> v1sync.RepoMetadata - 28, // 7: v1sync.SetConfigRequest.plans:type_name -> v1.Plan - 29, // 8: v1sync.SetConfigRequest.repos:type_name -> v1.Repo - 29, // 9: v1sync.RemoteConfig.repos:type_name -> v1.Repo - 28, // 10: v1sync.RemoteConfig.plans:type_name -> v1.Plan - 30, // 11: v1sync.AuthorizationToken.public_key:type_name -> v1.PublicKey - 27, // 12: v1sync.AuthorizationToken.instance_id:type_name -> v1.SignedMessage - 27, // 13: v1sync.SyncStreamItem.signed_message:type_name -> v1.SignedMessage - 14, // 14: v1sync.SyncStreamItem.handshake:type_name -> v1sync.SyncStreamItem.SyncActionHandshake - 15, // 15: v1sync.SyncStreamItem.heartbeat:type_name -> v1sync.SyncStreamItem.SyncActionHeartbeat - 21, // 16: v1sync.SyncStreamItem.request_operations:type_name -> v1sync.SyncStreamItem.SyncActionRequestOperations - 22, // 17: v1sync.SyncStreamItem.receive_operations:type_name -> v1sync.SyncStreamItem.SyncActionReceiveOperations - 16, // 18: v1sync.SyncStreamItem.receive_config:type_name -> v1sync.SyncStreamItem.SyncActionReceiveConfig - 17, // 19: v1sync.SyncStreamItem.set_config:type_name -> v1sync.SyncStreamItem.SyncActionSetConfig - 18, // 20: v1sync.SyncStreamItem.request_resources:type_name -> v1sync.SyncStreamItem.SyncActionRequestResources - 19, // 21: v1sync.SyncStreamItem.receive_resources:type_name -> v1sync.SyncStreamItem.SyncActionReceiveResources - 23, // 22: v1sync.SyncStreamItem.request_log:type_name -> v1sync.SyncStreamItem.SyncActionRequestLog - 24, // 23: v1sync.SyncStreamItem.receive_log_data:type_name -> v1sync.SyncStreamItem.SyncActionReceiveLogData - 25, // 24: v1sync.SyncStreamItem.throttle:type_name -> v1sync.SyncStreamItem.SyncActionThrottle - 30, // 25: v1sync.SyncStreamItem.SyncActionHandshake.public_key:type_name -> v1.PublicKey - 27, // 26: v1sync.SyncStreamItem.SyncActionHandshake.instance_id:type_name -> v1.SignedMessage - 11, // 27: v1sync.SyncStreamItem.SyncActionReceiveConfig.config:type_name -> v1sync.RemoteConfig - 29, // 28: v1sync.SyncStreamItem.SyncActionSetConfig.repos:type_name -> v1.Repo - 28, // 29: v1sync.SyncStreamItem.SyncActionSetConfig.plans:type_name -> v1.Plan - 8, // 30: v1sync.SyncStreamItem.SyncActionReceiveResources.repos:type_name -> v1sync.RepoMetadata - 9, // 31: v1sync.SyncStreamItem.SyncActionReceiveResources.plans:type_name -> v1sync.PlanMetadata - 31, // 32: v1sync.SyncStreamItem.SyncActionReceiveOperations.event:type_name -> v1.OperationEvent - 13, // 33: v1sync.BackrestSyncService.Sync:input_type -> v1sync.SyncStreamItem - 2, // 34: v1sync.BackrestSyncStateService.GetPeerSyncStatesStream:input_type -> v1sync.SyncStateStreamRequest - 13, // 35: v1sync.BackrestSyncService.Sync:output_type -> v1sync.SyncStreamItem - 3, // 36: v1sync.BackrestSyncStateService.GetPeerSyncStatesStream:output_type -> v1sync.PeerState - 35, // [35:37] is the sub-list for method output_type - 33, // [33:35] is the sub-list for method input_type - 33, // [33:33] is the sub-list for extension type_name - 33, // [33:33] is the sub-list for extension extendee - 0, // [0:33] is the sub-list for field type_name -} - -func init() { file_v1sync_syncservice_proto_init() } -func file_v1sync_syncservice_proto_init() { - if File_v1sync_syncservice_proto != nil { - return - } - file_v1sync_syncservice_proto_msgTypes[11].OneofWrappers = []any{ - (*SyncStreamItem_SignedMessage)(nil), - (*SyncStreamItem_Handshake)(nil), - (*SyncStreamItem_Heartbeat)(nil), - (*SyncStreamItem_RequestOperations)(nil), - (*SyncStreamItem_ReceiveOperations)(nil), - (*SyncStreamItem_ReceiveConfig)(nil), - (*SyncStreamItem_SetConfig)(nil), - (*SyncStreamItem_RequestResources)(nil), - (*SyncStreamItem_ReceiveResources)(nil), - (*SyncStreamItem_RequestLog)(nil), - (*SyncStreamItem_ReceiveLogData)(nil), - (*SyncStreamItem_Throttle)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1sync_syncservice_proto_rawDesc), len(file_v1sync_syncservice_proto_rawDesc)), - NumEnums: 2, - NumMessages: 25, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_v1sync_syncservice_proto_goTypes, - DependencyIndexes: file_v1sync_syncservice_proto_depIdxs, - EnumInfos: file_v1sync_syncservice_proto_enumTypes, - MessageInfos: file_v1sync_syncservice_proto_msgTypes, - }.Build() - File_v1sync_syncservice_proto = out.File - file_v1sync_syncservice_proto_goTypes = nil - file_v1sync_syncservice_proto_depIdxs = nil -} diff --git a/gen/go/v1sync/syncservice_grpc.pb.go b/gen/go/v1sync/syncservice_grpc.pb.go deleted file mode 100644 index b445c78fc..000000000 --- a/gen/go/v1sync/syncservice_grpc.pb.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc (unknown) -// source: v1sync/syncservice.proto - -package v1sync - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - BackrestSyncService_Sync_FullMethodName = "/v1sync.BackrestSyncService/Sync" -) - -// BackrestSyncServiceClient is the client API for BackrestSyncService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// BackrestSyncService provides methods to sync data between backrest instances. -// This service provides its own authentication and authorization. -type BackrestSyncServiceClient interface { - Sync(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncStreamItem, SyncStreamItem], error) -} - -type backrestSyncServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBackrestSyncServiceClient(cc grpc.ClientConnInterface) BackrestSyncServiceClient { - return &backrestSyncServiceClient{cc} -} - -func (c *backrestSyncServiceClient) Sync(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncStreamItem, SyncStreamItem], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &BackrestSyncService_ServiceDesc.Streams[0], BackrestSyncService_Sync_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[SyncStreamItem, SyncStreamItem]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackrestSyncService_SyncClient = grpc.BidiStreamingClient[SyncStreamItem, SyncStreamItem] - -// BackrestSyncServiceServer is the server API for BackrestSyncService service. -// All implementations must embed UnimplementedBackrestSyncServiceServer -// for forward compatibility. -// -// BackrestSyncService provides methods to sync data between backrest instances. -// This service provides its own authentication and authorization. -type BackrestSyncServiceServer interface { - Sync(grpc.BidiStreamingServer[SyncStreamItem, SyncStreamItem]) error - mustEmbedUnimplementedBackrestSyncServiceServer() -} - -// UnimplementedBackrestSyncServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBackrestSyncServiceServer struct{} - -func (UnimplementedBackrestSyncServiceServer) Sync(grpc.BidiStreamingServer[SyncStreamItem, SyncStreamItem]) error { - return status.Errorf(codes.Unimplemented, "method Sync not implemented") -} -func (UnimplementedBackrestSyncServiceServer) mustEmbedUnimplementedBackrestSyncServiceServer() {} -func (UnimplementedBackrestSyncServiceServer) testEmbeddedByValue() {} - -// UnsafeBackrestSyncServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackrestSyncServiceServer will -// result in compilation errors. -type UnsafeBackrestSyncServiceServer interface { - mustEmbedUnimplementedBackrestSyncServiceServer() -} - -func RegisterBackrestSyncServiceServer(s grpc.ServiceRegistrar, srv BackrestSyncServiceServer) { - // If the following call pancis, it indicates UnimplementedBackrestSyncServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BackrestSyncService_ServiceDesc, srv) -} - -func _BackrestSyncService_Sync_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(BackrestSyncServiceServer).Sync(&grpc.GenericServerStream[SyncStreamItem, SyncStreamItem]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackrestSyncService_SyncServer = grpc.BidiStreamingServer[SyncStreamItem, SyncStreamItem] - -// BackrestSyncService_ServiceDesc is the grpc.ServiceDesc for BackrestSyncService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BackrestSyncService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "v1sync.BackrestSyncService", - HandlerType: (*BackrestSyncServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Sync", - Handler: _BackrestSyncService_Sync_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "v1sync/syncservice.proto", -} - -const ( - BackrestSyncStateService_GetPeerSyncStatesStream_FullMethodName = "/v1sync.BackrestSyncStateService/GetPeerSyncStatesStream" -) - -// BackrestSyncStateServiceClient is the client API for BackrestSyncStateService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// BackrestSyncStateService provides methods to query the sync state of known hosts and clients. -// This service should be served behind authentication and authorization. -type BackrestSyncStateServiceClient interface { - GetPeerSyncStatesStream(ctx context.Context, in *SyncStateStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PeerState], error) -} - -type backrestSyncStateServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBackrestSyncStateServiceClient(cc grpc.ClientConnInterface) BackrestSyncStateServiceClient { - return &backrestSyncStateServiceClient{cc} -} - -func (c *backrestSyncStateServiceClient) GetPeerSyncStatesStream(ctx context.Context, in *SyncStateStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PeerState], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &BackrestSyncStateService_ServiceDesc.Streams[0], BackrestSyncStateService_GetPeerSyncStatesStream_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[SyncStateStreamRequest, PeerState]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackrestSyncStateService_GetPeerSyncStatesStreamClient = grpc.ServerStreamingClient[PeerState] - -// BackrestSyncStateServiceServer is the server API for BackrestSyncStateService service. -// All implementations must embed UnimplementedBackrestSyncStateServiceServer -// for forward compatibility. -// -// BackrestSyncStateService provides methods to query the sync state of known hosts and clients. -// This service should be served behind authentication and authorization. -type BackrestSyncStateServiceServer interface { - GetPeerSyncStatesStream(*SyncStateStreamRequest, grpc.ServerStreamingServer[PeerState]) error - mustEmbedUnimplementedBackrestSyncStateServiceServer() -} - -// UnimplementedBackrestSyncStateServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBackrestSyncStateServiceServer struct{} - -func (UnimplementedBackrestSyncStateServiceServer) GetPeerSyncStatesStream(*SyncStateStreamRequest, grpc.ServerStreamingServer[PeerState]) error { - return status.Errorf(codes.Unimplemented, "method GetPeerSyncStatesStream not implemented") -} -func (UnimplementedBackrestSyncStateServiceServer) mustEmbedUnimplementedBackrestSyncStateServiceServer() { -} -func (UnimplementedBackrestSyncStateServiceServer) testEmbeddedByValue() {} - -// UnsafeBackrestSyncStateServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackrestSyncStateServiceServer will -// result in compilation errors. -type UnsafeBackrestSyncStateServiceServer interface { - mustEmbedUnimplementedBackrestSyncStateServiceServer() -} - -func RegisterBackrestSyncStateServiceServer(s grpc.ServiceRegistrar, srv BackrestSyncStateServiceServer) { - // If the following call pancis, it indicates UnimplementedBackrestSyncStateServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BackrestSyncStateService_ServiceDesc, srv) -} - -func _BackrestSyncStateService_GetPeerSyncStatesStream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SyncStateStreamRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BackrestSyncStateServiceServer).GetPeerSyncStatesStream(m, &grpc.GenericServerStream[SyncStateStreamRequest, PeerState]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackrestSyncStateService_GetPeerSyncStatesStreamServer = grpc.ServerStreamingServer[PeerState] - -// BackrestSyncStateService_ServiceDesc is the grpc.ServiceDesc for BackrestSyncStateService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BackrestSyncStateService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "v1sync.BackrestSyncStateService", - HandlerType: (*BackrestSyncStateServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetPeerSyncStatesStream", - Handler: _BackrestSyncStateService_GetPeerSyncStatesStream_Handler, - ServerStreams: true, - }, - }, - Metadata: "v1sync/syncservice.proto", -} diff --git a/gen/go/v1sync/v1syncconnect/syncservice.connect.go b/gen/go/v1sync/v1syncconnect/syncservice.connect.go deleted file mode 100644 index e8af57bef..000000000 --- a/gen/go/v1sync/v1syncconnect/syncservice.connect.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by protoc-gen-connect-go. DO NOT EDIT. -// -// Source: v1sync/syncservice.proto - -package v1syncconnect - -import ( - connect "connectrpc.com/connect" - context "context" - errors "errors" - v1sync "github.com/garethgeorge/backrest/gen/go/v1sync" - http "net/http" - strings "strings" -) - -// This is a compile-time assertion to ensure that this generated file and the connect package are -// compatible. If you get a compiler error that this constant is not defined, this code was -// generated with a version of connect newer than the one compiled into your binary. You can fix the -// problem by either regenerating this code with an older version of connect or updating the connect -// version compiled into your binary. -const _ = connect.IsAtLeastVersion1_13_0 - -const ( - // BackrestSyncServiceName is the fully-qualified name of the BackrestSyncService service. - BackrestSyncServiceName = "v1sync.BackrestSyncService" - // BackrestSyncStateServiceName is the fully-qualified name of the BackrestSyncStateService service. - BackrestSyncStateServiceName = "v1sync.BackrestSyncStateService" -) - -// These constants are the fully-qualified names of the RPCs defined in this package. They're -// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. -// -// Note that these are different from the fully-qualified method names used by -// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to -// reflection-formatted method names, remove the leading slash and convert the remaining slash to a -// period. -const ( - // BackrestSyncServiceSyncProcedure is the fully-qualified name of the BackrestSyncService's Sync - // RPC. - BackrestSyncServiceSyncProcedure = "/v1sync.BackrestSyncService/Sync" - // BackrestSyncStateServiceGetPeerSyncStatesStreamProcedure is the fully-qualified name of the - // BackrestSyncStateService's GetPeerSyncStatesStream RPC. - BackrestSyncStateServiceGetPeerSyncStatesStreamProcedure = "/v1sync.BackrestSyncStateService/GetPeerSyncStatesStream" -) - -// BackrestSyncServiceClient is a client for the v1sync.BackrestSyncService service. -type BackrestSyncServiceClient interface { - Sync(context.Context) *connect.BidiStreamForClient[v1sync.SyncStreamItem, v1sync.SyncStreamItem] -} - -// NewBackrestSyncServiceClient constructs a client for the v1sync.BackrestSyncService service. By -// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, -// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the -// connect.WithGRPC() or connect.WithGRPCWeb() options. -// -// The URL supplied here should be the base URL for the Connect or gRPC server (for example, -// http://api.acme.com or https://acme.com/grpc). -func NewBackrestSyncServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BackrestSyncServiceClient { - baseURL = strings.TrimRight(baseURL, "/") - backrestSyncServiceMethods := v1sync.File_v1sync_syncservice_proto.Services().ByName("BackrestSyncService").Methods() - return &backrestSyncServiceClient{ - sync: connect.NewClient[v1sync.SyncStreamItem, v1sync.SyncStreamItem]( - httpClient, - baseURL+BackrestSyncServiceSyncProcedure, - connect.WithSchema(backrestSyncServiceMethods.ByName("Sync")), - connect.WithClientOptions(opts...), - ), - } -} - -// backrestSyncServiceClient implements BackrestSyncServiceClient. -type backrestSyncServiceClient struct { - sync *connect.Client[v1sync.SyncStreamItem, v1sync.SyncStreamItem] -} - -// Sync calls v1sync.BackrestSyncService.Sync. -func (c *backrestSyncServiceClient) Sync(ctx context.Context) *connect.BidiStreamForClient[v1sync.SyncStreamItem, v1sync.SyncStreamItem] { - return c.sync.CallBidiStream(ctx) -} - -// BackrestSyncServiceHandler is an implementation of the v1sync.BackrestSyncService service. -type BackrestSyncServiceHandler interface { - Sync(context.Context, *connect.BidiStream[v1sync.SyncStreamItem, v1sync.SyncStreamItem]) error -} - -// NewBackrestSyncServiceHandler builds an HTTP handler from the service implementation. It returns -// the path on which to mount the handler and the handler itself. -// -// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf -// and JSON codecs. They also support gzip compression. -func NewBackrestSyncServiceHandler(svc BackrestSyncServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - backrestSyncServiceMethods := v1sync.File_v1sync_syncservice_proto.Services().ByName("BackrestSyncService").Methods() - backrestSyncServiceSyncHandler := connect.NewBidiStreamHandler( - BackrestSyncServiceSyncProcedure, - svc.Sync, - connect.WithSchema(backrestSyncServiceMethods.ByName("Sync")), - connect.WithHandlerOptions(opts...), - ) - return "/v1sync.BackrestSyncService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case BackrestSyncServiceSyncProcedure: - backrestSyncServiceSyncHandler.ServeHTTP(w, r) - default: - http.NotFound(w, r) - } - }) -} - -// UnimplementedBackrestSyncServiceHandler returns CodeUnimplemented from all methods. -type UnimplementedBackrestSyncServiceHandler struct{} - -func (UnimplementedBackrestSyncServiceHandler) Sync(context.Context, *connect.BidiStream[v1sync.SyncStreamItem, v1sync.SyncStreamItem]) error { - return connect.NewError(connect.CodeUnimplemented, errors.New("v1sync.BackrestSyncService.Sync is not implemented")) -} - -// BackrestSyncStateServiceClient is a client for the v1sync.BackrestSyncStateService service. -type BackrestSyncStateServiceClient interface { - GetPeerSyncStatesStream(context.Context, *connect.Request[v1sync.SyncStateStreamRequest]) (*connect.ServerStreamForClient[v1sync.PeerState], error) -} - -// NewBackrestSyncStateServiceClient constructs a client for the v1sync.BackrestSyncStateService -// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for -// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply -// the connect.WithGRPC() or connect.WithGRPCWeb() options. -// -// The URL supplied here should be the base URL for the Connect or gRPC server (for example, -// http://api.acme.com or https://acme.com/grpc). -func NewBackrestSyncStateServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BackrestSyncStateServiceClient { - baseURL = strings.TrimRight(baseURL, "/") - backrestSyncStateServiceMethods := v1sync.File_v1sync_syncservice_proto.Services().ByName("BackrestSyncStateService").Methods() - return &backrestSyncStateServiceClient{ - getPeerSyncStatesStream: connect.NewClient[v1sync.SyncStateStreamRequest, v1sync.PeerState]( - httpClient, - baseURL+BackrestSyncStateServiceGetPeerSyncStatesStreamProcedure, - connect.WithSchema(backrestSyncStateServiceMethods.ByName("GetPeerSyncStatesStream")), - connect.WithClientOptions(opts...), - ), - } -} - -// backrestSyncStateServiceClient implements BackrestSyncStateServiceClient. -type backrestSyncStateServiceClient struct { - getPeerSyncStatesStream *connect.Client[v1sync.SyncStateStreamRequest, v1sync.PeerState] -} - -// GetPeerSyncStatesStream calls v1sync.BackrestSyncStateService.GetPeerSyncStatesStream. -func (c *backrestSyncStateServiceClient) GetPeerSyncStatesStream(ctx context.Context, req *connect.Request[v1sync.SyncStateStreamRequest]) (*connect.ServerStreamForClient[v1sync.PeerState], error) { - return c.getPeerSyncStatesStream.CallServerStream(ctx, req) -} - -// BackrestSyncStateServiceHandler is an implementation of the v1sync.BackrestSyncStateService -// service. -type BackrestSyncStateServiceHandler interface { - GetPeerSyncStatesStream(context.Context, *connect.Request[v1sync.SyncStateStreamRequest], *connect.ServerStream[v1sync.PeerState]) error -} - -// NewBackrestSyncStateServiceHandler builds an HTTP handler from the service implementation. It -// returns the path on which to mount the handler and the handler itself. -// -// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf -// and JSON codecs. They also support gzip compression. -func NewBackrestSyncStateServiceHandler(svc BackrestSyncStateServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - backrestSyncStateServiceMethods := v1sync.File_v1sync_syncservice_proto.Services().ByName("BackrestSyncStateService").Methods() - backrestSyncStateServiceGetPeerSyncStatesStreamHandler := connect.NewServerStreamHandler( - BackrestSyncStateServiceGetPeerSyncStatesStreamProcedure, - svc.GetPeerSyncStatesStream, - connect.WithSchema(backrestSyncStateServiceMethods.ByName("GetPeerSyncStatesStream")), - connect.WithHandlerOptions(opts...), - ) - return "/v1sync.BackrestSyncStateService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case BackrestSyncStateServiceGetPeerSyncStatesStreamProcedure: - backrestSyncStateServiceGetPeerSyncStatesStreamHandler.ServeHTTP(w, r) - default: - http.NotFound(w, r) - } - }) -} - -// UnimplementedBackrestSyncStateServiceHandler returns CodeUnimplemented from all methods. -type UnimplementedBackrestSyncStateServiceHandler struct{} - -func (UnimplementedBackrestSyncStateServiceHandler) GetPeerSyncStatesStream(context.Context, *connect.Request[v1sync.SyncStateStreamRequest], *connect.ServerStream[v1sync.PeerState]) error { - return connect.NewError(connect.CodeUnimplemented, errors.New("v1sync.BackrestSyncStateService.GetPeerSyncStatesStream is not implemented")) -} diff --git a/proto/update.sh b/proto/update.sh deleted file mode 100755 index a061fe7b8..000000000 --- a/proto/update.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -buf generate diff --git a/webui/gen/ts/v1sync/syncservice_pb.ts b/webui/gen/ts/v1sync/syncservice_pb.ts deleted file mode 100644 index 532d75f8c..000000000 --- a/webui/gen/ts/v1sync/syncservice_pb.ts +++ /dev/null @@ -1,863 +0,0 @@ -// @generated by protoc-gen-es v2.10.0 with parameter "target=ts" -// @generated from file v1sync/syncservice.proto (package v1sync, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Plan, Repo } from "../v1/config_pb"; -import { file_v1_config } from "../v1/config_pb"; -import type { PublicKey, SignedMessage } from "../v1/crypto_pb"; -import { file_v1_crypto } from "../v1/crypto_pb"; -import { file_v1_restic } from "../v1/restic_pb"; -import { file_v1_service } from "../v1/service_pb"; -import type { OperationEvent } from "../v1/operations_pb"; -import { file_v1_operations } from "../v1/operations_pb"; -import { file_types_value } from "../types/value_pb"; -import { file_google_protobuf_any, file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; -import { file_google_api_annotations } from "../google/api/annotations_pb"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file v1sync/syncservice.proto. - */ -export const file_v1sync_syncservice: GenFile = /*@__PURE__*/ - fileDesc("Chh2MXN5bmMvc3luY3NlcnZpY2UucHJvdG8SBnYxc3luYyIrChZTeW5jU3RhdGVTdHJlYW1SZXF1ZXN0EhEKCXN1YnNjcmliZRgBIAEoCCKbAgoJUGVlclN0YXRlEhgKEHBlZXJfaW5zdGFuY2VfaWQYASABKAkSEgoKcGVlcl9rZXlpZBgCIAEoCRImCgVzdGF0ZRgDIAEoDjIXLnYxc3luYy5Db25uZWN0aW9uU3RhdGUSFgoOc3RhdHVzX21lc3NhZ2UYBCABKAkSKQoLa25vd25fcGxhbnMYBSADKAsyFC52MXN5bmMuUGxhbk1ldGFkYXRhEikKC2tub3duX3JlcG9zGAYgAygLMhQudjFzeW5jLlJlcG9NZXRhZGF0YRIrCg1yZW1vdGVfY29uZmlnGAcgASgLMhQudjFzeW5jLlJlbW90ZUNvbmZpZxIdChVsYXN0X2hlYXJ0YmVhdF9taWxsaXMYCCABKAMiPQoTQXV0aGVudGljYXRlUmVxdWVzdBImCgtpbnN0YW5jZV9pZBgBIAEoCzIRLnYxLlNpZ25lZE1lc3NhZ2UiPgocR2V0T3BlcmF0aW9uTWV0YWRhdGFSZXNwb25zZRIOCgZvcF9pZHMYASADKAMSDgoGbW9kbm9zGAIgAygDIl0KDExvZ0RhdGFFbnRyeRIOCgZsb2dfaWQYASABKAkSEgoKb3duZXJfb3BpZBgCIAEoAxIaChJleHBpcmF0aW9uX3RzX3VuaXgYAyABKAMSDQoFY2h1bmsYBCABKAwiaAocU2V0QXZhaWxhYmxlUmVzb3VyY2VzUmVxdWVzdBIjCgVyZXBvcxgBIAMoCzIULnYxc3luYy5QbGFuTWV0YWRhdGESIwoFcGxhbnMYAiADKAsyFC52MXN5bmMuUmVwb01ldGFkYXRhIigKDFJlcG9NZXRhZGF0YRIKCgJpZBgBIAEoCRIMCgRndWlkGAIgASgJIhoKDFBsYW5NZXRhZGF0YRIKCgJpZBgBIAEoCSJ2ChBTZXRDb25maWdSZXF1ZXN0EhcKBXBsYW5zGAEgAygLMggudjEuUGxhbhIXCgVyZXBvcxgCIAMoCzIILnYxLlJlcG8SFwoPcmVwb3NfdG9fZGVsZXRlGAMgAygJEhcKD3BsYW5zX3RvX2RlbGV0ZRgEIAMoCSJgCgxSZW1vdGVDb25maWcSDQoFbW9kbm8YASABKAUSDwoHdmVyc2lvbhgCIAEoBRIXCgVyZXBvcxgDIAMoCzIILnYxLlJlcG8SFwoFcGxhbnMYBCADKAsyCC52MS5QbGFuIl8KEkF1dGhvcml6YXRpb25Ub2tlbhIhCgpwdWJsaWNfa2V5GAEgASgLMg0udjEuUHVibGljS2V5EiYKC2luc3RhbmNlX2lkGAIgASgLMhEudjEuU2lnbmVkTWVzc2FnZSK1DwoOU3luY1N0cmVhbUl0ZW0SKwoOc2lnbmVkX21lc3NhZ2UYASABKAsyES52MS5TaWduZWRNZXNzYWdlSAASPwoJaGFuZHNoYWtlGAMgASgLMioudjFzeW5jLlN5bmNTdHJlYW1JdGVtLlN5bmNBY3Rpb25IYW5kc2hha2VIABI/CgloZWFydGJlYXQYBCABKAsyKi52MXN5bmMuU3luY1N0cmVhbUl0ZW0uU3luY0FjdGlvbkhlYXJ0YmVhdEgAElAKEnJlcXVlc3Rfb3BlcmF0aW9ucxgUIAEoCzIyLnYxc3luYy5TeW5jU3RyZWFtSXRlbS5TeW5jQWN0aW9uUmVxdWVzdE9wZXJhdGlvbnNIABJQChJyZWNlaXZlX29wZXJhdGlvbnMYFSABKAsyMi52MXN5bmMuU3luY1N0cmVhbUl0ZW0uU3luY0FjdGlvblJlY2VpdmVPcGVyYXRpb25zSAASSAoOcmVjZWl2ZV9jb25maWcYFiABKAsyLi52MXN5bmMuU3luY1N0cmVhbUl0ZW0uU3luY0FjdGlvblJlY2VpdmVDb25maWdIABJACgpzZXRfY29uZmlnGBggASgLMioudjFzeW5jLlN5bmNTdHJlYW1JdGVtLlN5bmNBY3Rpb25TZXRDb25maWdIABJOChFyZXF1ZXN0X3Jlc291cmNlcxgZIAEoCzIxLnYxc3luYy5TeW5jU3RyZWFtSXRlbS5TeW5jQWN0aW9uUmVxdWVzdFJlc291cmNlc0gAEk4KEXJlY2VpdmVfcmVzb3VyY2VzGBogASgLMjEudjFzeW5jLlN5bmNTdHJlYW1JdGVtLlN5bmNBY3Rpb25SZWNlaXZlUmVzb3VyY2VzSAASQgoLcmVxdWVzdF9sb2cYHiABKAsyKy52MXN5bmMuU3luY1N0cmVhbUl0ZW0uU3luY0FjdGlvblJlcXVlc3RMb2dIABJLChByZWNlaXZlX2xvZ19kYXRhGB8gASgLMi8udjFzeW5jLlN5bmNTdHJlYW1JdGVtLlN5bmNBY3Rpb25SZWNlaXZlTG9nRGF0YUgAEj4KCHRocm90dGxlGOgHIAEoCzIpLnYxc3luYy5TeW5jU3RyZWFtSXRlbS5TeW5jQWN0aW9uVGhyb3R0bGVIABp6ChNTeW5jQWN0aW9uSGFuZHNoYWtlEhgKEHByb3RvY29sX3ZlcnNpb24YASABKAMSIQoKcHVibGljX2tleRgCIAEoCzINLnYxLlB1YmxpY0tleRImCgtpbnN0YW5jZV9pZBgDIAEoCzIRLnYxLlNpZ25lZE1lc3NhZ2UaFQoTU3luY0FjdGlvbkhlYXJ0YmVhdBo/ChdTeW5jQWN0aW9uUmVjZWl2ZUNvbmZpZxIkCgZjb25maWcYASABKAsyFC52MXN5bmMuUmVtb3RlQ29uZmlnGnkKE1N5bmNBY3Rpb25TZXRDb25maWcSFwoFcmVwb3MYASADKAsyCC52MS5SZXBvEhcKBXBsYW5zGAIgAygLMggudjEuUGxhbhIXCg9yZXBvc190b19kZWxldGUYAyADKAkSFwoPcGxhbnNfdG9fZGVsZXRlGAQgAygJGhwKGlN5bmNBY3Rpb25SZXF1ZXN0UmVzb3VyY2VzGmYKGlN5bmNBY3Rpb25SZWNlaXZlUmVzb3VyY2VzEiMKBXJlcG9zGAEgAygLMhQudjFzeW5jLlJlcG9NZXRhZGF0YRIjCgVwbGFucxgCIAMoCzIULnYxc3luYy5QbGFuTWV0YWRhdGEaKAoVU3luY0FjdGlvbkNvbm5lY3RSZXBvEg8KB3JlcG9faWQYASABKAkaRAobU3luY0FjdGlvblJlcXVlc3RPcGVyYXRpb25zEhEKCWhpZ2hfb3BpZBgBIAEoAxISCgpoaWdoX21vZG5vGAIgASgDGkAKG1N5bmNBY3Rpb25SZWNlaXZlT3BlcmF0aW9ucxIhCgVldmVudBgBIAEoCzISLnYxLk9wZXJhdGlvbkV2ZW50GiYKFFN5bmNBY3Rpb25SZXF1ZXN0TG9nEg4KBmxvZ19pZBgBIAEoCRqAAQoYU3luY0FjdGlvblJlY2VpdmVMb2dEYXRhEg4KBmxvZ19pZBgBIAEoCRISCgpvd25lcl9vcGlkGAIgASgDEhoKEmV4cGlyYXRpb25fdHNfdW5peBgDIAEoAxINCgVjaHVuaxgEIAEoDBIVCg1lcnJvcl9tZXNzYWdlGAUgASgJGiYKElN5bmNBY3Rpb25UaHJvdHRsZRIQCghkZWxheV9tcxgBIAEoAxo4ChlTeW5jRXN0YWJsaXNoU2hhcmVkU2VjcmV0EhsKB2VkMjU1MTkYAiABKAlSCmVkMjU1MTlwdWIitAEKE1JlcG9Db25uZWN0aW9uU3RhdGUSHAoYQ09OTkVDVElPTl9TVEFURV9VTktOT1dOEAASHAoYQ09OTkVDVElPTl9TVEFURV9QRU5ESU5HEAESHgoaQ09OTkVDVElPTl9TVEFURV9DT05ORUNURUQQAhIhCh1DT05ORUNUSU9OX1NUQVRFX1VOQVVUSE9SSVpFRBADEh4KGkNPTk5FQ1RJT05fU1RBVEVfTk9UX0ZPVU5EEARCCAoGYWN0aW9uKpwCCg9Db25uZWN0aW9uU3RhdGUSHAoYQ09OTkVDVElPTl9TVEFURV9VTktOT1dOEAASHAoYQ09OTkVDVElPTl9TVEFURV9QRU5ESU5HEAESHgoaQ09OTkVDVElPTl9TVEFURV9DT05ORUNURUQQAhIhCh1DT05ORUNUSU9OX1NUQVRFX0RJU0NPTk5FQ1RFRBADEh8KG0NPTk5FQ1RJT05fU1RBVEVfUkVUUllfV0FJVBAEEh8KG0NPTk5FQ1RJT05fU1RBVEVfRVJST1JfQVVUSBAKEiMKH0NPTk5FQ1RJT05fU1RBVEVfRVJST1JfUFJPVE9DT0wQCxIjCh9DT05ORUNUSU9OX1NUQVRFX0VSUk9SX0lOVEVSTkFMEAwyUwoTQmFja3Jlc3RTeW5jU2VydmljZRI8CgRTeW5jEhYudjFzeW5jLlN5bmNTdHJlYW1JdGVtGhYudjFzeW5jLlN5bmNTdHJlYW1JdGVtIgAoATABMmwKGEJhY2tyZXN0U3luY1N0YXRlU2VydmljZRJQChdHZXRQZWVyU3luY1N0YXRlc1N0cmVhbRIeLnYxc3luYy5TeW5jU3RhdGVTdHJlYW1SZXF1ZXN0GhEudjFzeW5jLlBlZXJTdGF0ZSIAMAFCMFouZ2l0aHViLmNvbS9nYXJldGhnZW9yZ2UvYmFja3Jlc3QvZ2VuL2dvL3Yxc3luY2IGcHJvdG8z", [file_v1_config, file_v1_crypto, file_v1_restic, file_v1_service, file_v1_operations, file_types_value, file_google_protobuf_empty, file_google_api_annotations, file_google_protobuf_any]); - -/** - * @generated from message v1sync.SyncStateStreamRequest - */ -export type SyncStateStreamRequest = Message<"v1sync.SyncStateStreamRequest"> & { - /** - * If true, the stream will continue to send updates until cancelled. - * - * @generated from field: bool subscribe = 1; - */ - subscribe: boolean; -}; - -/** - * Describes the message v1sync.SyncStateStreamRequest. - * Use `create(SyncStateStreamRequestSchema)` to create a new message. - */ -export const SyncStateStreamRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 0); - -/** - * @generated from message v1sync.PeerState - */ -export type PeerState = Message<"v1sync.PeerState"> & { - /** - * @generated from field: string peer_instance_id = 1; - */ - peerInstanceId: string; - - /** - * @generated from field: string peer_keyid = 2; - */ - peerKeyid: string; - - /** - * @generated from field: v1sync.ConnectionState state = 3; - */ - state: ConnectionState; - - /** - * @generated from field: string status_message = 4; - */ - statusMessage: string; - - /** - * List of plan IDs that the peer has. - * - * @generated from field: repeated v1sync.PlanMetadata known_plans = 5; - */ - knownPlans: PlanMetadata[]; - - /** - * List of repo IDs that the peer has. - * - * @generated from field: repeated v1sync.RepoMetadata known_repos = 6; - */ - knownRepos: RepoMetadata[]; - - /** - * The remote config of the peer, if available. - * - * @generated from field: v1sync.RemoteConfig remote_config = 7; - */ - remoteConfig?: RemoteConfig; - - /** - * The last time the peer sent a heartbeat, in milliseconds since epoch. - * - * @generated from field: int64 last_heartbeat_millis = 8; - */ - lastHeartbeatMillis: bigint; -}; - -/** - * Describes the message v1sync.PeerState. - * Use `create(PeerStateSchema)` to create a new message. - */ -export const PeerStateSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 1); - -/** - * @generated from message v1sync.AuthenticateRequest - */ -export type AuthenticateRequest = Message<"v1sync.AuthenticateRequest"> & { - /** - * The ID of the peer instance. - * - * @generated from field: v1.SignedMessage instance_id = 1; - */ - instanceId?: SignedMessage; -}; - -/** - * Describes the message v1sync.AuthenticateRequest. - * Use `create(AuthenticateRequestSchema)` to create a new message. - */ -export const AuthenticateRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 2); - -/** - * @generated from message v1sync.GetOperationMetadataResponse - */ -export type GetOperationMetadataResponse = Message<"v1sync.GetOperationMetadataResponse"> & { - /** - * The IDs of the operations. - * - * @generated from field: repeated int64 op_ids = 1; - */ - opIds: bigint[]; - - /** - * The modnos of the operations. - * - * @generated from field: repeated int64 modnos = 2; - */ - modnos: bigint[]; -}; - -/** - * Describes the message v1sync.GetOperationMetadataResponse. - * Use `create(GetOperationMetadataResponseSchema)` to create a new message. - */ -export const GetOperationMetadataResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 3); - -/** - * @generated from message v1sync.LogDataEntry - */ -export type LogDataEntry = Message<"v1sync.LogDataEntry"> & { - /** - * The ID of the log, only used for the first message in a log data stream. - * - * @generated from field: string log_id = 1; - */ - logId: string; - - /** - * The operation ID of the operation that owns this log data. - * - * @generated from field: int64 owner_opid = 2; - */ - ownerOpid: bigint; - - /** - * Unix timestamp in seconds when the log data expires. - * - * @generated from field: int64 expiration_ts_unix = 3; - */ - expirationTsUnix: bigint; - - /** - * The log data chunk, can be sent repeatedly, must be terminated by a packet with size = 0. - * - * @generated from field: bytes chunk = 4; - */ - chunk: Uint8Array; -}; - -/** - * Describes the message v1sync.LogDataEntry. - * Use `create(LogDataEntrySchema)` to create a new message. - */ -export const LogDataEntrySchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 4); - -/** - * @generated from message v1sync.SetAvailableResourcesRequest - */ -export type SetAvailableResourcesRequest = Message<"v1sync.SetAvailableResourcesRequest"> & { - /** - * The repos that are available. - * - * @generated from field: repeated v1sync.PlanMetadata repos = 1; - */ - repos: PlanMetadata[]; - - /** - * The plans that are available. - * - * @generated from field: repeated v1sync.RepoMetadata plans = 2; - */ - plans: RepoMetadata[]; -}; - -/** - * Describes the message v1sync.SetAvailableResourcesRequest. - * Use `create(SetAvailableResourcesRequestSchema)` to create a new message. - */ -export const SetAvailableResourcesRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 5); - -/** - * @generated from message v1sync.RepoMetadata - */ -export type RepoMetadata = Message<"v1sync.RepoMetadata"> & { - /** - * @generated from field: string id = 1; - */ - id: string; - - /** - * @generated from field: string guid = 2; - */ - guid: string; -}; - -/** - * Describes the message v1sync.RepoMetadata. - * Use `create(RepoMetadataSchema)` to create a new message. - */ -export const RepoMetadataSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 6); - -/** - * @generated from message v1sync.PlanMetadata - */ -export type PlanMetadata = Message<"v1sync.PlanMetadata"> & { - /** - * @generated from field: string id = 1; - */ - id: string; -}; - -/** - * Describes the message v1sync.PlanMetadata. - * Use `create(PlanMetadataSchema)` to create a new message. - */ -export const PlanMetadataSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 7); - -/** - * @generated from message v1sync.SetConfigRequest - */ -export type SetConfigRequest = Message<"v1sync.SetConfigRequest"> & { - /** - * The plans to set. - * - * @generated from field: repeated v1.Plan plans = 1; - */ - plans: Plan[]; - - /** - * The repos to set. - * - * @generated from field: repeated v1.Repo repos = 2; - */ - repos: Repo[]; - - /** - * The repo IDs to delete. - * - * @generated from field: repeated string repos_to_delete = 3; - */ - reposToDelete: string[]; - - /** - * The plan IDs to delete. - * - * @generated from field: repeated string plans_to_delete = 4; - */ - plansToDelete: string[]; -}; - -/** - * Describes the message v1sync.SetConfigRequest. - * Use `create(SetConfigRequestSchema)` to create a new message. - */ -export const SetConfigRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 8); - -/** - * @generated from message v1sync.RemoteConfig - */ -export type RemoteConfig = Message<"v1sync.RemoteConfig"> & { - /** - * The modno of the config. - * - * @generated from field: int32 modno = 1; - */ - modno: number; - - /** - * The storage version of the config. - * - * @generated from field: int32 version = 2; - */ - version: number; - - /** - * @generated from field: repeated v1.Repo repos = 3; - */ - repos: Repo[]; - - /** - * @generated from field: repeated v1.Plan plans = 4; - */ - plans: Plan[]; -}; - -/** - * Describes the message v1sync.RemoteConfig. - * Use `create(RemoteConfigSchema)` to create a new message. - */ -export const RemoteConfigSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 9); - -/** - * @generated from message v1sync.AuthorizationToken - */ -export type AuthorizationToken = Message<"v1sync.AuthorizationToken"> & { - /** - * @generated from field: v1.PublicKey public_key = 1; - */ - publicKey?: PublicKey; - - /** - * The ID of the peer instance. - * - * @generated from field: v1.SignedMessage instance_id = 2; - */ - instanceId?: SignedMessage; -}; - -/** - * Describes the message v1sync.AuthorizationToken. - * Use `create(AuthorizationTokenSchema)` to create a new message. - */ -export const AuthorizationTokenSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 10); - -/** - * @generated from message v1sync.SyncStreamItem - */ -export type SyncStreamItem = Message<"v1sync.SyncStreamItem"> & { - /** - * @generated from oneof v1sync.SyncStreamItem.action - */ - action: { - /** - * @generated from field: v1.SignedMessage signed_message = 1; - */ - value: SignedMessage; - case: "signedMessage"; - } | { - /** - * note: mostly deprecated, sent through headers rather than stream. - * - * @generated from field: v1sync.SyncStreamItem.SyncActionHandshake handshake = 3; - */ - value: SyncStreamItem_SyncActionHandshake; - case: "handshake"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionHeartbeat heartbeat = 4; - */ - value: SyncStreamItem_SyncActionHeartbeat; - case: "heartbeat"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionRequestOperations request_operations = 20; - */ - value: SyncStreamItem_SyncActionRequestOperations; - case: "requestOperations"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionReceiveOperations receive_operations = 21; - */ - value: SyncStreamItem_SyncActionReceiveOperations; - case: "receiveOperations"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionReceiveConfig receive_config = 22; - */ - value: SyncStreamItem_SyncActionReceiveConfig; - case: "receiveConfig"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionSetConfig set_config = 24; - */ - value: SyncStreamItem_SyncActionSetConfig; - case: "setConfig"; - } | { - /** - * request a list of available resources. Only used by the server. - * - * @generated from field: v1sync.SyncStreamItem.SyncActionRequestResources request_resources = 25; - */ - value: SyncStreamItem_SyncActionRequestResources; - case: "requestResources"; - } | { - /** - * receiving a list of available resources. - * - * @generated from field: v1sync.SyncStreamItem.SyncActionReceiveResources receive_resources = 26; - */ - value: SyncStreamItem_SyncActionReceiveResources; - case: "receiveResources"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionRequestLog request_log = 30; - */ - value: SyncStreamItem_SyncActionRequestLog; - case: "requestLog"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionReceiveLogData receive_log_data = 31; - */ - value: SyncStreamItem_SyncActionReceiveLogData; - case: "receiveLogData"; - } | { - /** - * @generated from field: v1sync.SyncStreamItem.SyncActionThrottle throttle = 1000; - */ - value: SyncStreamItem_SyncActionThrottle; - case: "throttle"; - } | { case: undefined; value?: undefined }; -}; - -/** - * Describes the message v1sync.SyncStreamItem. - * Use `create(SyncStreamItemSchema)` to create a new message. - */ -export const SyncStreamItemSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionHandshake - */ -export type SyncStreamItem_SyncActionHandshake = Message<"v1sync.SyncStreamItem.SyncActionHandshake"> & { - /** - * @generated from field: int64 protocol_version = 1; - */ - protocolVersion: bigint; - - /** - * @generated from field: v1.PublicKey public_key = 2; - */ - publicKey?: PublicKey; - - /** - * @generated from field: v1.SignedMessage instance_id = 3; - */ - instanceId?: SignedMessage; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionHandshake. - * Use `create(SyncStreamItem_SyncActionHandshakeSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionHandshakeSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 0); - -/** - * SyncActionHeartbeat is sent periodically to keep the connection alive. - * - * @generated from message v1sync.SyncStreamItem.SyncActionHeartbeat - */ -export type SyncStreamItem_SyncActionHeartbeat = Message<"v1sync.SyncStreamItem.SyncActionHeartbeat"> & { -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionHeartbeat. - * Use `create(SyncStreamItem_SyncActionHeartbeatSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionHeartbeatSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 1); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionReceiveConfig - */ -export type SyncStreamItem_SyncActionReceiveConfig = Message<"v1sync.SyncStreamItem.SyncActionReceiveConfig"> & { - /** - * @generated from field: v1sync.RemoteConfig config = 1; - */ - config?: RemoteConfig; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionReceiveConfig. - * Use `create(SyncStreamItem_SyncActionReceiveConfigSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionReceiveConfigSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 2); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionSetConfig - */ -export type SyncStreamItem_SyncActionSetConfig = Message<"v1sync.SyncStreamItem.SyncActionSetConfig"> & { - /** - * @generated from field: repeated v1.Repo repos = 1; - */ - repos: Repo[]; - - /** - * @generated from field: repeated v1.Plan plans = 2; - */ - plans: Plan[]; - - /** - * @generated from field: repeated string repos_to_delete = 3; - */ - reposToDelete: string[]; - - /** - * @generated from field: repeated string plans_to_delete = 4; - */ - plansToDelete: string[]; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionSetConfig. - * Use `create(SyncStreamItem_SyncActionSetConfigSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionSetConfigSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 3); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionRequestResources - */ -export type SyncStreamItem_SyncActionRequestResources = Message<"v1sync.SyncStreamItem.SyncActionRequestResources"> & { -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionRequestResources. - * Use `create(SyncStreamItem_SyncActionRequestResourcesSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionRequestResourcesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 4); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionReceiveResources - */ -export type SyncStreamItem_SyncActionReceiveResources = Message<"v1sync.SyncStreamItem.SyncActionReceiveResources"> & { - /** - * @generated from field: repeated v1sync.RepoMetadata repos = 1; - */ - repos: RepoMetadata[]; - - /** - * @generated from field: repeated v1sync.PlanMetadata plans = 2; - */ - plans: PlanMetadata[]; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionReceiveResources. - * Use `create(SyncStreamItem_SyncActionReceiveResourcesSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionReceiveResourcesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 5); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionConnectRepo - */ -export type SyncStreamItem_SyncActionConnectRepo = Message<"v1sync.SyncStreamItem.SyncActionConnectRepo"> & { - /** - * @generated from field: string repo_id = 1; - */ - repoId: string; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionConnectRepo. - * Use `create(SyncStreamItem_SyncActionConnectRepoSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionConnectRepoSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 6); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionRequestOperations - */ -export type SyncStreamItem_SyncActionRequestOperations = Message<"v1sync.SyncStreamItem.SyncActionRequestOperations"> & { - /** - * The highest operation ID the requester has. - * - * @generated from field: int64 high_opid = 1; - */ - highOpid: bigint; - - /** - * The highest modno the requester has. - * - * @generated from field: int64 high_modno = 2; - */ - highModno: bigint; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionRequestOperations. - * Use `create(SyncStreamItem_SyncActionRequestOperationsSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionRequestOperationsSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 7); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionReceiveOperations - */ -export type SyncStreamItem_SyncActionReceiveOperations = Message<"v1sync.SyncStreamItem.SyncActionReceiveOperations"> & { - /** - * @generated from field: v1.OperationEvent event = 1; - */ - event?: OperationEvent; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionReceiveOperations. - * Use `create(SyncStreamItem_SyncActionReceiveOperationsSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionReceiveOperationsSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 8); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionRequestLog - */ -export type SyncStreamItem_SyncActionRequestLog = Message<"v1sync.SyncStreamItem.SyncActionRequestLog"> & { - /** - * @generated from field: string log_id = 1; - */ - logId: string; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionRequestLog. - * Use `create(SyncStreamItem_SyncActionRequestLogSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionRequestLogSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 9); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionReceiveLogData - */ -export type SyncStreamItem_SyncActionReceiveLogData = Message<"v1sync.SyncStreamItem.SyncActionReceiveLogData"> & { - /** - * @generated from field: string log_id = 1; - */ - logId: string; - - /** - * Required only for first message in a log data stream. - * - * The operation ID of the operation that owns this log data. - * - * @generated from field: int64 owner_opid = 2; - */ - ownerOpid: bigint; - - /** - * Unix timestamp in seconds when the log data expires. - * - * @generated from field: int64 expiration_ts_unix = 3; - */ - expirationTsUnix: bigint; - - /** - * Can be sent repeatedly, must be terminated by a packet with size = 0. - * - * @generated from field: bytes chunk = 4; - */ - chunk: Uint8Array; - - /** - * If set, indicates an error occurred while fetching the log data. - * - * @generated from field: string error_message = 5; - */ - errorMessage: string; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionReceiveLogData. - * Use `create(SyncStreamItem_SyncActionReceiveLogDataSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionReceiveLogDataSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 10); - -/** - * @generated from message v1sync.SyncStreamItem.SyncActionThrottle - */ -export type SyncStreamItem_SyncActionThrottle = Message<"v1sync.SyncStreamItem.SyncActionThrottle"> & { - /** - * @generated from field: int64 delay_ms = 1; - */ - delayMs: bigint; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncActionThrottle. - * Use `create(SyncStreamItem_SyncActionThrottleSchema)` to create a new message. - */ -export const SyncStreamItem_SyncActionThrottleSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 11); - -/** - * @generated from message v1sync.SyncStreamItem.SyncEstablishSharedSecret - */ -export type SyncStreamItem_SyncEstablishSharedSecret = Message<"v1sync.SyncStreamItem.SyncEstablishSharedSecret"> & { - /** - * a one-time-use ed25519 public key with a matching unshared private key. Used to perform a key exchange. - * See https://pkg.go.dev/crypto/ecdh#PrivateKey.ECDH . - * - * base64 encoded public key - * - * @generated from field: string ed25519 = 2 [json_name = "ed25519pub"]; - */ - ed25519: string; -}; - -/** - * Describes the message v1sync.SyncStreamItem.SyncEstablishSharedSecret. - * Use `create(SyncStreamItem_SyncEstablishSharedSecretSchema)` to create a new message. - */ -export const SyncStreamItem_SyncEstablishSharedSecretSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_v1sync_syncservice, 11, 12); - -/** - * @generated from enum v1sync.SyncStreamItem.RepoConnectionState - */ -export enum SyncStreamItem_RepoConnectionState { - /** - * @generated from enum value: CONNECTION_STATE_UNKNOWN = 0; - */ - CONNECTION_STATE_UNKNOWN = 0, - - /** - * queried, response not yet received. - * - * @generated from enum value: CONNECTION_STATE_PENDING = 1; - */ - CONNECTION_STATE_PENDING = 1, - - /** - * @generated from enum value: CONNECTION_STATE_CONNECTED = 2; - */ - CONNECTION_STATE_CONNECTED = 2, - - /** - * @generated from enum value: CONNECTION_STATE_UNAUTHORIZED = 3; - */ - CONNECTION_STATE_UNAUTHORIZED = 3, - - /** - * @generated from enum value: CONNECTION_STATE_NOT_FOUND = 4; - */ - CONNECTION_STATE_NOT_FOUND = 4, -} - -/** - * Describes the enum v1sync.SyncStreamItem.RepoConnectionState. - */ -export const SyncStreamItem_RepoConnectionStateSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_v1sync_syncservice, 11, 0); - -/** - * @generated from enum v1sync.ConnectionState - */ -export enum ConnectionState { - /** - * @generated from enum value: CONNECTION_STATE_UNKNOWN = 0; - */ - UNKNOWN = 0, - - /** - * @generated from enum value: CONNECTION_STATE_PENDING = 1; - */ - PENDING = 1, - - /** - * @generated from enum value: CONNECTION_STATE_CONNECTED = 2; - */ - CONNECTED = 2, - - /** - * @generated from enum value: CONNECTION_STATE_DISCONNECTED = 3; - */ - DISCONNECTED = 3, - - /** - * @generated from enum value: CONNECTION_STATE_RETRY_WAIT = 4; - */ - RETRY_WAIT = 4, - - /** - * @generated from enum value: CONNECTION_STATE_ERROR_AUTH = 10; - */ - ERROR_AUTH = 10, - - /** - * @generated from enum value: CONNECTION_STATE_ERROR_PROTOCOL = 11; - */ - ERROR_PROTOCOL = 11, - - /** - * @generated from enum value: CONNECTION_STATE_ERROR_INTERNAL = 12; - */ - ERROR_INTERNAL = 12, -} - -/** - * Describes the enum v1sync.ConnectionState. - */ -export const ConnectionStateSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_v1sync_syncservice, 0); - -/** - * BackrestSyncService provides methods to sync data between backrest instances. - * This service provides its own authentication and authorization. - * - * @generated from service v1sync.BackrestSyncService - */ -export const BackrestSyncService: GenService<{ - /** - * @generated from rpc v1sync.BackrestSyncService.Sync - */ - sync: { - methodKind: "bidi_streaming"; - input: typeof SyncStreamItemSchema; - output: typeof SyncStreamItemSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_v1sync_syncservice, 0); - -/** - * BackrestSyncStateService provides methods to query the sync state of known hosts and clients. - * This service should be served behind authentication and authorization. - * - * @generated from service v1sync.BackrestSyncStateService - */ -export const BackrestSyncStateService: GenService<{ - /** - * @generated from rpc v1sync.BackrestSyncStateService.GetPeerSyncStatesStream - */ - getPeerSyncStatesStream: { - methodKind: "server_streaming"; - input: typeof SyncStateStreamRequestSchema; - output: typeof PeerStateSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_v1sync_syncservice, 1); -