Skip to content

mtmibjas/go-grpc-exe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-grpc-exe

This repository provides a simple example of a gRPC server and client implemented in Go.

Prerequisites

  • Go installed on your machine
  • Protocol Buffers compiler (protoc) installed

Install Protocol Buffers Compiler (protoc) On Linux sudo apt-get install protobuf-compiler

On macOS brew install protobuf

On Windows Download and install from: https://github.com/protocolbuffers/protobuf/releases

Getting Started

  1. Clone the repository:

    git clone https://github.com/mtmibjas/go-grpc-exe.git
    cd go-grpc-exe
    
  2. Install dependencies: go mod tidy

  3. Generate Go code from the Protocol Buffers definition:

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

  4. Run the gRPC server: go run server.go

  5. Run the gRPC client: go run client.go

Helpful Commands go get -u google.golang.org/grpc go get -u google.golang.org/protobuf go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Project Structure alerts.proto: Protocol Buffers definition file server.go: Implementation of the gRPC server client.go: Implementation of the gRPC client

Customize Feel free to customize the example.proto, server.go, and client.go files to suit your specific requirements. Explore the gRPC documentation for advanced features and configuration options.

Contributing If you find issues or want to contribute to this project, feel free to open a pull request or create an issue.

Replace the placeholder content with the actual content of your example.proto, server.go, and client.go files. Additionally, update the license information and any other details according to your project's requirements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages