Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): OSS go sdk #771

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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