grpc-k8s-sample

command module
v0.0.0-...-24c3a38 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

protobuf-sample

sample of protocol buffer with golang

this sample implements two api by using protobuf:

  1. adduser
  2. getuser

the protobuf is used to implement the api in 3ways:

  1. use protobuf as type definition tool (normal.go)
  2. use protobuf for rpc (rpc.go)
  3. use protobuf for grpc (gprc.go)

install protoc

  1. install brotobuf-all-x.x.x from protobuf
  2. unzip zip
  3. cd protobuf-x.x.x
  4. ./configure
  5. make
  6. make check
  7. sudo make install

install golang protocol buffer plugin

go get -u github.com/golang/protobuf/protoc-gen-go

compile .proto

protoc -I=$SRC_DIR --go_out=$DST_DIR $SRC_DIR/addressbook.proto

for more info

tutorial: https://developers.google.com/protocol-buffers/docs/gotutorial#compiling-your-protocol-buffers doc: https://developers.google.com/protocol-buffers/docs/proto3

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api module
Package apipb is a reverse proxy.
Package apipb is a reverse proxy.
gw module

Jump to

Keyboard shortcuts

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