diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfcaa52..89d6101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,35 +8,35 @@ on: pull_request: jobs: - docker-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build . --file Dockerfile - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.14 - - name: Cache Go modules - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Run GoReleaser (Dry Run) - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist --snapshot --skip-publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + #docker-build: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - name: Build the Docker image + # run: docker build . --file Dockerfile + #goreleaser: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@master + # - name: Set up Go + # uses: actions/setup-go@v2 + # with: + # go-version: 1.14 + # - name: Cache Go modules + # uses: actions/cache@v1 + # with: + # path: ~/go/pkg/mod + # key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + # restore-keys: | + # ${{ runner.os }}-go- + # - name: Run GoReleaser (Dry Run) + # uses: goreleaser/goreleaser-action@v2 + # with: + # version: latest + # args: release --rm-dist --snapshot --skip-publish + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} golangci-lint: runs-on: ubuntu-latest steps: @@ -49,70 +49,70 @@ jobs: args: --timeout=2m only-new-issues: false working-directory: . - tests-on-windows: - needs: golangci-lint # run after golangci-lint action to not produce duplicated errors - runs-on: windows-latest - strategy: - matrix: - golang: - #- 1.13 - - 1.14 - steps: - - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.golang }} - - name: Run tests on Windows - run: make.exe unittest - continue-on-error: true - tests-on-mac: - needs: golangci-lint # run after golangci-lint action to not produce duplicated errors - runs-on: macos-latest - strategy: - matrix: - golang: - - 1.14 - env: - OS: macos-latest - GOLANG: ${{ matrix.golang }} - steps: - - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.golang }} - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.golang }}- - - name: Run tests on Unix-like operating systems - run: make unittest - - name: Check go.mod - run: | - go mod tidy -v - git --no-pager diff go.mod go.sum - git --no-pager diff --quiet go.mod go.sum - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - #token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.txt - flags: unittests - env_vars: OS,GOLANG - name: codecov-umbrella - fail_ci_if_error: true + #tests-on-windows: + # needs: golangci-lint # run after golangci-lint action to not produce duplicated errors + # runs-on: windows-latest + # strategy: + # matrix: + # golang: + # #- 1.13 + # - 1.14 + # steps: + # - uses: actions/checkout@v2 + # - name: Install Go + # uses: actions/setup-go@v2 + # with: + # go-version: ${{ matrix.golang }} + # - name: Run tests on Windows + # run: make.exe unittest + # continue-on-error: true + #tests-on-mac: + # needs: golangci-lint # run after golangci-lint action to not produce duplicated errors + # runs-on: macos-latest + # strategy: + # matrix: + # golang: + # - 1.14 + # env: + # OS: macos-latest + # GOLANG: ${{ matrix.golang }} + # steps: + # - uses: actions/checkout@v2 + # - name: Install Go + # uses: actions/setup-go@v2 + # with: + # go-version: ${{ matrix.golang }} + # - uses: actions/cache@v1 + # with: + # path: ~/go/pkg/mod + # key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }} + # restore-keys: | + # ${{ runner.os }}-go-${{ matrix.golang }}- + # - name: Run tests on Unix-like operating systems + # run: make unittest + # - name: Check go.mod + # run: | + # go mod tidy -v + # git --no-pager diff go.mod go.sum + # git --no-pager diff --quiet go.mod go.sum + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v1 + # with: + # #token: ${{ secrets.CODECOV_TOKEN }} + # file: ./coverage.txt + # flags: unittests + # env_vars: OS,GOLANG + # name: codecov-umbrella + # fail_ci_if_error: true tests-on-linux: - needs: golangci-lint # run after golangci-lint action to not produce duplicated errors + #needs: golangci-lint # run after golangci-lint action to not produce duplicated errors runs-on: ubuntu-latest strategy: matrix: golang: - - 1.11 - - 1.12 - - 1.13 + #- 1.11 + #- 1.12 + #- 1.13 - 1.14 env: OS: ubuntu-latest @@ -134,7 +134,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: - #token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.txt flags: unittests env_vars: OS,GOLANG diff --git a/.golangci.yml b/.golangci.yml index df63494..23a1e3c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,7 +26,7 @@ linters: - dogsled - dupl - errcheck - - funlen + #- funlen - gochecknoinits #- gocognit - goconst @@ -39,7 +39,7 @@ linters: - govet - ineffassign - interfacer - - maligned + #- maligned - misspell - nakedret - prealloc diff --git a/.goreleaser.yml b/.goreleaser.yml index edc8448..96e32b8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,6 +17,7 @@ builds: - amd64 - arm - arm64 + main: ./cmd/sgtm/main.go ignore: - goos: darwin @@ -51,20 +52,20 @@ archives: wrap_in_directory: true brews: - - name: bounce + name: sgtm # github: # owner: moul # name: homebrew-moul commit_author: name: moul-bot email: "bot@moul.io" - homepage: https://github.com/moul/bounce - description: "bounce" + homepage: https://github.com/moul/sgtm + description: "sgtm" nfpms: - file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - homepage: https://github.com/moul/bounce - description: "bounce" + homepage: https://github.com/moul/sgtm + description: "sgtm" maintainer: "Manfred Touron " license: "Apache-2.0 OR MIT" vendor: moul diff --git a/COPYRIGHT b/COPYRIGHT index 28a228b..d6a2151 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,16 +1,16 @@ -Copyright 2020 Manfred Touron and other bounce Developers. +Copyright 2020 Manfred Touron and other sgtm Developers. Intellectual Property Notice ---------------------------- -bounce is licensed under the Apache License, Version 2.0 +sgtm is licensed under the Apache License, Version 2.0 (see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or the MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT), at your option. -Copyrights and patents in the bounces project are retained +Copyrights and patents in the sgtms project are retained by contributors. -No copyright assignment is required to contribute to bounce. +No copyright assignment is required to contribute to sgtm. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/Dockerfile b/Dockerfile index a5cf8ae..2da422b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM golang:1.14-alpine as builder RUN apk add --no-cache git gcc musl-dev make RUN go get -u github.com/gobuffalo/packr/v2/packr2 ENV GO111MODULE=on -WORKDIR /go/src/moul.io/bounce +WORKDIR /go/src/moul.io/sgtm COPY go.* ./ RUN go mod download COPY . ./ @@ -18,16 +18,16 @@ RUN make install # minimalist runtime FROM alpine:3.12 LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="bounce" \ + org.label-schema.name="sgtm" \ org.label-schema.description="" \ - org.label-schema.url="https://moul.io/bounce/" \ + org.label-schema.url="https://moul.io/sgtm/" \ org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/moul/bounce" \ + org.label-schema.vcs-url="https://github.com/moul/sgtm" \ org.label-schema.vendor="Manfred Touron" \ org.label-schema.version=$VERSION \ org.label-schema.schema-version="1.0" \ - org.label-schema.cmd="docker run -i -t --rm moul/bounce" \ - org.label-schema.help="docker exec -it $CONTAINER bounce --help" -COPY --from=builder /go/bin/bounce /bin/ -ENTRYPOINT ["/bin/bounce"] + org.label-schema.cmd="docker run -i -t --rm moul/sgtm" \ + org.label-schema.help="docker exec -it $CONTAINER sgtm --help" +COPY --from=builder /go/bin/sgtm /bin/ +ENTRYPOINT ["/bin/sgtm"] #CMD [] diff --git a/Makefile b/Makefile index 7e56600..960840e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -GOPKG ?= moul.io/bounce -DOCKER_IMAGE ?= moul/bounce -GOBINS ?= ./cmd/bounce +GOPKG ?= moul.io/sgtm +DOCKER_IMAGE ?= moul/sgtm +GOBINS ?= ./cmd/sgtm PRE_INSTALL_STEPS += gen.sum PRE_UNITTEST_STEPS += gen.sum @@ -15,15 +15,15 @@ include rules.mk .PHONY: run run: install - bounce --dev-mode --enable-server --enable-discord run + sgtm --dev-mode --enable-server --enable-discord run .PHONY: run-discord run-discord: install - bounce --dev-mode --enable-discord run + sgtm --dev-mode --enable-discord run .PHONY: run-server run-server: install - bounce --dev-mode --enable-server run + sgtm --dev-mode --enable-server run .PHONY: packr packr: @@ -32,11 +32,11 @@ packr: .PHONY: deploy deploy: docker.push - ssh zrwf.m.42.am make -C infra/projects/bounce.place re + ssh zrwf.m.42.am make -C infra/projects/sgtm.place re .PHONY: prod-logs prod-logs: - ssh zrwf.m.42.am make -C infra/projects/bounce.place logs + ssh zrwf.m.42.am make -C infra/projects/sgtm.place logs .PHONY: docker.push docker.push: tidy generate docker.build @@ -53,8 +53,8 @@ gen.sum: $(GEN_DEPS) GO111MODULE=on go mod vendor; \ docker run \ --user=`id -u` \ - --volume="$(PWD):/go/src/moul.io/bounce" \ - --workdir="/go/src/moul.io/bounce" \ + --volume="$(PWD):/go/src/moul.io/sgtm" \ + --workdir="/go/src/moul.io/sgtm" \ --entrypoint="sh" \ --rm \ moul/moul-bot-protoc:1 \ diff --git a/README.md b/README.md index 1341771..ca26500 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# bounce - -:smile: bounce - -![CI](https://github.com/moul/bounce/workflows/CI/badge.svg) -[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/moul.io/bounce) -[![License](https://img.shields.io/badge/license-Apache--2.0%20%2F%20MIT-%2397ca00.svg)](https://github.com/moul/bounce/blob/master/COPYRIGHT) -[![GitHub release](https://img.shields.io/github/release/moul/bounce.svg)](https://github.com/moul/bounce/releases) -[![Go Report Card](https://goreportcard.com/badge/moul.io/bounce)](https://goreportcard.com/report/moul.io/bounce) -[![CodeFactor](https://www.codefactor.io/repository/github/moul/bounce/badge)](https://www.codefactor.io/repository/github/moul/bounce) -[![codecov](https://codecov.io/gh/moul/bounce/branch/master/graph/badge.svg)](https://codecov.io/gh/moul/bounce) -[![Docker Metrics](https://images.microbadger.com/badges/image/moul/bounce.svg)](https://microbadger.com/images/moul/bounce) -[![GolangCI](https://golangci.com/badges/github.com/moul/bounce.svg)](https://golangci.com/r/github.com/moul/bounce) +# sgtm + +:smile: sgtm + +![CI](https://github.com/moul/sgtm/workflows/CI/badge.svg) +[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/moul.io/sgtm) +[![License](https://img.shields.io/badge/license-Apache--2.0%20%2F%20MIT-%2397ca00.svg)](https://github.com/moul/sgtm/blob/master/COPYRIGHT) +[![GitHub release](https://img.shields.io/github/release/moul/sgtm.svg)](https://github.com/moul/sgtm/releases) +[![Go Report Card](https://goreportcard.com/badge/moul.io/sgtm)](https://goreportcard.com/report/moul.io/sgtm) +[![CodeFactor](https://www.codefactor.io/repository/github/moul/sgtm/badge)](https://www.codefactor.io/repository/github/moul/sgtm) +[![codecov](https://codecov.io/gh/moul/sgtm/branch/master/graph/badge.svg)](https://codecov.io/gh/moul/sgtm) +[![Docker Metrics](https://images.microbadger.com/badges/image/moul/sgtm.svg)](https://microbadger.com/images/moul/sgtm) +[![GolangCI](https://golangci.com/badges/github.com/moul/sgtm.svg)](https://golangci.com/r/github.com/moul/sgtm) [![Made by Manfred Touron](https://img.shields.io/badge/made%20by-Manfred%20Touron-blue.svg?style=flat)](https://manfred.life/) @@ -23,16 +23,16 @@ TODO ### Using go ```console -$ go get -u moul.io/bounce +$ go get -u moul.io/sgtm ``` ### Releases -See https://github.com/moul/bounce/releases +See https://github.com/moul/sgtm/releases ## Stargazers over time -[![Stargazers over time](https://starchart.cc/moul/bounce.svg)](https://starchart.cc/moul/bounce) +[![Stargazers over time](https://starchart.cc/moul/sgtm.svg)](https://starchart.cc/moul/sgtm) ## License diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 6705984..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,9 +0,0 @@ -# Reporting security issues - -I take security seriously. If you discover a security issue, please bring it to my attention right away! - -### Reporting a Vulnerability - -Please **DO NOT** file a public issue, instead send your report privately to security@moul.io. - -Security reports are greatly appreciated and I will publicly thank you for it, although I keep your name confidential if you request it. diff --git a/api/bounce.proto b/api/sgtm.proto similarity index 87% rename from api/bounce.proto rename to api/sgtm.proto index 36d625e..e2b5107 100644 --- a/api/bounce.proto +++ b/api/sgtm.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package bounce; +package sgtm; -option go_package = "moul.io/bounce/pkg/bouncepb"; +option go_package = "moul.io/sgtm/pkg/sgtmpb"; import "google/api/annotations.proto"; diff --git a/cmd/bounce/main.go b/cmd/sgtm/main.go similarity index 95% rename from cmd/bounce/main.go rename to cmd/sgtm/main.go index fca1606..8bf9b19 100644 --- a/cmd/bounce/main.go +++ b/cmd/sgtm/main.go @@ -13,7 +13,7 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" "go.uber.org/zap" "go.uber.org/zap/zapcore" - "moul.io/bounce/pkg/bounce" + "moul.io/sgtm/pkg/sgtm" "moul.io/srand" ) @@ -24,10 +24,10 @@ func main() { } } -var opts bounce.Opts +var opts sgtm.Opts func app(args []string) error { - opts = bounce.DefaultOpts() + opts = sgtm.DefaultOpts() rootFlags := flag.NewFlagSet("root", flag.ExitOnError) rootFlags.BoolVar(&opts.DevMode, "dev-mode", opts.DevMode, "start in developer mode") /// discord @@ -45,7 +45,7 @@ func app(args []string) error { root := &ffcli.Command{ FlagSet: rootFlags, Options: []ff.Option{ - ff.WithEnvVarPrefix("BOUNCE"), + ff.WithEnvVarPrefix("SGTM"), ff.WithConfigFile("config.txt"), ff.WithConfigFileParser(ff.PlainParser), }, @@ -79,7 +79,7 @@ func runCmd(ctx context.Context, _ []string) error { //opts.Context = ctx // init service - svc := bounce.New(opts) + svc := sgtm.New(opts) defer svc.Close() // start diff --git a/deployments/bounce.place/Makefile b/deployments/sgtm.club/Makefile similarity index 100% rename from deployments/bounce.place/Makefile rename to deployments/sgtm.club/Makefile diff --git a/deployments/bounce.place/config.txt b/deployments/sgtm.club/config.txt similarity index 100% rename from deployments/bounce.place/config.txt rename to deployments/sgtm.club/config.txt diff --git a/deployments/bounce.place/docker-compose.yml b/deployments/sgtm.club/docker-compose.yml similarity index 82% rename from deployments/bounce.place/docker-compose.yml rename to deployments/sgtm.club/docker-compose.yml index 635df96..2138763 100644 --- a/deployments/bounce.place/docker-compose.yml +++ b/deployments/sgtm.club/docker-compose.yml @@ -1,8 +1,8 @@ version: '3.7' services: - bounce: - image: moul/bounce:latest + sgtm: + image: moul/sgtm:latest restart: on-failure volumes: - .:/app @@ -14,7 +14,7 @@ services: ports: - 8000 environment: - - VIRTUAL_HOST=bounce.place + - VIRTUAL_HOST=sgtm.place - VIRTUAL_PORT=8000 networks: - default diff --git a/doc.go b/doc.go deleted file mode 100644 index 0ce998f..0000000 --- a/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright © 2020 Manfred Touron -// SPDX-License-Identifier: Apache-2.0 OR MIT - -// message from the author: -// +--------------------------------------------------------------+ -// | * * * ░░░░░░░░░░░░░░░░░░░░ Hello ░░░░░░░░░░░░░░░░░░░░░░░░░░| -// +--------------------------------------------------------------+ -// | | -// | ++ ______________________________________ | -// | ++++ / \ | -// | ++++ | | | -// | ++++++++++ | Feel free to contribute to this | | -// | +++ | | project or contact me on | | -// | ++ | | manfred.life if you like this | | -// | + -== ==| | project! | | -// | ( <*> <*> | | | -// | | | /| :) | | -// | | _) / | | | -// | | +++ / \______________________________________/ | -// | \ =+ / | -// | \ + | -// | |\++++++ | -// | | ++++ ||// | -// | ___| |___ _||/__ __| -// | / --- \ \| ||| __ _ ___ __ __/ /| -// |/ | | \ \ / / ' \/ _ \/ // / / | -// || | | | | | /_/_/_/\___/\_,_/_/ | -// +--------------------------------------------------------------+ -package main // import "moul.io/bounce" diff --git a/go.mod b/go.mod index ffa84ab..7d7ce49 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module moul.io/bounce +module moul.io/sgtm go 1.14 @@ -28,6 +28,5 @@ require ( gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86 // indirect moul.io/banner v1.0.1 moul.io/godev v1.6.0 - moul.io/motd v1.0.0 moul.io/srand v1.4.0 ) diff --git a/go.sum b/go.sum index c2e9e3f..e52569a 100644 --- a/go.sum +++ b/go.sum @@ -313,7 +313,5 @@ moul.io/banner v1.0.1 h1:+WsemGLhj2pOajw2eR5VYjLhOIqs0XhIRYchzTyMLk0= moul.io/banner v1.0.1/go.mod h1:XwvIGKkhKRKyN1vIdmR5oaKQLIkMhkMqrsHpS94QzAU= moul.io/godev v1.6.0 h1:ms1aI6o9k+PhmMdTR7Aw5iDHPu56xtnmrUgdfLKPspc= moul.io/godev v1.6.0/go.mod h1:5lgSpI1oH7xWpLl2Ew/Nsgk8DiNM6FzN9WV9+lgW8RQ= -moul.io/motd v1.0.0 h1:Trk4fPibDfPJf2iCBSQC8ws7Q02sMwivQdVEFAjCPto= -moul.io/motd v1.0.0/go.mod h1:39rvZ0lC2oRhHDY2VoPyZ8r70VKqeJye3QAxjeLDJso= moul.io/srand v1.4.0 h1:r5ZMiWDN0ni0lTV7KzJR/jx0K7GivJYW5WaXmufgeik= moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc= diff --git a/tools.go b/internal/tools/tools.go similarity index 100% rename from tools.go rename to internal/tools/tools.go diff --git a/main.go b/main.go deleted file mode 100644 index ee798ca..0000000 --- a/main.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - - "moul.io/motd" -) - -func main() { - if err := run(os.Args); err != nil { - log.Fatalf("error: %v", err) - os.Exit(1) - } -} - -func run(args []string) error { - fmt.Print(motd.Default()) - fmt.Println("Hello World!") - return nil -} diff --git a/pkg/bounce/api.go b/pkg/bounce/api.go deleted file mode 100644 index 759d8ac..0000000 --- a/pkg/bounce/api.go +++ /dev/null @@ -1,21 +0,0 @@ -package bounce - -import ( - "context" - "os" - "time" - - "moul.io/bounce/pkg/bouncepb" -) - -func (svc *Service) Ping(context.Context, *bouncepb.Ping_Request) (*bouncepb.Ping_Response, error) { - return &bouncepb.Ping_Response{}, nil -} - -func (svc *Service) Status(context.Context, *bouncepb.Status_Request) (*bouncepb.Status_Response, error) { - hostname, _ := os.Hostname() - return &bouncepb.Status_Response{ - Uptime: int32(time.Since(svc.startedAt).Seconds()), - Hostname: hostname, - }, nil -} diff --git a/pkg/sgtm/api.go b/pkg/sgtm/api.go new file mode 100644 index 0000000..ec2a9ce --- /dev/null +++ b/pkg/sgtm/api.go @@ -0,0 +1,21 @@ +package sgtm + +import ( + "context" + "os" + "time" + + "moul.io/sgtm/pkg/sgtmpb" +) + +func (svc *Service) Ping(context.Context, *sgtmpb.Ping_Request) (*sgtmpb.Ping_Response, error) { + return &sgtmpb.Ping_Response{}, nil +} + +func (svc *Service) Status(context.Context, *sgtmpb.Status_Request) (*sgtmpb.Status_Response, error) { + hostname, _ := os.Hostname() + return &sgtmpb.Status_Response{ + Uptime: int32(time.Since(svc.startedAt).Seconds()), + Hostname: hostname, + }, nil +} diff --git a/pkg/bounce/driver_discord.go b/pkg/sgtm/driver_discord.go similarity index 98% rename from pkg/bounce/driver_discord.go rename to pkg/sgtm/driver_discord.go index 9f2c886..6cc0493 100644 --- a/pkg/bounce/driver_discord.go +++ b/pkg/sgtm/driver_discord.go @@ -1,4 +1,4 @@ -package bounce +package sgtm import ( "fmt" diff --git a/pkg/bounce/driver_server.go b/pkg/sgtm/driver_server.go similarity index 97% rename from pkg/bounce/driver_server.go rename to pkg/sgtm/driver_server.go index 7fe8791..430c684 100644 --- a/pkg/bounce/driver_server.go +++ b/pkg/sgtm/driver_server.go @@ -1,4 +1,4 @@ -package bounce +package sgtm import ( "context" @@ -31,7 +31,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "moul.io/banner" - "moul.io/bounce/pkg/bouncepb" + "moul.io/sgtm/pkg/sgtmpb" ) type serverDriver struct { @@ -153,7 +153,7 @@ func (svc *Service) httpServer() (*http.Server, error) { var gwmux http.Handler = runtimeMux dialOpts := []grpc.DialOption{grpc.WithInsecure()} - err := bouncepb.RegisterWebAPIHandlerFromEndpoint(svc.ctx, runtimeMux, svc.ServerListenerAddr(), dialOpts) + err := sgtmpb.RegisterWebAPIHandlerFromEndpoint(svc.ctx, runtimeMux, svc.ServerListenerAddr(), dialOpts) if err != nil { return nil, err } @@ -231,7 +231,7 @@ func (svc *Service) grpcServer() *grpc.Server { grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(serverStreamOpts...)), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(serverUnaryOpts...)), ) - bouncepb.RegisterWebAPIServer(grpcServer, svc) + sgtmpb.RegisterWebAPIServer(grpcServer, svc) return grpcServer } diff --git a/pkg/bounce/opts.go b/pkg/sgtm/opts.go similarity index 98% rename from pkg/bounce/opts.go rename to pkg/sgtm/opts.go index 69a4be0..9986539 100644 --- a/pkg/bounce/opts.go +++ b/pkg/sgtm/opts.go @@ -1,4 +1,4 @@ -package bounce +package sgtm import ( "context" diff --git a/pkg/bounce/service.go b/pkg/sgtm/service.go similarity index 98% rename from pkg/bounce/service.go rename to pkg/sgtm/service.go index d76368c..fd46a90 100644 --- a/pkg/bounce/service.go +++ b/pkg/sgtm/service.go @@ -1,4 +1,4 @@ -package bounce +package sgtm import ( "context" diff --git a/pkg/sgtmpb/doc.go b/pkg/sgtmpb/doc.go new file mode 100644 index 0000000..0c59b74 --- /dev/null +++ b/pkg/sgtmpb/doc.go @@ -0,0 +1 @@ +package sgtmpb diff --git a/pkg/bouncepb/bounce.pb.go b/pkg/sgtmpb/sgtm.pb.go similarity index 60% rename from pkg/bouncepb/bounce.pb.go rename to pkg/sgtmpb/sgtm.pb.go index 32da6a4..7ae9c1b 100644 --- a/pkg/bouncepb/bounce.pb.go +++ b/pkg/sgtmpb/sgtm.pb.go @@ -2,9 +2,9 @@ // versions: // protoc-gen-go v1.24.0-devel // protoc v3.11.2 -// source: bounce.proto +// source: sgtm.proto -package bouncepb +package sgtmpb import ( reflect "reflect" @@ -36,7 +36,7 @@ type Ping struct { func (x *Ping) Reset() { *x = Ping{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[0] + mi := &file_sgtm_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +49,7 @@ func (x *Ping) String() string { func (*Ping) ProtoMessage() {} func (x *Ping) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[0] + mi := &file_sgtm_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +62,7 @@ func (x *Ping) ProtoReflect() protoreflect.Message { // Deprecated: Use Ping.ProtoReflect.Descriptor instead. func (*Ping) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{0} + return file_sgtm_proto_rawDescGZIP(), []int{0} } type Status struct { @@ -74,7 +74,7 @@ type Status struct { func (x *Status) Reset() { *x = Status{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[1] + mi := &file_sgtm_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -87,7 +87,7 @@ func (x *Status) String() string { func (*Status) ProtoMessage() {} func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[1] + mi := &file_sgtm_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -100,7 +100,7 @@ func (x *Status) ProtoReflect() protoreflect.Message { // Deprecated: Use Status.ProtoReflect.Descriptor instead. func (*Status) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{1} + return file_sgtm_proto_rawDescGZIP(), []int{1} } type Ping_Request struct { @@ -112,7 +112,7 @@ type Ping_Request struct { func (x *Ping_Request) Reset() { *x = Ping_Request{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[2] + mi := &file_sgtm_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -125,7 +125,7 @@ func (x *Ping_Request) String() string { func (*Ping_Request) ProtoMessage() {} func (x *Ping_Request) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[2] + mi := &file_sgtm_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -138,7 +138,7 @@ func (x *Ping_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Ping_Request.ProtoReflect.Descriptor instead. func (*Ping_Request) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{0, 0} + return file_sgtm_proto_rawDescGZIP(), []int{0, 0} } type Ping_Response struct { @@ -150,7 +150,7 @@ type Ping_Response struct { func (x *Ping_Response) Reset() { *x = Ping_Response{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[3] + mi := &file_sgtm_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +163,7 @@ func (x *Ping_Response) String() string { func (*Ping_Response) ProtoMessage() {} func (x *Ping_Response) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[3] + mi := &file_sgtm_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +176,7 @@ func (x *Ping_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Ping_Response.ProtoReflect.Descriptor instead. func (*Ping_Response) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{0, 1} + return file_sgtm_proto_rawDescGZIP(), []int{0, 1} } type Status_Request struct { @@ -188,7 +188,7 @@ type Status_Request struct { func (x *Status_Request) Reset() { *x = Status_Request{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[4] + mi := &file_sgtm_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -201,7 +201,7 @@ func (x *Status_Request) String() string { func (*Status_Request) ProtoMessage() {} func (x *Status_Request) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[4] + mi := &file_sgtm_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -214,7 +214,7 @@ func (x *Status_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Status_Request.ProtoReflect.Descriptor instead. func (*Status_Request) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{1, 0} + return file_sgtm_proto_rawDescGZIP(), []int{1, 0} } type Status_Response struct { @@ -229,7 +229,7 @@ type Status_Response struct { func (x *Status_Response) Reset() { *x = Status_Response{} if protoimpl.UnsafeEnabled { - mi := &file_bounce_proto_msgTypes[5] + mi := &file_sgtm_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -242,7 +242,7 @@ func (x *Status_Response) String() string { func (*Status_Response) ProtoMessage() {} func (x *Status_Response) ProtoReflect() protoreflect.Message { - mi := &file_bounce_proto_msgTypes[5] + mi := &file_sgtm_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -255,7 +255,7 @@ func (x *Status_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Status_Response.ProtoReflect.Descriptor instead. func (*Status_Response) Descriptor() ([]byte, []int) { - return file_bounce_proto_rawDescGZIP(), []int{1, 1} + return file_sgtm_proto_rawDescGZIP(), []int{1, 1} } func (x *Status_Response) GetUptime() int32 { @@ -272,61 +272,60 @@ func (x *Status_Response) GetHostname() string { return "" } -var File_bounce_proto protoreflect.FileDescriptor - -var file_bounce_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x09, 0x0a, 0x07, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x09, 0x0a, - 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xa0, 0x01, 0x0a, 0x06, 0x57, 0x65, 0x62, - 0x41, 0x50, 0x49, 0x12, 0x46, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x2e, 0x62, 0x6f, - 0x75, 0x6e, 0x63, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, - 0x12, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x4e, 0x0a, 0x06, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, - 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x1d, 0x5a, 0x1b, 0x6d, - 0x6f, 0x75, 0x6c, 0x2e, 0x69, 0x6f, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, +var File_sgtm_proto protoreflect.FileDescriptor + +var file_sgtm_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x73, 0x67, 0x74, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x73, 0x67, + 0x74, 0x6d, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x1d, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, + 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x98, 0x01, 0x0a, 0x06, 0x57, 0x65, 0x62, 0x41, 0x50, 0x49, 0x12, + 0x42, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x2e, 0x73, 0x67, 0x74, 0x6d, 0x2e, 0x50, + 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x67, + 0x74, 0x6d, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, + 0x73, 0x67, 0x74, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x67, 0x74, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0x19, 0x5a, 0x17, 0x6d, 0x6f, 0x75, 0x6c, 0x2e, 0x69, 0x6f, 0x2f, 0x73, 0x67, 0x74, 0x6d, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x67, 0x74, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_bounce_proto_rawDescOnce sync.Once - file_bounce_proto_rawDescData = file_bounce_proto_rawDesc + file_sgtm_proto_rawDescOnce sync.Once + file_sgtm_proto_rawDescData = file_sgtm_proto_rawDesc ) -func file_bounce_proto_rawDescGZIP() []byte { - file_bounce_proto_rawDescOnce.Do(func() { - file_bounce_proto_rawDescData = protoimpl.X.CompressGZIP(file_bounce_proto_rawDescData) +func file_sgtm_proto_rawDescGZIP() []byte { + file_sgtm_proto_rawDescOnce.Do(func() { + file_sgtm_proto_rawDescData = protoimpl.X.CompressGZIP(file_sgtm_proto_rawDescData) }) - return file_bounce_proto_rawDescData -} - -var file_bounce_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_bounce_proto_goTypes = []interface{}{ - (*Ping)(nil), // 0: bounce.Ping - (*Status)(nil), // 1: bounce.Status - (*Ping_Request)(nil), // 2: bounce.Ping.Request - (*Ping_Response)(nil), // 3: bounce.Ping.Response - (*Status_Request)(nil), // 4: bounce.Status.Request - (*Status_Response)(nil), // 5: bounce.Status.Response -} -var file_bounce_proto_depIdxs = []int32{ - 2, // 0: bounce.WebAPI.Ping:input_type -> bounce.Ping.Request - 4, // 1: bounce.WebAPI.Status:input_type -> bounce.Status.Request - 3, // 2: bounce.WebAPI.Ping:output_type -> bounce.Ping.Response - 5, // 3: bounce.WebAPI.Status:output_type -> bounce.Status.Response + return file_sgtm_proto_rawDescData +} + +var file_sgtm_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_sgtm_proto_goTypes = []interface{}{ + (*Ping)(nil), // 0: sgtm.Ping + (*Status)(nil), // 1: sgtm.Status + (*Ping_Request)(nil), // 2: sgtm.Ping.Request + (*Ping_Response)(nil), // 3: sgtm.Ping.Response + (*Status_Request)(nil), // 4: sgtm.Status.Request + (*Status_Response)(nil), // 5: sgtm.Status.Response +} +var file_sgtm_proto_depIdxs = []int32{ + 2, // 0: sgtm.WebAPI.Ping:input_type -> sgtm.Ping.Request + 4, // 1: sgtm.WebAPI.Status:input_type -> sgtm.Status.Request + 3, // 2: sgtm.WebAPI.Ping:output_type -> sgtm.Ping.Response + 5, // 3: sgtm.WebAPI.Status:output_type -> sgtm.Status.Response 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 @@ -334,13 +333,13 @@ var file_bounce_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_bounce_proto_init() } -func file_bounce_proto_init() { - if File_bounce_proto != nil { +func init() { file_sgtm_proto_init() } +func file_sgtm_proto_init() { + if File_sgtm_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_bounce_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Ping); i { case 0: return &v.state @@ -352,7 +351,7 @@ func file_bounce_proto_init() { return nil } } - file_bounce_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Status); i { case 0: return &v.state @@ -364,7 +363,7 @@ func file_bounce_proto_init() { return nil } } - file_bounce_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Ping_Request); i { case 0: return &v.state @@ -376,7 +375,7 @@ func file_bounce_proto_init() { return nil } } - file_bounce_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Ping_Response); i { case 0: return &v.state @@ -388,7 +387,7 @@ func file_bounce_proto_init() { return nil } } - file_bounce_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Status_Request); i { case 0: return &v.state @@ -400,7 +399,7 @@ func file_bounce_proto_init() { return nil } } - file_bounce_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_sgtm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Status_Response); i { case 0: return &v.state @@ -417,18 +416,18 @@ func file_bounce_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_bounce_proto_rawDesc, + RawDescriptor: file_sgtm_proto_rawDesc, NumEnums: 0, NumMessages: 6, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_bounce_proto_goTypes, - DependencyIndexes: file_bounce_proto_depIdxs, - MessageInfos: file_bounce_proto_msgTypes, + GoTypes: file_sgtm_proto_goTypes, + DependencyIndexes: file_sgtm_proto_depIdxs, + MessageInfos: file_sgtm_proto_msgTypes, }.Build() - File_bounce_proto = out.File - file_bounce_proto_rawDesc = nil - file_bounce_proto_goTypes = nil - file_bounce_proto_depIdxs = nil + File_sgtm_proto = out.File + file_sgtm_proto_rawDesc = nil + file_sgtm_proto_goTypes = nil + file_sgtm_proto_depIdxs = nil } diff --git a/pkg/bouncepb/bounce.pb.gw.go b/pkg/sgtmpb/sgtm.pb.gw.go similarity index 98% rename from pkg/bouncepb/bounce.pb.gw.go rename to pkg/sgtmpb/sgtm.pb.gw.go index 5e55d4f..1a3fa06 100644 --- a/pkg/bouncepb/bounce.pb.gw.go +++ b/pkg/sgtmpb/sgtm.pb.gw.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: bounce.proto +// source: sgtm.proto /* -Package bouncepb is a reverse proxy. +Package sgtmpb is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package bouncepb +package sgtmpb import ( "context" diff --git a/pkg/bouncepb/bounce_grpc.pb.go b/pkg/sgtmpb/sgtm_grpc.pb.go similarity index 92% rename from pkg/bouncepb/bounce_grpc.pb.go rename to pkg/sgtmpb/sgtm_grpc.pb.go index fa6cb27..0196082 100644 --- a/pkg/bouncepb/bounce_grpc.pb.go +++ b/pkg/sgtmpb/sgtm_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -package bouncepb +package sgtmpb import ( context "context" @@ -32,7 +32,7 @@ func NewWebAPIClient(cc grpc.ClientConnInterface) WebAPIClient { func (c *webAPIClient) Ping(ctx context.Context, in *Ping_Request, opts ...grpc.CallOption) (*Ping_Response, error) { out := new(Ping_Response) - err := c.cc.Invoke(ctx, "/bounce.WebAPI/Ping", in, out, opts...) + err := c.cc.Invoke(ctx, "/sgtm.WebAPI/Ping", in, out, opts...) if err != nil { return nil, err } @@ -41,7 +41,7 @@ func (c *webAPIClient) Ping(ctx context.Context, in *Ping_Request, opts ...grpc. func (c *webAPIClient) Status(ctx context.Context, in *Status_Request, opts ...grpc.CallOption) (*Status_Response, error) { out := new(Status_Response) - err := c.cc.Invoke(ctx, "/bounce.WebAPI/Status", in, out, opts...) + err := c.cc.Invoke(ctx, "/sgtm.WebAPI/Status", in, out, opts...) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func _WebAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bounce.WebAPI/Ping", + FullMethod: "/sgtm.WebAPI/Ping", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WebAPIServer).Ping(ctx, req.(*Ping_Request)) @@ -97,7 +97,7 @@ func _WebAPI_Status_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bounce.WebAPI/Status", + FullMethod: "/sgtm.WebAPI/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WebAPIServer).Status(ctx, req.(*Status_Request)) @@ -106,7 +106,7 @@ func _WebAPI_Status_Handler(srv interface{}, ctx context.Context, dec func(inter } var _WebAPI_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bounce.WebAPI", + ServiceName: "sgtm.WebAPI", HandlerType: (*WebAPIServer)(nil), Methods: []grpc.MethodDesc{ { @@ -119,5 +119,5 @@ var _WebAPI_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "bounce.proto", + Metadata: "sgtm.proto", } diff --git a/static/404.html b/static/404.html index bd2f66a..af6be28 100644 --- a/static/404.html +++ b/static/404.html @@ -1,6 +1,6 @@ - Bounce in Place + 404

404

diff --git a/static/index.html b/static/index.html index f7e243a..9b8c54f 100644 --- a/static/index.html +++ b/static/index.html @@ -1,8 +1,8 @@ - Bounce in Place + SGTM -

Bounce in Place

+

SGTM