An etcd client built on top of gun and egrpc.

Features

Generating etcd v3 API codes via the proto files in etcd v3.5.10, without changing their packets.

Extract ResponseHeader from rpc.proto into response_header.proto to avoid gpb to generate the same structure in multiple output pb modules.

Client APIs

Starting Client

Client = foo,
Opts = #{},
{ok, _Pid} = etcdgun:open(my_client, [{"127.0.0.1", 2379}], Opts),

%% Now you can use `my_client' to pick channels and call the etcd gRPC APIs.
{ok, Channel} = etcdgun_client:pick_channel(my_client).

%% Get etcd member list via v3 API
{ok, #{header := _, members := Members}} =
    etcdgun_etcdserverpb_cluster_client:member_list(Channel, #{}).

%% Check heath via egrpc provided standard health check API
{ok, #{status => 'SERVING'}} = egrpc_grpc_health_v1_health_client:check(Channel, #{}).

Client Options

See etcdgun:opts() for the available options.

Support unary interceptors and streaming interceptors.

API Call

Development

To Generate Protobuf Modules

rebar3 protobuf compile

To Generate the etcd gRPC Client Codes

rebar3 egrpc gen