working commit
This commit is contained in:
32
client.go
Normal file
32
client.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
||||
type Client struct {
|
||||
httpClient *http.Client
|
||||
authenticator Authenticator
|
||||
userAgent string
|
||||
}
|
||||
|
||||
func NewClient(skipTLSVerify bool) *Client {
|
||||
transport := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: skipTLSVerify,
|
||||
},
|
||||
}
|
||||
httpClient := &http.Client{
|
||||
Transport: transport,
|
||||
}
|
||||
return &Client{
|
||||
httpClient: httpClient,
|
||||
userAgent: "ociClient/1.0",
|
||||
}
|
||||
}
|
||||
|
||||
func (cli *Client) SetAuthenticator(auth Authenticator) {
|
||||
cli.authenticator = auth
|
||||
}
|
||||
Reference in New Issue
Block a user