From 28a10d813882d388021cba2d52fccdd1186f8b39 Mon Sep 17 00:00:00 2001 From: seeflood Date: Fri, 26 Aug 2022 19:30:31 +0800 Subject: [PATCH] feat(sdk): OSS go sdk (#771) --- sdk/go-sdk/client/client.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/go-sdk/client/client.go b/sdk/go-sdk/client/client.go index 7acafa55d9..decfb69c25 100644 --- a/sdk/go-sdk/client/client.go +++ b/sdk/go-sdk/client/client.go @@ -19,6 +19,7 @@ package client import ( "context" "log" + "mosn.io/layotto/spec/proto/extension/v1/s3" "net" "os" "sync" @@ -116,6 +117,8 @@ type Client interface { // Close cleans up all resources created by the client. Close() + + s3.ObjectStorageServiceClient } // NewClient instantiates runtime client using runtime_GRPC_PORT environment variable as port. @@ -165,13 +168,15 @@ func NewClientWithAddress(address string) (client Client, err error) { // NewClientWithConnection instantiates runtime client using specific connection. func NewClientWithConnection(conn *grpc.ClientConn) Client { return &GRPCClient{ - connection: conn, - protoClient: runtimev1pb.NewRuntimeClient(conn), + ObjectStorageServiceClient: s3.NewObjectStorageServiceClient(conn), + connection: conn, + protoClient: runtimev1pb.NewRuntimeClient(conn), } } // GRPCClient is the gRPC implementation of runtime client. type GRPCClient struct { + s3.ObjectStorageServiceClient connection *grpc.ClientConn protoClient runtimev1pb.RuntimeClient }