package client import ( "crypto/tls" "github.com/go-resty/resty/v2" "time" ) type Client struct { restyClient *resty.Client baseUrl string token string options *Options } func NewClient(baseUrl string, token string, opts ...Option) *Client { options := new(Options) for _, opt := range opts { opt(options) } restyClient := resty.New(). SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}). SetTimeout(time.Duration(options.timeoutSec) * time.Second). SetBaseURL(baseUrl) return &Client{ restyClient: restyClient, baseUrl: baseUrl, token: token, options: options, } }