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: unipayclient.go
    path of file: ./repos/go-doudou/cmd/internal/openapi/v3/codegen/testdata/test
    
    the code of the file until where you have to start completion: /**
* Generated by go-doudou v2.0.4.
* You can edit it as your need.
 */
package test

import (
	"context"
	"fmt"
	"net/http"

	"github.com/go-resty/resty/v2"
	_querystring "github.com/google/go-querystring/query"
	"github.com/opentracing-contrib/go-stdlib/nethttp"
	"github.com/opentracing/opentracing-go"
	"github.com/pkg/errors"
	"github.com/unionj-cloud/go-doudou/v2/framework/registry"
	"github.com/unionj-cloud/go-doudou/v2/framework/restclient"
)

type UnipayClient struct {
	provider registry.IServiceProvider
	client   *resty.Client
	rootPath string
}

func (receiver *UnipayClient) SetRootPath(rootPath string) {
	receiver.rootPath = rootPath
}

func (receiver *UnipayClient) SetProvider(provider registry.IServiceProvider) {
	receiver.provider = provider
}

func (receiver *UnipayClient) SetClient(client *resty.Client) {
	receiver.client = client
}
func (receiver *UnipayClient) GetUnipayStartUnionPay(ctx context.Context, _headers map[string]string
    
func NewUnipay(opts ...restclient.RestClientOption) *UnipayClient {
	defaultProvider := restclient.NewServiceProvider("UNIPAY")
	defaultClient := restclient.NewClient()

	svcClient := &UnipayClient{
		provider: defaultProvider,
		client:   defaultClient,
	}

	for _, opt := range opts {
		opt(svcClient)
	}

	svcClient.client.OnBeforeRequest(func(_ *resty.Client, request *resty.Request) error {
		request.URL = svcClient.provider.SelectServer() + svcClient.rootPath + request.URL
		return nil
	})

	svcClient.client.SetPreRequestHook(func(_ *resty.Client, request *http.Request) error {
		traceReq, _ := nethttp.TraceRequest(opentracing.GlobalTracer(), request,
			nethttp.OperationName(fmt.Sprintf("HTTP %s: %s", request.Method, request.URL.Path)))
		*request = *traceReq
		return nil
	})

	svcClient.client.OnAfterResponse(func(_ *resty.Client, response *resty.Response) error {
		nethttp.TracerFromRequest(response.Request.RawRequest).Finish()
		return nil
	})

	return svcClient
}