func WithOnClose(onClose func()) ClientOpts {
	return func(c *Client) {
		c.userCloseFunc = onClose
	}
}
WithOnClose sets the close func whenever the client's Close() method is called
package ttrpc
import (
	"context"
	"io"
	"net"
	"os"
	"strings"
	"sync"
	"syscall"
	"time"
	"github.com/gogo/protobuf/proto"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
var ErrClosed = errors.New("ttrpc: closed")
type Client struct {
	codec   codec
	conn    net.Conn
	channel *channel
	calls   chan *callRequest
	ctx    context.Context
	closed func()
	closeOnce       sync.Once
	userCloseFunc   func()
	userCloseWaitCh chan struct{}
	errOnce     sync.Once
	err         error
	interceptor UnaryClientInterceptor
}
type ClientOpts func(c *Client)