working commit

This commit is contained in:
2026-03-01 21:35:40 +02:00
parent 86c7831cd8
commit 32c9cc26fc
3 changed files with 20 additions and 2 deletions

View File

@@ -22,6 +22,19 @@ func NewClient() *Client {
}
}
func NewClientWithTransport(transport http.RoundTripper, mwFunc ...MiddlewareFunc) *Client {
if transport == nil {
transport = NewDefaultTransport()
}
httpClient := &http.Client{
Transport: transport,
}
return &Client{
httpClient: httpClient,
userAgent: "ociClient/1.0",
}
}
func (cli *Client) SetTransport(transport http.RoundTripper) {
cli.httpClient.Transport = transport
}