func WithLongConnection(cfg connpool.IdleConfig) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithLongConnection(%+v)", cfg))
		o.PoolCfg = connpool.CheckPoolConfig(cfg)
	}}
}
WithLongConnection enables long connection with kitex's built-in pooling implementation.
package client
import (
	"context"
	"fmt"
	"net"
	"strings"
	"time"
	"github.com/cloudwego/kitex/internal/client"
	internal_stats "github.com/cloudwego/kitex/internal/stats"
	"github.com/cloudwego/kitex/pkg/circuitbreak"
	"github.com/cloudwego/kitex/pkg/connpool"
	"github.com/cloudwego/kitex/pkg/discovery"
	"github.com/cloudwego/kitex/pkg/endpoint"
	"github.com/cloudwego/kitex/pkg/http"
	"github.com/cloudwego/kitex/pkg/klog"
	"github.com/cloudwego/kitex/pkg/loadbalance"
	"github.com/cloudwego/kitex/pkg/loadbalance/lbcache"
	"github.com/cloudwego/kitex/pkg/remote"
	"github.com/cloudwego/kitex/pkg/remote/trans/netpollmux"
	"github.com/cloudwego/kitex/pkg/remote/trans/nphttp2"
	"github.com/cloudwego/kitex/pkg/retry"
	"github.com/cloudwego/kitex/pkg/rpcinfo"
	"github.com/cloudwego/kitex/pkg/stats"
	"github.com/cloudwego/kitex/pkg/utils"
	"github.com/cloudwego/kitex/transport"
)
type Option = client.Option
type Options = client.Options
type Suite interface {
	Options() []Option
}
func WithTransportProtocol(tp transport.Protocol) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		tpName := tp.String()
		if tpName == transport.Unknown {
			panic(fmt.Errorf("WithTransportProtocol: invalid '%v'", tp))
		}
		if tp == transport.GRPC {
			o.RemoteOpt.ConnPool = nphttp2.NewConnPool()
			o.RemoteOpt.CliHandlerFactory = nphttp2.NewCliTransHandlerFactory()
		}
		di.Push(fmt.Sprintf("WithTransportProtocol(%s)", tpName))
		rpcinfo.AsMutableRPCConfig(o.Configs).SetTransportProtocol(tp)
	}}
}
func WithSuite(suite Suite) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		var nested struct {
			Suite   string
			Options utils.Slice
		}
		nested.Suite = fmt.Sprintf("%T(%+v)", suite, suite)
		for _, op := range suite.Options() {
			op.F(o, &nested.Options)
		}
		di.Push(nested)
	}}
}
func WithMiddleware(mw endpoint.Middleware) Option {
	mwb := func(ctx context.Context) endpoint.Middleware {
		return mw
	}
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithMiddleware(%+v)", utils.GetFuncName(mw)))
		o.MWBs = append(o.MWBs, mwb)
	}}
}
func WithMiddlewareBuilder(mwb endpoint.MiddlewareBuilder) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithMiddlewareBuilder(%+v)", utils.GetFuncName(mwb)))
		o.MWBs = append(o.MWBs, mwb)
	}}
}
func WithInstanceMW(mw endpoint.Middleware) Option {
	imwb := func(ctx context.Context) endpoint.Middleware {
		return mw
	}
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithInstanceMW(%+v)", utils.GetFuncName(mw)))
		o.IMWBs = append(o.IMWBs, imwb)
	}}
}
func WithDestService(svr string) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithDestService(%s)", svr))
		o.Svr.ServiceName = svr
	}}
}
func WithHostPorts(hostports ...string) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithHostPorts(%v)", hostports))
		var ins []discovery.Instance
		for _, hp := range hostports {
			if _, err := net.ResolveTCPAddr("tcp", hp); err == nil {
				ins = append(ins, discovery.NewInstance("tcp", hp, discovery.DefaultWeight, nil))
				continue
			}
			if _, err := net.ResolveUnixAddr("unix", hp); err == nil {
				ins = append(ins, discovery.NewInstance("unix", hp, discovery.DefaultWeight, nil))
				continue
			}
			panic(fmt.Errorf("WithHostPorts: invalid '%s'", hp))
		}
		if len(ins) == 0 {
			panic("WithHostPorts() requires at least one argument")
		}
		o.Targets = strings.Join(hostports, ",")
		o.Resolver = &discovery.SynthesizedResolver{
			ResolveFunc: func(ctx context.Context, key string) (discovery.Result, error) {
				return discovery.Result{
					Cacheable: true,
					CacheKey:  "fixed",
					Instances: ins,
				}, nil
			},
			NameFunc: func() string { return o.Targets },
		}
	}}
}
func WithResolver(r discovery.Resolver) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithResolver(%T)", r))
		o.Resolver = r
	}}
}
func WithHTTPResolver(r http.Resolver) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithHTTPResolver(%T)", r))
		o.HTTPResolver = r
	}}
}
func WithShortConnection() Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push("WithShortConnection")
		o.PoolCfg = new(connpool.IdleConfig)
	}}
}