func (sdk *FabricSDK) NewClient(identityOpt IdentityOption, opts ...ContextOption) *ClientContext {
	provider := func() (*clientContext, error) {
		o, err := newContextOptions(sdk.config, opts)
		if err != nil {
			return nil, errors.WithMessage(err, "unable to retrieve configuration from SDK")
		}
		identity, err := sdk.newIdentity(o.orgID, identityOpt)
		if err != nil {
			return nil, errors.WithMessage(err, "unable to create client context")
		}
		cc := clientContext{
			opts:          o,
			identity:      identity,
			providers:     sdk.context(),
			clientFactory: sdk.opts.Session,
		}
		return &cc, nil
	}
	client := ClientContext{
		provider: provider,
	}
	return &client
}
NewClient allows creation of transactions using the supplied identity as the credential.
package fabsdk
import (
	"github.com/hyperledger/fabric-sdk-go/api/apiconfig"
	"github.com/hyperledger/fabric-sdk-go/api/apifabclient"
	"github.com/hyperledger/fabric-sdk-go/api/apitxn/chclient"
	chmgmt "github.com/hyperledger/fabric-sdk-go/api/apitxn/chmgmtclient"
	resmgmt "github.com/hyperledger/fabric-sdk-go/api/apitxn/resmgmtclient"
	apisdk "github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/api"
	"github.com/pkg/errors"
)
type ClientContext struct {
	provider clientProvider
}
type ContextOption func(opts *contextOptions) error
type contextOptions struct {
	orgID  string
	config apiconfig.Config
}
type ClientOption func(opts *clientOptions) error
type clientOptions struct {
	targetFilter apifabclient.TargetFilter
}
type clientProvider func() (*clientContext, error)
type clientContext struct {
	opts          *contextOptions
	identity      apifabclient.IdentityContext
	providers     providers
	clientFactory apisdk.SessionClientFactory
}
type providers interface {
	apisdk.Providers
}
func WithOrg(name string) ContextOption {
	return func(opts *contextOptions) error {
		opts.orgID = name
		return nil
	}
}
func WithTargetFilter(targetFilter apifabclient.TargetFilter) ClientOption {
	return func(opts *clientOptions) error {
		opts.targetFilter = targetFilter
		return nil
	}
}
func withConfig(config apiconfig.Config) ContextOption {
	return func(opts *contextOptions) error {
		opts.config = config
		return nil
	}
}