Skip to content

Commit

Permalink
go sdk support OSS API
Browse files Browse the repository at this point in the history
Signed-off-by: seeflood <[email protected]>
  • Loading branch information
seeflood committed Aug 26, 2022
1 parent 5dd983e commit 53d4dca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sdk/go-sdk/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package client
import (
"context"
"log"
"mosn.io/layotto/spec/proto/extension/v1/s3"
"net"
"os"
"sync"
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 53d4dca

Please sign in to comment.