Skip to content

Commit

Permalink
reduced the clutter in the api directory and introduced a company as …
Browse files Browse the repository at this point in the history
…recomended by the docs
  • Loading branch information
CommanderStorm committed Sep 12, 2023
1 parent 81e2307 commit b6c2e3c
Show file tree
Hide file tree
Showing 29 changed files with 1,621 additions and 3,238 deletions.
2 changes: 1 addition & 1 deletion client/localServer/localTestClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"
"time"

pb "github.com/TUM-Dev/Campus-Backend/server/api"
pb "github.com/TUM-Dev/Campus-Backend/server/api/tumdev"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down
2 changes: 1 addition & 1 deletion client/publicServer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"
"crypto/x509"
pb "github.com/TUM-Dev/Campus-Backend/api"
pb "github.com/TUM-Dev/Campus-Backend/server/api/tumdev"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down
1 change: 1 addition & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ COPY go.mod go.sum ./
RUN go mod download

# Copy source code
COPY api/tumdev/campus_backend.swagger.json ./swagger/swagger.json
COPY . .

# bundle version into binary if specified in build-args, dev otherwise.
Expand Down
14 changes: 3 additions & 11 deletions server/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,10 @@ sudo dnf install go protobuf
## Buf
Buf is required to generate protobuf files automatically.
Follow the installation instructions detailed here: https://docs.buf.build/installation#github-releases
Alternatively, we have prepared this installation script:

## Go Dependencies

```bash
go get google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc

go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
```shell
sh installBuf.sh
```

## Generating
Expand Down
2 changes: 1 addition & 1 deletion server/api/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ plugins:
- paths=source_relative
- allow_repeated_fields_in_body=true
- name: openapiv2
out: gen/openapiv2
out: .
opt:
- allow_repeated_fields_in_body=true
6 changes: 0 additions & 6 deletions server/api/buf.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
3 changes: 1 addition & 2 deletions server/api/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: v1
deps:
- buf.build/googleapis/googleapis
deps: []
lint:
use:
- DEFAULT
Expand Down
Loading

0 comments on commit b6c2e3c

Please sign in to comment.