GithubHelp home page GithubHelp logo

devlights / go-grpc-uds-example Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 4.0 49 KB

gRPC with Unix domain socket (UDS) example by golang

License: MIT License

Go 100.00%
go golang unix-domain-socket grpc grpc-go protobuf protocol-buffers

go-grpc-uds-example's Introduction

go-grpc-uds-example

gRPC with Unix domain socket (UDS) example by golang

It can be executed using go-task.

$ task --list
task: Available tasks for this project:
* install-requirements: install requirements
* protoc:               gen protoc
* run:                  run

Install gRPC and Go libraries

task install-requirements

Run protoc

task protoc

Run Server and Client

task run

Example

$ task install-requirements
task: [install-requirements] mkdir tmp
task: [_download-protoc] curl -L https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip --output protoc.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1548k  100 1548k    0     0  4254k      0 --:--:-- --:--:-- --:--:-- 4254k
task: [_unzip-protoc] unzip ./protoc.zip -d protoc
Archive:  ./protoc.zip
  inflating: protoc/bin/protoc       
  inflating: protoc/include/google/protobuf/any.proto  
  inflating: protoc/include/google/protobuf/api.proto  
  inflating: protoc/include/google/protobuf/compiler/plugin.proto  
  inflating: protoc/include/google/protobuf/descriptor.proto  
  inflating: protoc/include/google/protobuf/duration.proto  
  inflating: protoc/include/google/protobuf/empty.proto  
  inflating: protoc/include/google/protobuf/field_mask.proto  
  inflating: protoc/include/google/protobuf/source_context.proto  
  inflating: protoc/include/google/protobuf/struct.proto  
  inflating: protoc/include/google/protobuf/timestamp.proto  
  inflating: protoc/include/google/protobuf/type.proto  
  inflating: protoc/include/google/protobuf/wrappers.proto  
  inflating: protoc/readme.txt       
task: [install-requirements] mkdir -p bin
task: [install-requirements] rm -rf bin/protoc
task: [_locate-protoc] mv -f ./protoc/ ../bin
task: [install-requirements] rm -rf ./tmp
task: [install-requirements] go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
task: [install-requirements] go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
task: [install-requirements] rm -rf ./text-files; git clone --quiet https://github.com/devlights/text-files


$ task protoc
task: [protoc] mkdir -p internal
task: [protoc] bin/protoc/bin/protoc --go_out=. --go-grpc_out=require_unimplemented_servers=false:. proto/*.proto


$ task run
task: [run] go run cmd/server/server.go &
task: [run] sleep 1
task: [run] go run cmd/client/client.go
data:"HELLO WORLD"
data:"GOLANG"
data:"GOROUTINE"
data:"THIS PROGRAM RUNS ON CROSTINI"
task: [run] sleep 1
task: [run] pkill server
signal: terminated

go-grpc-uds-example's People

Contributors

devlights avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.