You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cli_relay.go
    path of file: ./repos/plumber/plumber
    
    the code of the file until where you have to start completion: package plumber

import (
	"github.com/pkg/errors"
	"github.com/posthog/posthog-go"
	"github.com/sirupsen/logrus"

	"github.com/streamdal/plumber/api"
	"github.com/streamdal/plumber/backends"
	"github.com/streamdal/plumber/options"
	"github.com/streamdal/plumber/relay"
	"github.com/streamdal/plumber/util"
	"github.com/streamdal/plumber/validate"
)

// HandleRelayCmd handles CLI relay mode. Container/envar mode is handled by processEnvRelayFlags
func (p *Plumber) HandleRelayCmd() error {
	if err := validate.RelayOptionsForCLI(p.CLIOptions.Relay); err != nil {
		return errors.Wrap(err, "unable to validate relay options")
	}

	backend, err := backends.New(p.cliConnOpts)
	if err != nil {
		return errors.Wrap(err, "unable to instantiate backend")
	}

	if err := p.startRelayService(); err != nil {
		return errors.Wrap(err, "unable to start relay service")
	}

	p.Telemetry.Enqueue(
    
func (p *Plumber) startRelayService() error {
	relayCfg := &relay.Config{
		Token:              p.CLIOptions.Relay.CollectionToken,
		GRPCAddress:        p.CLIOptions.Relay.XStreamdalGrpcAddress,
		NumWorkers:         p.CLIOptions.Relay.NumWorkers,
		Timeout:            util.DurationSec(p.CLIOptions.Relay.XStreamdalGrpcTimeoutSeconds),
		RelayCh:            p.RelayCh,
		DisableTLS:         p.CLIOptions.Relay.XStreamdalGrpcDisableTls,
		BatchSize:          p.CLIOptions.Relay.BatchSize,
		Type:               p.CLIOptions.Global.XBackend,
		ServiceShutdownCtx: p.ServiceShutdownCtx,
		MainShutdownFunc:   p.MainShutdownFunc,
		MainShutdownCtx:    p.MainShutdownCtx,
		DeadLetter:         p.CLIOptions.Relay.DeadLetter,
	}

	grpcRelayer, err := relay.New(relayCfg)
	if err != nil {
		return errors.Wrap(err, "unable to create new gRPC relayer")
	}

	// Launch HTTP server
	go func() {
		if _, err := api.Start(p.CLIOptions.Relay.XCliOptions.HttpListenAddress, options.VERSION); err != nil {
			logrus.Fatalf("unable to start API server: %s", err)
		}
	}()

	// Launch gRPC Relayer
	if err := grpcRelayer.StartWorkers(p.ServiceShutdownCtx); err != nil {
		return errors.Wrap(err, "unable to start gRPC relay workers")
	}

	go grpcRelayer.WaitForShutdown()

	return nil
}