func WithURL(url string) Option {
	return func(o *Orderer) error {
		o.url = url
		return nil
	}
}
WithURL is a functional option for the orderer.New constructor that configures the orderer's URL.
package orderer
import (
	"time"
	"golang.org/x/net/context"
	"google.golang.org/grpc"
	"google.golang.org/grpc/keepalive"
	grpcstatus "google.golang.org/grpc/status"
	"github.com/hyperledger/fabric-sdk-go/api/apiconfig"
	fab "github.com/hyperledger/fabric-sdk-go/api/apifabclient"
	ab "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/protos/orderer"
	"github.com/hyperledger/fabric-sdk-go/pkg/config/comm"
	"github.com/hyperledger/fabric-sdk-go/pkg/config/urlutil"
	"github.com/hyperledger/fabric-sdk-go/pkg/errors/status"
	"github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common"
	"github.com/spf13/cast"
	"github.com/hyperledger/fabric-sdk-go/pkg/logging"
	"github.com/pkg/errors"
	"github.com/hyperledger/fabric-sdk-go/internal/github.com/tjfoc/gmsm/sm2"
	credentials "github.com/hyperledger/fabric-sdk-go/internal/github.com/tjfoc/gmtls/gmcredentials"
)
var logger = logging.NewLogger("fabric_sdk_go")
type Orderer struct {
	config         apiconfig.Config
	url            string
	tlsCACert      *sm2.Certificate
	serverName     string
	grpcDialOption []grpc.DialOption
	kap            keepalive.ClientParameters
	dialTimeout    time.Duration
	failFast       bool
}
type Option func(*Orderer) error
func New(config apiconfig.Config, opts ...Option) (*Orderer, error) {
	orderer := &Orderer{config: config}
	for _, opt := range opts {
		err := opt(orderer)
		if err != nil {
			return nil, err
		}
	}
	var grpcOpts []grpc.DialOption
	if orderer.kap.Time > 0 {
		grpcOpts = append(grpcOpts, grpc.WithKeepaliveParams(orderer.kap))
	}
	grpcOpts = append(grpcOpts, grpc.WithDefaultCallOptions(grpc.FailFast(orderer.failFast)))
	orderer.dialTimeout = config.TimeoutOrDefault(apiconfig.OrdererConnection)
	if urlutil.IsTLSEnabled(orderer.url) {
		tlsConfig, err := comm.TLSConfig(orderer.tlsCACert, orderer.serverName, config)
		if err != nil {
			return nil, err
		}
		grpcOpts = append(grpcOpts, grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)))
	} else {
		grpcOpts = append(grpcOpts, grpc.WithInsecure())
	}
	orderer.url = urlutil.ToAddress(orderer.url)
	orderer.grpcDialOption = grpcOpts
	return orderer, nil
}