sample_go_grpc_server

command module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Go GRPC server

Sample of GRPC server written on go

Setup protobuf

You can skip this section if you do not want to change existing protobuf

  1. Install protobuf on your system
  2. Install protoc-gen-go-grpc for go go install google.golang.org/protobuf/cmd/protoc-gen-go@latest. This is used to generate client/server code for golang

Generate client, server golang code with command:

protoc --go_out=./gen --go_opt=paths=source_relative --go-grpc_out=./gen --go-grpc_opt=paths=source_relative ./proto/my_service.proto

Setup project

You have to install go and sqlite3

Clone the project and install go packages

git clone https://github.com/Nikita-Filonov/sample_go_grpc_server`
cd ./sample_go_grpc_server
go mod download

Apply migrations

go install github.com/rubenv/sql-migrate/...@latest
sql-migrate up -config=./infrastructure/config.yml

Finally run the server

go mod download

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
gen
server
utils

Jump to

Keyboard shortcuts

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