DisysExercise1

module
v0.0.0-...-13a28ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: MIT

README

DisysExercise1

Group members

Group name: Point of Go return

Server

To run the server, enter the server folder and run go run .. The server will then be listening at localhost:8080.

Note: the server does not contain actual business logic - i.e. the requests don't actually do anything. It's just a constant response.

Client

To run the client, enter the client folder and run go run main.go.

Protocol Buffers

In the /gRPC/server folder, run:

Example output

Server
2021/10/03 21:47:39 Server started
2021/10/03 21:47:46 GET /course/1 CourseCourseIdGet 0s
2021/10/03 21:47:46 POST /course CoursePost 0s
2021/10/03 21:47:46 PUT /course/1 CourseCourseIdPut 0s
2021/10/03 21:47:46 DELETE /course/1 CourseCourseIdDelete 0s
Client
Requesting [GET] http://127.0.0.1:8080/course/1
{
        "id": 0,
        "name": "string",
        "expectedWorkload": 0,
        "rating": 0
}

Requesting [POST] http://127.0.0.1:8080/course
{
        "id": 0,
        "name": "string",
        "expectedWorkload": 0,
        "rating": 0
}

Requesting [PUT] http://127.0.0.1:8080/course/1
{
        "id": 0,
        "name": "string",
        "expectedWorkload": 0,
        "rating": 0
}

Requesting [DELETE] http://127.0.0.1:8080/course/1
{
        "id": 0,
        "name": "string",
        "expectedWorkload": 0,
        "rating": 0
}
Installation
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Build IDL for the server

protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative service.proto

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL