func WithBearerToken(tok string) Option {
	return func(opts *backendOptions) {
		opts.bearerToken = tok
	}
}
WithBearerToken sets a bearer token to use for all requests.
package eqgrpc
import (
	"context"
	"fmt"
	"io"
	"net"
	"time"
	"github.com/google/uuid"
	"github.com/shiblon/entroq"
	"github.com/shiblon/entroq/pkg/authz"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
	pb "github.com/shiblon/entroq/proto"
	hpb "google.golang.org/grpc/health/grpc_health_v1"
)
const (
	DefaultAddr = ":37706"
	ClaimRetryInterval = 2 * time.Minute
	MB = 1024 * 1024
)
type backendOptions struct {
	dialOpts    []grpc.DialOption
	bearerToken string
}
type Option func(*backendOptions)
func WithDialOpts(d ...grpc.DialOption) Option {
	return func(opts *backendOptions) {
		opts.dialOpts = append(opts.dialOpts, d...)
	}
}
func WithInsecure() Option {
	return WithDialOpts(grpc.WithInsecure())
}
func WithDialer(f func(string, time.Duration) (net.Conn, error)) Option {
	return WithDialOpts(grpc.WithDialer(f))
}
func WithBlock() Option {
	return WithDialOpts(grpc.WithBlock())
}
func WithNiladicDialer(f func() (net.Conn, error)) Option {
	return WithDialOpts(grpc.WithDialer(func(string, time.Duration) (net.Conn, error) {
		return f()
	}))
}
func WithMaxSize(maxMB int) Option {
	return WithDialOpts(grpc.WithDefaultCallOptions(
		grpc.MaxCallRecvMsgSize(maxMB*MB),
		grpc.MaxCallSendMsgSize(maxMB*MB),
	))
}