/istio_grpc

istio grpc sample

Primary LanguageGo

istio_grpc

proxy -> cache -> store

service api design

service CallProxy
{
    rpc GetName(NameReq) returns(NameResp);
    rpc GetDataFromCache(DataModel) returns(DataModel);
    rpc GetDataFromStore(DataModel) returns(DataModel);
    rpc SetDataToCache(DataModel) returns(DataModel);
    rpc SetDataToStore(DataModel) returns(DataModel);

    // get from cache, if cache null, continue get store
    rpc GetData(DataModel) returns(DataModel);

    // delete cache, update store
    rpc SetData(DataModel) returns(DataModel);
}

service CallCache
{
    rpc GetName(NameReq) returns(NameResp);
    rpc GetData(DataModel) returns(DataModel);
    rpc GetDataTrace(DataModel) returns(DataModel);
    rpc SetData(DataModel) returns(DataModel);
    rpc DeleteData(DataModel) returns(DataModel);
}

service CallStore
{
    rpc GetName(NameReq) returns(NameResp);
    rpc GetData(DataModel) returns(DataModel);
    rpc SetData(DataModel) returns(DataModel);
    rpc DeleteData(DataModel) returns(DataModel);
}

call.proto

Dep

go get github.com/mattn/goreman

Local Usage

  1. protoc
make gen
  1. build golang file
make build
  1. run proxy/cache/store
make run
  1. use client to test
./bin/client -debug=true

istio Usage

  1. docker build
make docker-build
  1. apply istio
to do
  1. client test
to do