You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client.go
    path of file: ./repos/rill/runtime/client
    
    the code of the file until where you have to start completion: package client

import (
	"context"
	"fmt"
	"net/url"

	runtimev1 "github.com/rilldata/rill/proto/gen/rill/runtime/v1"
	"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"
	"google.golang.org/grpc/credentials/insecure"
)

// Client connects to a runtime server.
// It's a thin wrapper around the generated gRPC client for proto/rill/runtime/v1.
type Client struct {
	runtimev1.RuntimeServiceClient
	conn *grpc.ClientConn
}

// New creates a new Client and opens a connection. You must call Close() when done wi
    
func New(runtimeHost, bearerToken string) (*Client, error) {
	uri, err := url.Parse(runtimeHost)
	if err != nil {
		return nil, err
	}

	opts := []grpc.DialOption{
		grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
	}

	if uri.Scheme == "http" {
		opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
	} else {
		opts = append(opts, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, ""))) // NOTE: Defaults to host's root certs
		// There must be a port. Default to TLS port.
		if uri.Port() == "" {
			uri.Host = fmt.Sprintf("%s:443", uri.Host)
		}
	}

	if bearerToken != "" {
		secure := uri.Scheme != "http"
		opts = append(opts, grpc.WithPerRPCCredentials(bearerAuth{token: bearerToken, secure: secure}))
	}

	conn, err := grpc.Dial(uri.Host, opts...)
	if err != nil {
		return nil, err
	}

	return &Client{
		RuntimeServiceClient: runtimev1.NewRuntimeServiceClient(conn),
		conn:                 conn,
	}, nil
}