"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/code.gitea.io/sdk/gitea/client.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

client.go  (gitea-1.13.1):client.go  (gitea-1.13.2)
skipping to change at line 59 skipping to change at line 59
// NewClient initializes and returns a API client. // NewClient initializes and returns a API client.
func NewClient(url string, options ...func(*Client)) (*Client, error) { func NewClient(url string, options ...func(*Client)) (*Client, error) {
client := &Client{ client := &Client{
url: strings.TrimSuffix(url, "/"), url: strings.TrimSuffix(url, "/"),
client: &http.Client{}, client: &http.Client{},
ctx: context.Background(), ctx: context.Background(),
} }
for _, opt := range options { for _, opt := range options {
opt(client) opt(client)
} }
if err := client.CheckServerVersionConstraint(">=1.10"); err != nil { if err := client.checkServerVersionGreaterThanOrEqual(version1_10_0); err != nil {
return nil, err return nil, err
} }
return client, nil return client, nil
} }
// NewClientWithHTTP creates an API client with a custom http client // NewClientWithHTTP creates an API client with a custom http client
// Deprecated use SetHTTPClient option // Deprecated use SetHTTPClient option
func NewClientWithHTTP(url string, httpClient *http.Client) *Client { func NewClientWithHTTP(url string, httpClient *http.Client) *Client {
client, _ := NewClient(url, SetHTTPClient(httpClient)) client, _ := NewClient(url, SetHTTPClient(httpClient))
return client return client
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)