File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1- 2.7.2
1+ 2.8.0
Original file line number Diff line number Diff line change @@ -5,17 +5,20 @@ import "net/http"
55type transport struct {
66 underlyingTransport http.RoundTripper
77 apiKey string
8+ apiVersion string
89}
910
1011func (t * transport ) RoundTrip (req * http.Request ) (* http.Response , error ) {
1112 req .Header .Add ("X-Api-Key" , t .apiKey )
13+ req .Header .Add ("X-Formal-API-Version" , "2025-02-24" )
1214 return t .underlyingTransport .RoundTrip (req )
1315}
1416
15- func NewClient (apiKey string ) * http.Client {
17+ func NewClient (apiKey , apiVersion string ) * http.Client {
1618 return & http.Client {
1719 Transport : & transport {
1820 apiKey : apiKey ,
21+ apiVersion : apiVersion ,
1922 underlyingTransport : http .DefaultTransport ,
2023 },
2124 }
Original file line number Diff line number Diff line change @@ -36,8 +36,13 @@ func New(apiKey string) *FormalSDK {
3636}
3737
3838// NewWithUrl creates a new FormalSDK instance with a custom URL
39- func NewWithUrl (apiKey string , url string ) * FormalSDK {
40- httpClient := NewClient (apiKey )
39+ func NewWithUrl (apiKey , url string ) * FormalSDK {
40+ return NewWithParams (apiKey , "2025-02-24" , url )
41+ }
42+
43+ // NewWithParams creates a new FormalSDK instance with all custom params
44+ func NewWithParams (apiKey , apiVersion , url string ) * FormalSDK {
45+ httpClient := NewClient (apiKey , apiVersion )
4146
4247 return & FormalSDK {
4348 ConnectorServiceClient : corev1connect .NewConnectorServiceClient (httpClient , url ),
You can’t perform that action at this time.
0 commit comments