diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-18 15:17:27 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-18 15:17:27 -0700 |
| commit | 076c8bd3bcb6f76c84a8df50aff923d493a6bb9d (patch) | |
| tree | c04613e01216887c2efef3452d217e621832a04b /weed/pb/grpc_client_server.go | |
| parent | 5d346d44bdec30d632840fb30c520cc2a334e004 (diff) | |
| download | seaweedfs-076c8bd3bcb6f76c84a8df50aff923d493a6bb9d.tar.xz seaweedfs-076c8bd3bcb6f76c84a8df50aff923d493a6bb9d.zip | |
filer master start up with default ip address instead of just localhost
Diffstat (limited to 'weed/pb/grpc_client_server.go')
| -rw-r--r-- | weed/pb/grpc_client_server.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go index 8960a333c..8418397b0 100644 --- a/weed/pb/grpc_client_server.go +++ b/weed/pb/grpc_client_server.go @@ -14,6 +14,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" + "github.com/chrislusf/seaweedfs/weed/pb/messaging_pb" ) const ( @@ -158,6 +159,15 @@ func WithMasterClient(master string, grpcDialOption grpc.DialOption, fn func(cli } +func WithBrokerGrpcClient(brokerGrpcAddress string, grpcDialOption grpc.DialOption, fn func(client messaging_pb.SeaweedMessagingClient) error) error { + + return WithCachedGrpcClient(func(grpcConnection *grpc.ClientConn) error { + client := messaging_pb.NewSeaweedMessagingClient(grpcConnection) + return fn(client) + }, brokerGrpcAddress, grpcDialOption) + +} + func WithFilerClient(filer string, grpcDialOption grpc.DialOption, fn func(client filer_pb.SeaweedFilerClient) error) error { filerGrpcAddress, parseErr := ParseServerToGrpcAddress(filer) |
